-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
power rail management in low-power devices #17830
Comments
CC @carlescufi |
@pabigot did you find a suitable method? Before finding this issue I've also looked at the I'm having a low-power device with a rather high-power sensor that needs to be powered on at a fixed interval. Edit: looking at #22941 it appears lots of stuff is missing to make this happen? |
@Snevzor #24416 (comment) has a summary related to that old plan. There was related content in the mass of work around #29644, but as of last April when I stopped working on Zephyr there was no plan to actually manage instance-specific device initialization order based on dependencies or code annotations. |
Thanks for the fast response @pabigot. I'll try with the gpio as regulator, controlled from the application and I'll need to find a way for the driver to re-init. |
Duplicated #37793 |
The following situation demonstrates an apparent functionality gap for low power devices in in-tree target. (My use case is out-of-tree.)
The Nordic Thingy:52 (nrf52_pca20020) has two GPIO-controlled power rails. The first is controlled by the SOC GPIO. On that rail is an SX1509B GPIO controller and a variety of other peripherals. The second rail, which powers the CCS811, is controlled by a pin on that SX1509B.
I started to create a
regulator-gpio
infrastructure to provide runtime control of power rails with power management support to support low power devices, where the rail is enabled only when something it powers is needed.A potential device-tree excerpt is:
In a standard devicetree infrastructure I would expect an attempt to use the ccs811 device to follow a dependency to the parent bus sx1509b, which would then follow a dependency to
vdd-rail
, power it up if necessary and register an active user, then initialize the sx1509b and power upccs-vdd-rail
, and then proceed to initialize the ccs811.I can't figure out any way to make this work in Zephyr without hard-coding dependencies in driver implementations (like SX1509B and CCS811) that are supposed to be target-independent.
This works today only because nrf52_pca20020 defines two separate init priorities that are associated with unique devices, and unconditionally powers up both rails during startup. Which makes this platform not very usable as a low power device.
efr32mg_sltb004a has similar per-device rails, though AFAICT Zephyr doesn't have infrastructure that enables any of its sensors.
It seems that all the power management work is the responsibility of the application, when it should be a simple matter of noting the dependency in the devicetree and allowing device power management to take care of things.
Am I missing something, or is there a huge gap in support for low-power devices here?
The text was updated successfully, but these errors were encountered: