]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-at91/at91sam9rl.c
[ARM] 5258/1: [AT91] PWM controller initialization
[linux-2.6-omap-h63xx.git] / arch / arm / mach-at91 / at91sam9rl.c
index 4813a35f6cf54c63fdd517c5a3adcbc7c49726d7..252e954b49fda7d1325a9eaffb697c9bf2c181bf 100644 (file)
  */
 
 #include <linux/module.h>
+#include <linux/pm.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
-#include <asm/arch/cpu.h>
-#include <asm/arch/at91sam9rl.h>
-#include <asm/arch/at91_pmc.h>
-#include <asm/arch/at91_rstc.h>
+#include <mach/cpu.h>
+#include <mach/at91sam9rl.h>
+#include <mach/at91_pmc.h>
+#include <mach/at91_rstc.h>
+#include <mach/at91_shdwc.h>
 
 #include "generic.h"
 #include "clock.h"
@@ -129,8 +131,8 @@ static struct clk tc2_clk = {
        .pmc_mask       = 1 << AT91SAM9RL_ID_TC2,
        .type           = CLK_TYPE_PERIPHERAL,
 };
-static struct clk pwmc_clk = {
-       .name           = "pwmc_clk",
+static struct clk pwm_clk = {
+       .name           = "pwm_clk",
        .pmc_mask       = 1 << AT91SAM9RL_ID_PWMC,
        .type           = CLK_TYPE_PERIPHERAL,
 };
@@ -178,7 +180,7 @@ static struct clk *periph_clocks[] __initdata = {
        &tc0_clk,
        &tc1_clk,
        &tc2_clk,
-       &pwmc_clk,
+       &pwm_clk,
        &tsc_clk,
        &dma_clk,
        &udphs_clk,
@@ -244,6 +246,11 @@ static void at91sam9rl_reset(void)
        at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
 }
 
+static void at91sam9rl_poweroff(void)
+{
+       at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW);
+}
+
 
 /* --------------------------------------------------------------------
  *  AT91SAM9RL processor initialization
@@ -274,6 +281,7 @@ void __init at91sam9rl_initialize(unsigned long main_clock)
        iotable_init(at91sam9rl_sram_desc, ARRAY_SIZE(at91sam9rl_sram_desc));
 
        at91_arch_reset = at91sam9rl_reset;
+       pm_power_off = at91sam9rl_poweroff;
        at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0);
 
        /* Init clock subsystem */