ARM: at91: factorise duplicated at91sam9 idle
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Sun, 5 Feb 2012 12:25:32 +0000 (20:25 +0800)
committerNicolas Ferre <nicolas.ferre@atmel.com>
Fri, 17 Feb 2012 16:54:05 +0000 (17:54 +0100)
Remove duplicated at91sam9xxxx_idle() functions introduced
by commit c9dfafb "ARM: mach-at91: move special idle code out of line".
Replace by a generic at91sam9_idle() function in setup.c common
location.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
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/clock.c
arch/arm/mach-at91/generic.h

index 9ac8c6fe3363b6af723c8366108d6d863bcb9415..e9653328092da2eb0a9279b6c0b72b9a87802c0a 100644 (file)
@@ -329,15 +329,9 @@ static void __init at91sam9260_ioremap_registers(void)
        at91sam9_ioremap_smc(0, AT91SAM9260_BASE_SMC);
 }
 
-static void at91sam9260_idle(void)
-{
-       at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
-       cpu_do_idle();
-}
-
 static void __init at91sam9260_initialize(void)
 {
-       arm_pm_idle = at91sam9260_idle;
+       arm_pm_idle = at91sam9_idle;
        arm_pm_restart = at91sam9_alt_restart;
        at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1)
                        | (1 << AT91SAM9260_ID_IRQ2);
index ab76868f01f5ee8e48b80359d3064e531ae3c86d..d7f51d6f957ded370847535d2ae3b20cf26295c5 100644 (file)
@@ -287,15 +287,9 @@ static void __init at91sam9261_ioremap_registers(void)
        at91sam9_ioremap_smc(0, AT91SAM9261_BASE_SMC);
 }
 
-static void at91sam9261_idle(void)
-{
-       at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
-       cpu_do_idle();
-}
-
 static void __init at91sam9261_initialize(void)
 {
-       arm_pm_idle = at91sam9261_idle;
+       arm_pm_idle = at91sam9_idle;
        arm_pm_restart = at91sam9_alt_restart;
        at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1)
                        | (1 << AT91SAM9261_ID_IRQ2);
index 247ab633abccc72918d0e23be60c7e937deb5b61..8bdba2a04b16d68066b487ee10ba52efce56cf8e 100644 (file)
@@ -308,15 +308,9 @@ static void __init at91sam9263_ioremap_registers(void)
        at91sam9_ioremap_smc(1, AT91SAM9263_BASE_SMC1);
 }
 
-static void at91sam9263_idle(void)
-{
-       at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
-       cpu_do_idle();
-}
-
 static void __init at91sam9263_initialize(void)
 {
-       arm_pm_idle = at91sam9263_idle;
+       arm_pm_idle = at91sam9_idle;
        arm_pm_restart = at91sam9_alt_restart;
        at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1);
 
index 5b12192e52ecc59e8fde425146f8811469149179..5d2ff90ca85fc7e5c9abbecb2300a1e6d03ad928 100644 (file)
@@ -317,12 +317,6 @@ static struct at91_gpio_bank at91sam9g45_gpio[] __initdata = {
        }
 };
 
-static void at91sam9g45_idle(void)
-{
-       at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
-       cpu_do_idle();
-}
-
 /* --------------------------------------------------------------------
  *  AT91SAM9G45 processor initialization
  * -------------------------------------------------------------------- */
@@ -343,7 +337,7 @@ static void __init at91sam9g45_ioremap_registers(void)
 
 static void __init at91sam9g45_initialize(void)
 {
-       arm_pm_idle = at91sam9g45_idle;
+       arm_pm_idle = at91sam9_idle;
        arm_pm_restart = at91sam9g45_restart;
        at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0);
 
index fd60e226a987d1533504327dfe22e17a6a08b9d2..e86c50b19d660e244b11c52506ab97ce6658e089 100644 (file)
@@ -292,15 +292,9 @@ static void __init at91sam9rl_ioremap_registers(void)
        at91sam9_ioremap_smc(0, AT91SAM9RL_BASE_SMC);
 }
 
-static void at91sam9rl_idle(void)
-{
-       at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
-       cpu_do_idle();
-}
-
 static void __init at91sam9rl_initialize(void)
 {
-       arm_pm_idle = at91sam9rl_idle;
+       arm_pm_idle = at91sam9_idle;
        arm_pm_restart = at91sam9_alt_restart;
        at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0);
 
index a5291e0e7004aa4431486a77a0d935a53a4ece8f..d1b4e0707e4dcc8c8caba13000968093b2b28d05 100644 (file)
@@ -28,6 +28,8 @@
 #include <mach/at91_pmc.h>
 #include <mach/cpu.h>
 
+#include <asm/proc-fns.h>
+
 #include "clock.h"
 #include "generic.h"
 
@@ -818,3 +820,9 @@ static int __init at91_clock_reset(void)
        return 0;
 }
 late_initcall(at91_clock_reset);
+
+void at91sam9_idle(void)
+{
+       at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
+       cpu_do_idle();
+}
index 7e8280e798c11620e7cb2eac404d37c8c506a1e7..4e322f3492bff82582f27a8a367fd54d3fb7d7d0 100644 (file)
@@ -56,6 +56,9 @@ struct device;
 extern void at91_irq_suspend(void);
 extern void at91_irq_resume(void);
 
+/* idle */
+extern void at91sam9_idle(void);
+
 /* reset */
 extern void at91_ioremap_rstc(u32 base_addr);
 extern void at91sam9_alt_restart(char, const char *);