Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
of: base: Add of_get_cpu_state_node() to get idle states for a CPU node
The CPU's idle state nodes are currently parsed at the common cpuidle DT library, but also when initializing data for specific CPU idle operations, as in the PSCI cpuidle driver case and qcom-spm cpuidle case. To avoid open-coding, let's introduce of_get_cpu_state_node(), which takes the device node for the CPU and the index to the requested idle state node, as in-parameters. In case a corresponding idle state node is found, it returns the node with the refcount incremented for it, else it returns NULL. Moreover, for PSCI there are two options to describe the CPU's idle states [1], either via a flattened description or a hierarchical layout. Hence, let's take both options into account. [1] Documentation/devicetree/bindings/arm/psci.yaml Suggested-by: Sudeep Holla <[email protected]> Co-developed-by: Lina Iyer <[email protected]> Signed-off-by: Lina Iyer <[email protected]> Reviewed-by: Rob Herring <[email protected]> Reviewed-by: Daniel Lezcano <[email protected]> Signed-off-by: Ulf Hansson <[email protected]> Reviewed-by: Sudeep Holla <[email protected]>
- Loading branch information