Skip to content

Conversation

bjarki-andreasen
Copy link
Contributor

WIP

The ADC did not implement a PM device structure, this PM could not resume its power domains. Additionally, the ADC and COMP on the nrf54h20 both have all of their analog inputs routed to pads in different power domains than themselves, this means the device drivers for both of them need to request the pads to be resumed.

To keep the drivers simple, we can rely on HW to keep the power domain the COMP and ADC are in powered, which happens automatically when the ADC or COMP is ENABLED. We can then replace their power domains in the devicetree with the one all of their their analog inputs need, so PM ensures the pads are powered and not retained when the ADC or COMP is resumed.

…f CONFIG_PM=y

The default log process thread stack size needs to be increased to
account for the recursion into resuming power domains, which
may happen within char_out for some backends like uart.

Upstream PR #: 96695

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
The NRFX SAADC device driver needs to implement PM DEVICE for it
to work with power domains, which is required for some SoCs. Inline
PM device runtime "self get/put" pm has been implemented for the
normal sync read API.

Upstream PR #: 96711

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
…r_slow_main

The ADC and COMP on the nrf54h20 both have all of their analog
inputs routed to pads in different power domains than themselves,
this means the device drivers for both of them need to request the
pads to be resumed when active to allow any reading of the pads.

To keep the drivers simple, we can rely on HW to keep the power
domain the COMP and ADC are in powered, which happens automatically
when the ADC or COMP is ENABLED. We can then place them on the
power domain of their pads in the devicetree. This ensures the pads
are powered and not retained while the devices are RESUMED.

Upstream PR #: 96711

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
Many SoCs which use PM_DEVICE_RUNTIME need every device in the system
to have PM_DEVICE_RUNTIME enabled to function. Currently, this is only
possible by adding zephyr,pm-device-runtime-auto; to every node in
every devicetree which could potentially implement device power
management. This is very error prone since its easy to miss a node,
especially if users apply overlays, where users need to know and
remember to apply or reapply this property.

This commit adds a Kconfig, disabled by default, which automatically
treats every device as if it had the zephyr,pm-device-runtime-auto
property added to every node.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
(cherry picked from commit 34c51c5)
…NABLE for all

Enable CONFIG_PM_DEVICE_RUNTIME_DEFAULT_ENABLE by default for all
nordic SoCs if CONFIG_PM_DEVICE_RUNTIME is used. This will ensure
consistent behavior across all nordic SoCs and remove the need
for pasting the devicetree propert zephyr,pm-device-runtime-auto
everywhere.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
(cherry picked from commit 61a9d6a)
@bjarki-andreasen bjarki-andreasen force-pushed the idle-sample-fixes-nrf54h branch from 5ba628d to 131e9f7 Compare October 8, 2025 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant