diff options
author | Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com> | 2010-05-10 18:08:53 +0200 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2010-09-02 22:44:36 -0600 |
commit | 3ea2f3a7cd8e2d470bdaba599efb57968d7114a6 (patch) | |
tree | c84adc3431887fb0b515ec5265e86905c3cef0f5 /arch/arm/mach-ux500/pm.c | |
parent | 747e3fcf01bb45034fe21512fe244d175559b493 (diff) |
ux500: move mach-u8500 to mach-ux500
Diffstat (limited to 'arch/arm/mach-ux500/pm.c')
-rwxr-xr-x | arch/arm/mach-ux500/pm.c | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/pm.c b/arch/arm/mach-ux500/pm.c new file mode 100755 index 00000000000..f753ef11eea --- /dev/null +++ b/arch/arm/mach-ux500/pm.c @@ -0,0 +1,78 @@ +/* + * Copyright 2009 STMicroelectronics. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation. + */ + +/* U8500 platform suspend/resume support */ + +#include <linux/init.h> +#include <linux/module.h> +#include <linux/suspend.h> +#include <linux/errno.h> +#include <linux/time.h> + +#include <asm/memory.h> +#include <asm/system.h> + +#include <mach/prcmu-fw-api.h> + +static int u8500_pm_begin(suspend_state_t state) +{ + return 0; +} + +static int u8500_pm_prepare(void) +{ + return 0; +} + +static int u8500_pm_enter(suspend_state_t state) +{ + int ret; + + switch (state) { + case PM_SUSPEND_STANDBY: + prcmu_apply_ap_state_transition(APEXECUTE_TO_APIDLE, + DDR_PWR_STATE_UNCHANGED, 0); + ret = 0; + break; + case PM_SUSPEND_MEM: + prcmu_apply_ap_state_transition(APEXECUTE_TO_APSLEEP, + DDR_PWR_STATE_UNCHANGED, 0); + ret = 0; + break; + default: + ret = -EINVAL; + } + + return ret; +} + +static void u8500_pm_finish(void) +{ + +} + +static int u8500_pm_valid(suspend_state_t state) +{ + return (state == PM_SUSPEND_MEM || state == PM_SUSPEND_STANDBY); +} + +static struct platform_suspend_ops u8500_pm_ops = { + .begin = u8500_pm_begin, + .prepare = u8500_pm_prepare, + .enter = u8500_pm_enter, + .finish = u8500_pm_finish, + .valid = u8500_pm_valid, +}; + +static int __init u8500_pm_init(void) +{ + suspend_set_ops(&u8500_pm_ops); + return 0; +} + +device_initcall(u8500_pm_init); |