Replies: 1 comment
-
I have not found any mechanism for this (though i am by no means a zephyr veteran). What we do is add |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a custom board with a power switch that controls a couple of sensors/devices. I'm looking for guidance on the best practices for integrating this power switch without modifying the main Zephyr repository's YAML and source files.
Here is the schematic for the power switches:

DTS Design: What is the recommended DTS design for incorporating the power switch? I want to avoid editing the sensor's YAML file and driver source files, as this approach could lead to extensive changes across various projects and board configurations. Additionally, it would affect the default official Zephyr release, impacting all teams and users.
Driver Implementation: How should I implement the power switch control in the sensor's driver file? Do I need to edit driver files for this support? I know that many sensor drivers use the PM_DEVICE_DT_INST_DEFINE() macro, which allows applications to manage power states by calling pm_device_action_run(device, PM_DEVICE_ACTION_SUSPEND) and pm_device_action_run(device, PM_DEVICE_ACTION_RESUME).
One idea that came into my mind is to create a general power controller source file with a higher initialization priority than any CONFIG_SENSOR_INIT_PRIORITY. This would allow the power controller to turn on the sensors before their initialization begins. However, this approach might not be optimal without directly associating the power switch with the driver instance.
Any recommendations on how to proceed with this implementation would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions