summaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle/cpuidle-big_little.c
diff options
context:
space:
mode:
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2014-06-24 16:20:28 +0100
committerDaniel Lezcano <daniel.lezcano@linaro.org>2014-09-25 10:52:21 +0200
commitd2e5c871ed8a250f7ee1fe34dd52ed5757363fba (patch)
tree538319f8d1a3134ac131d90ba5664d621121959b /drivers/cpuidle/cpuidle-big_little.c
parent3299b63de384159579143d4abdfb94013e0b5470 (diff)
downloadlinux-d2e5c871ed8a250f7ee1fe34dd52ed5757363fba.tar.gz
linux-d2e5c871ed8a250f7ee1fe34dd52ed5757363fba.tar.bz2
linux-d2e5c871ed8a250f7ee1fe34dd52ed5757363fba.zip
drivers: cpuidle: initialize big.LITTLE driver through DT
With the introduction of DT based idle states, CPUidle drivers for ARM can now initialize idle states data through properties in the device tree. This patch adds code to the big.LITTLE CPUidle driver to dynamically initialize idle states data through the updated device tree source file. Cc: Chander Kashyap <k.chander@samsung.com> 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>
Diffstat (limited to 'drivers/cpuidle/cpuidle-big_little.c')
-rw-r--r--drivers/cpuidle/cpuidle-big_little.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/cpuidle/cpuidle-big_little.c b/drivers/cpuidle/cpuidle-big_little.c
index 9342a94f417f..fbc00a1d3c48 100644
--- a/drivers/cpuidle/cpuidle-big_little.c
+++ b/drivers/cpuidle/cpuidle-big_little.c
@@ -24,6 +24,8 @@
#include <asm/smp_plat.h>
#include <asm/suspend.h>
+#include "dt_idle_states.h"
+
static int bl_enter_powerdown(struct cpuidle_device *dev,
struct cpuidle_driver *drv, int idx);
@@ -73,6 +75,12 @@ static struct cpuidle_driver bl_idle_little_driver = {
.state_count = 2,
};
+static const struct of_device_id bl_idle_state_match[] __initconst = {
+ { .compatible = "arm,idle-state",
+ .data = bl_enter_powerdown },
+ { },
+};
+
static struct cpuidle_driver bl_idle_big_driver = {
.name = "big_idle",
.owner = THIS_MODULE,
@@ -191,6 +199,17 @@ static int __init bl_idle_init(void)
if (ret)
goto out_uninit_little;
+ /* Start at index 1, index 0 standard WFI */
+ ret = dt_init_idle_driver(&bl_idle_big_driver, bl_idle_state_match, 1);
+ if (ret < 0)
+ goto out_uninit_big;
+
+ /* Start at index 1, index 0 standard WFI */
+ ret = dt_init_idle_driver(&bl_idle_little_driver,
+ bl_idle_state_match, 1);
+ if (ret < 0)
+ goto out_uninit_big;
+
ret = cpuidle_register(&bl_idle_little_driver, NULL);
if (ret)
goto out_uninit_big;