-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Add turn on and off actions for device drivers #65258
Add turn on and off actions for device drivers #65258
Conversation
@ceolin can you help review this power domain driver. I have tried to keep it generic incase other SoC's might wish to use it. |
DEVICE_DT_INST_DEFINE(id, NULL, PM_DEVICE_DT_INST_GET(id), \ | ||
NULL, &pd_deviceonoff_##id##_cfg, PRE_KERNEL_1, \ | ||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, NULL); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mmahadevan108 I think this domain is re-implementing a lot of things from this pr #60939
This logic to check which power state should trigger device pm should be done in the system pm layer imho.
Wondering now if we should have add a way to the system pm triggers POWER_ON / POWER_OFF depending on the sleep state the soc goes (instead of just suspend / resume).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem with the drivers adding PM support but the domain I think is addressing things that should be done at the subsys level.
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
return -ENOTSUP; | ||
} | ||
|
||
return ret; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will work as you expect since the pm subsystem will try to suspend devices before the domain (if they are hierarchically correct), then when the pm action is called for this domain, all devices under it will already be suspended.
Another case this can cause issue is if one enable device runtime pm for this device. In this case, if one does pm_device_runtime_put(domain_device_on_off);
while the system is active, pm_state_next_get(0)->state;
will return PM_STATE_ACTIVE
and it will much likely not suspend devices.
Please take a look in
#70623 I have tried to address this problem where only specifics power states should trigger device pm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add power action callback handlers to the driver. Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
Add PM action for MCUX LPC driver Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
Add PM action for MCUX LPC driver From list zephyrproject-rtos/zephyr#65258 Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
Add power action callback handlers to the driver. From list zephyrproject-rtos/zephyr#65258 Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
Add PM action for MCUX LPC driver From list zephyrproject-rtos/zephyr#65258 Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
Add power action callback handlers to the driver. From list zephyrproject-rtos/zephyr#65258 Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
Add PM action for MCUX LPC driver From list zephyrproject-rtos/zephyr#65258 Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
Add power action callback handlers to the driver. From list zephyrproject-rtos/zephyr#65258 Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
This power domain driver reads the power states from device tree which would determine when to turn on/ off device drivers.Add the PM_DEVICE actions for TURN_ON and TURN_OFF