ARM: at91: cpuidle: Convert to platform driver
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Sun, 22 Sep 2013 20:29:57 +0000 (22:29 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Wed, 16 Oct 2013 21:46:13 +0000 (23:46 +0200)
commit5ad945ea58f6cab7490dc149974ccb6514cc569a
tree806f516647e1e0676eb9b63e35e4e35e8fc93cde
parentac9f1cc2ce1a178696763444f2a2f8a0ec661772
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>
arch/arm/mach-at91/at91rm9200.c
arch/arm/mach-at91/at91sam9260.c
arch/arm/mach-at91/at91sam9261.c
arch/arm/mach-at91/at91sam9263.c
arch/arm/mach-at91/at91sam9g45.c
arch/arm/mach-at91/at91sam9rl.c
arch/arm/mach-at91/cpuidle.c
arch/arm/mach-at91/pm.c
arch/arm/mach-at91/pm.h