Skip to content
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

nRF SAADC Add PM device runtime support #85495

Merged

Conversation

bjarki-andreasen
Copy link
Collaborator

@bjarki-andreasen bjarki-andreasen commented Feb 10, 2025

Add PM device runtime support to nRF SAADC device driver.

@bjarki-andreasen bjarki-andreasen changed the title Nrf saadc add pm device nRF SAADC Add PM device runtime support Feb 10, 2025
@bjarki-andreasen bjarki-andreasen marked this pull request as ready for review February 10, 2025 11:15
@zephyrbot zephyrbot added area: ADC Analog-to-Digital Converter (ADC) platform: nRF Nordic nRFx labels Feb 10, 2025
Comment on lines 173 to 181
static void saadc_pm_suspend(void)
{
nrf_saadc_disable(NRF_SAADC);
}

static void saadc_pm_resume(void)
{
nrf_saadc_enable(NRF_SAADC);
}
Copy link
Member

Choose a reason for hiding this comment

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

I'd really supress these, better call enable/disable where needed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

drivers/adc/adc_nrfx_saadc.c Outdated Show resolved Hide resolved
gmarull
gmarull previously approved these changes Feb 14, 2025
Extend nrf saadc device driver with pm device runtime support.

To preserve previous behavior:

* if pm device is disabled, saadc is resumed on sampling start
  and suspended when sampling done.
* if pm device is enabled only, saadc does nothing on
  sampling start/stop. its resumed on init.
* if pm device runtime is enabled, saadc is got on
  sampling start, and put on sampling stop.

Signed-off-by: Bjarki Arge Andreasen <[email protected]>
Set pm device runtime runtime auto flag to ensure saadc instances
are initialized correctly if pm device runtime is used.

Signed-off-by: Bjarki Arge Andreasen <[email protected]>
@kartben kartben merged commit d01c93c into zephyrproject-rtos:main Feb 14, 2025
25 checks passed
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) platform: nRF Nordic nRFx
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants