Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JairGudino
Copy link

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

Copy link

Hello @JairGudino, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

@github-actions github-actions bot added platform: NXP Drivers NXP Semiconductors, drivers area: DAC Digital-to-Analog Converter labels May 20, 2025
Copy link
Collaborator

@DerekSnell DerekSnell left a 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.

Copy link
Collaborator

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

Comment on lines 54 to 56
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
Copy link
Collaborator

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.

Comment on lines 147 to 149
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
Copy link
Collaborator

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.

Comment on lines 154 to 158
{ static const struct dac_channel_cfg dac_ch_cfg_pm = {
.channel_id = DAC_CHANNEL_ID_RESTORE,
.resolution = DAC_RESOLUTION_RESTORE,
.buffered = true
};
Copy link
Collaborator

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?

Comment on lines 162 to 164
break;
case PM_DEVICE_ACTION_SUSPEND:
break;
Copy link
Collaborator

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.

case PM_DEVICE_ACTION_TURN_OFF:
break;
case PM_DEVICE_ACTION_TURN_ON:
nxp_gau_dac_init_common(dev);
Copy link
Collaborator

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;

@github-actions github-actions bot requested review from butok and EmilioCBen May 23, 2025 19:45
drivers: actuator: dac_mcux_gau: Add PM3 support

PM3 support to the rw61x in the dac driver added
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: DAC Digital-to-Analog Converter platform: NXP Drivers NXP Semiconductors, drivers platform: NXP NXP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants