]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-at91/at91cap9.c
[ARM] 5258/1: [AT91] PWM controller initialization
[linux-2.6-omap-h63xx.git] / arch / arm / mach-at91 / at91cap9.c
index 48d27d8000b0e8da5f696ad902c36c19fe7b6f6f..0fc0adaebd583ed0718366f354fb970078d35c2d 100644 (file)
  */
 
 #include <linux/module.h>
+#include <linux/pm.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
-#include <asm/arch/at91cap9.h>
-#include <asm/arch/at91_pmc.h>
-#include <asm/arch/at91_rstc.h>
+#include <mach/at91cap9.h>
+#include <mach/at91_pmc.h>
+#include <mach/at91_rstc.h>
+#include <mach/at91_shdwc.h>
 
 #include "generic.h"
 #include "clock.h"
@@ -139,8 +141,8 @@ static struct clk tcb_clk = {
        .pmc_mask       = 1 << AT91CAP9_ID_TCB,
        .type           = CLK_TYPE_PERIPHERAL,
 };
-static struct clk pwmc_clk = {
-       .name           = "pwmc_clk",
+static struct clk pwm_clk = {
+       .name           = "pwm_clk",
        .pmc_mask       = 1 << AT91CAP9_ID_PWMC,
        .type           = CLK_TYPE_PERIPHERAL,
 };
@@ -205,7 +207,7 @@ static struct clk *periph_clocks[] __initdata = {
        &ssc1_clk,
        &ac97_clk,
        &tcb_clk,
-       &pwmc_clk,
+       &pwm_clk,
        &macb_clk,
        &aestdes_clk,
        &adc_clk,
@@ -288,6 +290,12 @@ static void at91cap9_reset(void)
        at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
 }
 
+static void at91cap9_poweroff(void)
+{
+       at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW);
+}
+
+
 /* --------------------------------------------------------------------
  *  AT91CAP9 processor initialization
  * -------------------------------------------------------------------- */
@@ -298,6 +306,7 @@ void __init at91cap9_initialize(unsigned long main_clock)
        iotable_init(at91cap9_io_desc, ARRAY_SIZE(at91cap9_io_desc));
 
        at91_arch_reset = at91cap9_reset;
+       pm_power_off = at91cap9_poweroff;
        at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1);
 
        /* Init clock subsystem */