-
Notifications
You must be signed in to change notification settings - Fork 8.4k
NXP drivers: mcux gau adc: adds PM low power support #89904
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
NXP drivers: mcux gau adc: adds PM low power support #89904
Conversation
Suspend and standby should disable ADCs before entering low power. Signed-off-by: Alex Rodriguez <alejandro.rodriguezlimon@nxp.com>
b53ab2c to
19b2f50
Compare
drivers/adc/adc_mcux_gau_adc.c
Outdated
| /* Ideally we would return error here, but Zephyr API | ||
| * has no error for a failed calibration. | ||
| */ |
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.
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
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.
Done
19b2f50 to
f319b15
Compare
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>
f319b15 to
c20b45c
Compare
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>
c20b45c to
b7cbb72
Compare
|
| * 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. |
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.
@anangl please confirm this makes sense for you
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.
Yes, it's fine by me.
| 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.
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.
|
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. |
|
@alrodlim , is there anything more that needs to be done from your end on this PR? |
|
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. |



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.