Commit 778f173e authored by Lina Iyer's avatar Lina Iyer Committed by Ulf Hansson

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: default avatarSudeep Holla <sudeep.holla@arm.com>
Signed-off-by: default avatarLina Iyer <lina.iyer@linaro.org>
Reviewed-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Co-developed-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Reviewed-by: default avatarSudeep Holla <sudeep.holla@arm.com>
Acked-by: default avatarRafael J. Wysocki <rafael@kernel.org>
parent b9f8c26a
...@@ -111,8 +111,7 @@ static bool idle_state_valid(struct device_node *state_node, unsigned int idx, ...@@ -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, ...@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment