aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-at91/at91sam9261.c
diff options
context:
space:
mode:
authorAndrew Victor <linux@maxim.org.za>2008-04-02 21:36:06 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-04-04 09:52:19 +0100
commit3ef2fb426775fc2ae19b70c318dbdf4a0aeeced7 (patch)
treeedf90c662cfd9c4e9106eaef6a71a042200b8f78 /arch/arm/mach-at91/at91sam9261.c
parentb78eabde89f9b19d463a77abe420508c0ef29249 (diff)
[ARM] 4903/1: [AT91] SAM9/CAP9 system shutdown
Enable system shutdown/power-off on AT91SAM9 and AT91CAP9 based boards. This does not require power-management to be enabled, and the pm_power_off method can be overridden in board-specific files if necessary. Signed-off-by: Andrew Victor <linux@maxim.org.za> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-at91/at91sam9261.c')
-rw-r--r--arch/arm/mach-at91/at91sam9261.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 90b87e1877d..35bf6fd5251 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -11,12 +11,14 @@
*/
#include <linux/module.h>
+#include <linux/pm.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/arch/at91sam9261.h>
#include <asm/arch/at91_pmc.h>
#include <asm/arch/at91_rstc.h>
+#include <asm/arch/at91_shdwc.h>
#include "generic.h"
#include "clock.h"
@@ -245,6 +247,11 @@ static void at91sam9261_reset(void)
at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
}
+static void at91sam9261_poweroff(void)
+{
+ at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW);
+}
+
/* --------------------------------------------------------------------
* AT91SAM9261 processor initialization
@@ -256,6 +263,7 @@ void __init at91sam9261_initialize(unsigned long main_clock)
iotable_init(at91sam9261_io_desc, ARRAY_SIZE(at91sam9261_io_desc));
at91_arch_reset = at91sam9261_reset;
+ pm_power_off = at91sam9261_poweroff;
at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1)
| (1 << AT91SAM9261_ID_IRQ2);