drivers: cpuidle: implement DT based idle states infrastructure
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Fri, 14 Feb 2014 14:28:39 +0000 (14:28 +0000)
committerMark Brown <broonie@kernel.org>
Sun, 18 Jan 2015 12:39:53 +0000 (12:39 +0000)
commit89f6097555808374113d23e39b00c0d3c3d144c1
tree7c0a32a856583a8d653fe008c8da5b29deb0bb1d
parentef6595e9651c6c68265c9bad665df1ba397deceb
drivers: cpuidle: implement DT based idle states infrastructure

On most common ARM systems, the low-power states a CPU can be put into are
not discoverable in HW and require device tree bindings to describe
power down suspend operations and idle states parameters.

In order to enable DT based idle states and configure idle drivers, this
patch implements the bulk infrastructure required to parse the device tree
idle states bindings and initialize the corresponding CPUidle driver states
data.

The parsing API accepts a start index that defines the first idle state
that should be initialized by the parsing code in order to give new and
legacy driver flexibility over which states should be parsed using the
new DT mechanism.

The idle states node(s) is obtained from the phandle list of the first cpu
in the driver cpumask;  the kernel checks that the idle state node phandle
is the same for all CPUs in the driver cpumask before declaring the idle state
as valid and start parsing its content.

The idle state enter function pointer is initialized through DT match
structures passed in by the CPUidle driver, so that ARM legacy code can
cope with platform specific idle entry method based on compatible
string matching and the code used to initialize the enter function pointer
can be moved to the DT generic layer.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
(cherry picked from commit 9f14da345599c14b329cf5ac9499ad322056dd32)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
drivers/cpuidle/Kconfig
drivers/cpuidle/Kconfig
drivers/cpuidle/Makefile
drivers/cpuidle/dt_idle_states.c [new file with mode: 0644]
drivers/cpuidle/dt_idle_states.h [new file with mode: 0644]