Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d786067b authored by Ulf Hansson's avatar Ulf Hansson Committed by Greg Kroah-Hartman
Browse files

of: base: Add of_get_cpu_state_node() to get idle states for a CPU node



[ Upstream commit b9f8c26afc405a4a616e765e949bdd551151e41d ]

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: default avatarSudeep Holla <sudeep.holla@arm.com>
Co-developed-by: default avatarLina Iyer <lina.iyer@linaro.org>
Signed-off-by: default avatarLina Iyer <lina.iyer@linaro.org>
Reviewed-by: default avatarRob Herring <robh@kernel.org>
Reviewed-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Reviewed-by: default avatarSudeep Holla <sudeep.holla@arm.com>
Stable-dep-of: d79972789d17 ("of: dynamic: Fix of_reconfig_get_state_change() return value documentation")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 13f27a05
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment