-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
dts: bindings: Add st,reinit-power-states
DT property
#60369
Conversation
2cc3766
to
64a9dfe
Compare
@gmarull I've made this binding ST-specific. However the helper macros are still in |
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.
LGTM aside from the file used for headers.
Add STM32-specific st,reinit-power-states property. This property allows defining one or more special power-states phandles in which a peripheral loses its configuration, and must be reinitialized. States below and including S2RAM are inherently assumed to require reinit, this property is intended to cover the exceptions outside of this common use case. It is intended to assist drivers in preventing the SoC from entering these power states during critical code sections, as well as indicate to power management services when a peripheral needs reinitialization. Signed-off-by: Kenneth J. Miller <ken@miller.ec>
Add common STM32 power-management bindings to peripherals that require the st,reinit-power-states property. Signed-off-by: Kenneth J. Miller <ken@miller.ec>
22bda52
to
2b88360
Compare
Add helper macros for building a pm_state_info array from a device's st,reinit-power-states. These macros are intended to assist drivers in and around device reinitializiation. Signed-off-by: Kenneth J. Miller <ken@miller.ec>
2b88360
to
3d79170
Compare
|
#define Z_PM_STATE_INFO_FROM_DT_REINIT(i, node_id) \ | ||
COND_CODE_1( \ | ||
DT_NODE_HAS_STATUS(DT_PHANDLE_BY_IDX(node_id, st_reinit_power_states, i), okay), \ | ||
(PM_STATE_INFO_DT_INIT(DT_PHANDLE_BY_IDX(node_id, st_reinit_power_states, i)),), \ | ||
()) |
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 know this isn't exactly your current concern, but as we discussed, for 90-ish % of cases, reinit-power-state will be standby.
I wonder where we'll be able to get it taken into account:
I don't think this should be added in each peripheral driver since we'll just be duplicating information
Should/Could it be done directly in current macro ?
Why can't you use in this case PM_DEVICE_RUNTIME? |
@tmleman |
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. |
Summary
This PR adds the
st,reinit-power-states
DT binding property.Said property is intended to describe exceptional System PM (sub)states, after which the defining peripheral instance requires reinitialization logic to regain normal operation.
Note: all states below and including S2RAM are expected to require driver action to restore operation, and these are not the target of this PR, but rather exceptions to the rule such as the S2idle state STOP2 on STM32WL.
A helper macro for building a
pm_state_info
struct array of these power-states, for various handling of critical driver sections is also included.Related