cpuidle: dt: Support hierarchical CPU idle states

Currently CPU's idle states are represented using the flattened model.
Let's add support for the hierarchical layout, via converting to use
of_get_cpu_state_node().

Suggested-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Lina Iyer <lina.iyer@linaro.org>
Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Co-developed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
This commit is contained in:
Lina Iyer 2019-10-10 12:01:48 +02:00 committed by Ulf Hansson
parent b9f8c26afc
commit 778f173eb4

View File

@ -111,8 +111,7 @@ static bool idle_state_valid(struct device_node *state_node, unsigned int idx,
for (cpu = cpumask_next(cpumask_first(cpumask), cpumask); for (cpu = cpumask_next(cpumask_first(cpumask), cpumask);
cpu < nr_cpu_ids; cpu = cpumask_next(cpu, cpumask)) { cpu < nr_cpu_ids; cpu = cpumask_next(cpu, cpumask)) {
cpu_node = of_cpu_device_node_get(cpu); cpu_node = of_cpu_device_node_get(cpu);
curr_state_node = of_parse_phandle(cpu_node, "cpu-idle-states", curr_state_node = of_get_cpu_state_node(cpu_node, idx);
idx);
if (state_node != curr_state_node) if (state_node != curr_state_node)
valid = false; valid = false;
@ -170,7 +169,7 @@ int dt_init_idle_driver(struct cpuidle_driver *drv,
cpu_node = of_cpu_device_node_get(cpumask_first(cpumask)); cpu_node = of_cpu_device_node_get(cpumask_first(cpumask));
for (i = 0; ; i++) { for (i = 0; ; i++) {
state_node = of_parse_phandle(cpu_node, "cpu-idle-states", i); state_node = of_get_cpu_state_node(cpu_node, i);
if (!state_node) if (!state_node)
break; break;