diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2017-04-07 09:59:35 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-04-07 09:59:35 +0200 |
commit | 4cd023c77942f48efded3e9e47c2be823d5c8d82 (patch) | |
tree | b6790388da4c11d50cc7b22ee915fc6133b051c0 /arch/arm/mach-pxa/pxa2xx.c | |
parent | 011aec6558e93b01c64202929a6ae90a334a3742 (diff) | |
parent | e4f81050e098074792730b61563538d9e394e3d6 (diff) | |
download | barebox-4cd023c77942f48efded3e9e47c2be823d5c8d82.tar.gz barebox-4cd023c77942f48efded3e9e47c2be823d5c8d82.tar.xz |
Merge branch 'for-next/misc'
Diffstat (limited to 'arch/arm/mach-pxa/pxa2xx.c')
-rw-r--r-- | arch/arm/mach-pxa/pxa2xx.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/arch/arm/mach-pxa/pxa2xx.c b/arch/arm/mach-pxa/pxa2xx.c index b712b388c8..e28378e6db 100644 --- a/arch/arm/mach-pxa/pxa2xx.c +++ b/arch/arm/mach-pxa/pxa2xx.c @@ -14,6 +14,7 @@ #include <common.h> #include <init.h> +#include <poweroff.h> #include <reset_source.h> #include <mach/hardware.h> #include <mach/pxa-regs.h> @@ -46,9 +47,7 @@ void pxa_clear_reset_source(void) RCSR = RCSR_GPR | RCSR_SMR | RCSR_WDR | RCSR_HWR; } -device_initcall(pxa_detect_reset_source); - -void __noreturn poweroff(void) +static void __noreturn pxa2xx_poweroff(struct poweroff_handler *handler) { shutdown_barebox(); @@ -57,3 +56,13 @@ void __noreturn poweroff(void) pxa_suspend(PWRMODE_DEEPSLEEP); unreachable(); } + +static int pxa2xx_init(void) +{ + poweroff_handler_register_fn(pxa2xx_poweroff); + + pxa_detect_reset_source(); + + return 0; +} +device_initcall(pxa2xx_init); |