diff options
Diffstat (limited to 'arch')
-rwxr-xr-x | arch/arm/mach-ux500/pm.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/pm.c b/arch/arm/mach-ux500/pm.c index 509c2c59c02..96f040a8eda 100755 --- a/arch/arm/mach-ux500/pm.c +++ b/arch/arm/mach-ux500/pm.c @@ -32,6 +32,29 @@ static int u8500_pm_prepare(void) return 0; } +/* poweroff support */ +#include <linux/signal.h> +#include <mach/ab8500.h> +/* + * This function is used from pm.h to shut down the u8500 system by + * turning off the ab8500 + */ +void u8500_pm_poweroff(void) +{ + sigset_t old, all; + int val; + + sigfillset(&all); + if (!sigprocmask(SIG_BLOCK, &all, &old)) { + val = ab8500_read(AB8500_SYS_CTRL1_BLOCK, AB8500_CTRL1_REG); + val |= 0x1; + ab8500_write(AB8500_SYS_CTRL1_BLOCK, AB8500_CTRL1_REG, val); + (void) sigprocmask(SIG_SETMASK, &old, NULL); + } + return; +} + + /* GPIO context */ static struct ux500_gpio_regs gpio_context[UX500_NR_GPIO_BANKS]; @@ -827,6 +850,9 @@ static int __init u8500_pm_init(void) return -ENOMEM; } + /* register the global power off hook */ + pm_power_off = u8500_pm_poweroff; + suspend_set_ops(&u8500_pm_ops); return 0; |