-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Dac pm3 support #90240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Dac pm3 support #90240
Conversation
Hello @JairGudino, and thank you very much for your first pull request to the Zephyr project! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @JairGudino ,
Thank you for contributing this. We need to squash your PR into a single commit. And clean up the white space and compliance issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update copyright year:
Copyright 2023, 2025 NXP
drivers/dac/dac_mcux_gau.c
Outdated
pm_policy_state_lock_get(PM_STATE_STANDBY, PM_ALL_SUBSTATES); //Lock the PM MODE 3 | ||
pm_policy_state_lock_get(PM_STATE_SUSPEND_TO_IDLE, PM_ALL_SUBSTATES); //Lock the PM MODE 2 | ||
pm_policy_state_lock_get(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES); //Lock the PM MODE 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use pm_policy_device_power_lock_get()
like PR #88722. That method is more portable and locks power modes specified in the devicetree, rather than hard-coding the power modes here.
drivers/dac/dac_mcux_gau.c
Outdated
pm_policy_state_lock_put(PM_STATE_STANDBY, PM_ALL_SUBSTATES); //Lock the PM MODE 3 | ||
pm_policy_state_lock_put(PM_STATE_SUSPEND_TO_IDLE, PM_ALL_SUBSTATES); //Lock the PM MODE 2 | ||
pm_policy_state_lock_put(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES); //Lock the PM MODE 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use pm_policy_device_power_lock_put()
. I'm also concerned about the logic here. The PM lock_get()
and lock_put()
APIs use counters to track how many times lock_get()
was called. The RW61x DAC has two channels. This driver is getting the lock in nxp_gau_dac_channel_setup()
, and releasing the lock in nxp_gau_deinit()
. If the app configures both channels, nxp_gau_dac_channel_setup()
is called twice, right? Does that mean nxp_gau_deinit()
must be called twice to release the lock? I'm not sure that is supported.
drivers/dac/dac_mcux_gau.c
Outdated
{ static const struct dac_channel_cfg dac_ch_cfg_pm = { | ||
.channel_id = DAC_CHANNEL_ID_RESTORE, | ||
.resolution = DAC_RESOLUTION_RESTORE, | ||
.buffered = true | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is dac_ch_cfg_pm
used?
drivers/dac/dac_mcux_gau.c
Outdated
break; | ||
case PM_DEVICE_ACTION_SUSPEND: | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we can remove these 2 breaks, and collapse these 3 actions.
drivers/dac/dac_mcux_gau.c
Outdated
case PM_DEVICE_ACTION_TURN_OFF: | ||
break; | ||
case PM_DEVICE_ACTION_TURN_ON: | ||
nxp_gau_dac_init_common(dev); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent to align with break;
drivers: actuator: dac_mcux_gau: Add PM3 support PM3 support to the rw61x in the dac driver added
9b5c9b4
to
2e12ac6
Compare
|
PM3 support to the DAC driver, these changes prevent the pm3 state when the dac is enabled and free the power management states after the dac deinit