Specifying intricate driver dependency ordering for regulators and components #70907
Replies: 1 comment
-
@asteriskSF I have the exact same problem, but with an i2c bus between the MCU and the I/O expander, while another i2c bus should be turned off using the regulator. In fact, it would be nice if you could specify an init priority in the device tree, not inside C code or KConfig (which is unified if you use two of the same devices) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a system I'm working on that requires a complicated device init ordering. This project is using zephyr 3.4 from Nordics NCS 2.5.2.
The system has 2 voltage regulators each with an enable. One regulator has the enable tied to a native (on-chip) gpio. This provides one voltage rail (3V3). this voltage rail must be enabled to provide power for an I/O expander, which has an output for the second voltage regulator.
So the init sequence must be:
enable regulator_3V3 via gpio0
init io_expander
configure regulator output on io_expander
enable regulator_5V via io_expander
init peripherals downstream from regulator_5V (via level shifter)
The problem I see is that voltage regulators all get assigned the same init priority, so I don't see how I would be able to init one regulator before the io_expander and the other regulator after the io_expander.
Is there a way to do this?
Best approach I have come up with is to duplicate the regulator_fixed driver into a second driver that I could then assign a different init priority.
Also I saw some discussion from 2020 about making the driver init order based on dependencies, does that work? Even if it does, how would I indicate the dependency between the regulator and the devices it powers?
Beta Was this translation helpful? Give feedback.
All reactions