Skip to content

Conversation

@alrodlim
Copy link
Contributor

Tested samples/drivers/adc/adc_dt on FRDM-RW612. Verified that the ADC state is restored after PM3 mode and the read data is consistent.

Suspend and standby should disable ADCs before
entering low power.

Signed-off-by: Alex Rodriguez <alejandro.rodriguezlimon@nxp.com>
@github-actions github-actions bot added area: ADC Analog-to-Digital Converter (ADC) platform: NXP Drivers NXP Semiconductors, drivers platform: NXP NXP area: Samples Samples labels May 13, 2025
@alrodlim alrodlim force-pushed the feature/adc_mcux_gau_adc_enable_pm3 branch 2 times, most recently from b53ab2c to 19b2f50 Compare May 13, 2025 19:25
Comment on lines 210 to 212
/* Ideally we would return error here, but Zephyr API
* has no error for a failed calibration.
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this zephyr api might not explicitly say that "other negative value is error" , but most in zephyr do so I think it's okay to return error like -EIO in this case. It was probably just forgotten . In fact you could add it to the API docstring in this PR and I doubt there would be much problem. maintainer cc @anangl

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@alrodlim alrodlim force-pushed the feature/adc_mcux_gau_adc_enable_pm3 branch from 19b2f50 to f319b15 Compare May 13, 2025 21:10
Enables sleep mode (PM3) on RW61x. The driver re-enables
the ADC after wakeup and restores its state based on
the configuration before low power is entered. Note that
the driver re-enables the GAU after wakeup since it's not
done automatically.

Signed-off-by: Alex Rodriguez <alejandro.rodriguezlimon@nxp.com>
@alrodlim alrodlim force-pushed the feature/adc_mcux_gau_adc_enable_pm3 branch from f319b15 to c20b45c Compare May 13, 2025 21:16
alrodlim added 2 commits May 13, 2025 16:28
Enables system PM and standby mode to
test PM3 functionality.

Signed-off-by: Alex Rodriguez <alejandro.rodriguezlimon@nxp.com>
Explicitly state that any returned negative value is an error

Signed-off-by: Alex Rodriguez <alejandro.rodriguezlimon@nxp.com>
@alrodlim alrodlim force-pushed the feature/adc_mcux_gau_adc_enable_pm3 branch from c20b45c to b7cbb72 Compare May 13, 2025 21:28
@sonarqubecloud
Copy link

@mmahadevan108 mmahadevan108 requested a review from decsny May 15, 2025 14:36
* interval was too small. All requested samples are written
* in the buffer, but at least some of them were taken with
* an extra delay compared to what was scheduled.
* @retval <0 Any other negative value indicates an error condition.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anangl please confirm this makes sense for you

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's fine by me.

Comment on lines +434 to +435
case PM_DEVICE_ACTION_SUSPEND:
break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are enabling device PM, then since ADC is one of the biggest power consumers of the whole chip, I think we should try to take power saving actions on suspend, maybe by disabling the module and/or gating it's clock.

@github-actions
Copy link

github-actions bot commented Aug 4, 2025

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@mmahadevan108
Copy link
Contributor

@alrodlim , is there anything more that needs to be done from your end on this PR?

@github-actions
Copy link

github-actions bot commented Oct 8, 2025

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Oct 8, 2025
@github-actions github-actions bot closed this Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ADC Analog-to-Digital Converter (ADC) area: Samples Samples platform: NXP Drivers NXP Semiconductors, drivers platform: NXP NXP Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants