diff options
author | Daniel Lezcano <daniel.lezcano@linaro.org> | 2013-09-22 16:29:57 -0400 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2013-10-16 17:46:13 -0400 |
commit | 5ad945ea58f6cab7490dc149974ccb6514cc569a (patch) | |
tree | 806f516647e1e0676eb9b63e35e4e35e8fc93cde /arch/arm/mach-at91/at91sam9263.c | |
parent | ac9f1cc2ce1a178696763444f2a2f8a0ec661772 (diff) |
ARM: at91: cpuidle: Convert to platform driver
Using the platform driver model is a good way to separate the cpuidle specific
code from the low level pm code. It allows to remove the dependency between
these two components.
The platform_device is located in the pm code and a 'set' function has been
added to set the standby function from the AT91_SOC_START initialization
function. Each SoC with a cpuidle driver will set the standby function in the
platform_data field at init time. Then pm code will register the cpuidle
platform device.
The cpuidle driver will register the platform_driver and use the device's
platform_data as a standby callback in the idle path.
The at91_pm_enter function contains a { if then else } based on cpu_is_xx
similar to what was in cpuidle. This is considered dangerous when adding a new
SoC. Like the cpuidle driver, a standby ops is defined and assigned when the
SoC init function specifies what is its standby function and reused in the
at91_pm_enter's 'case' block.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Diffstat (limited to 'arch/arm/mach-at91/at91sam9263.c')
-rw-r--r-- | arch/arm/mach-at91/at91sam9263.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c index 6ce7d1850893..8c81c890618c 100644 --- a/arch/arm/mach-at91/at91sam9263.c +++ b/arch/arm/mach-at91/at91sam9263.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include "generic.h" | 26 | #include "generic.h" |
27 | #include "clock.h" | 27 | #include "clock.h" |
28 | #include "sam9_smc.h" | 28 | #include "sam9_smc.h" |
29 | #include "pm.h" | ||
29 | 30 | ||
30 | /* -------------------------------------------------------------------- | 31 | /* -------------------------------------------------------------------- |
31 | * Clocks | 32 | * Clocks |
@@ -330,6 +331,8 @@ static void __init at91sam9263_initialize(void) | |||
330 | 331 | ||
331 | /* Register GPIO subsystem */ | 332 | /* Register GPIO subsystem */ |
332 | at91_gpio_init(at91sam9263_gpio, 5); | 333 | at91_gpio_init(at91sam9263_gpio, 5); |
334 | |||
335 | at91_pm_set_standby(at91sam9263_standby); | ||
333 | } | 336 | } |
334 | 337 | ||
335 | /* -------------------------------------------------------------------- | 338 | /* -------------------------------------------------------------------- |