diff options
author | Marcin Juszkiewicz <hrw@openembedded.org> | 2007-07-03 19:47:37 +0000 |
---|---|---|
committer | Marcin Juszkiewicz <hrw@openembedded.org> | 2007-07-03 19:47:37 +0000 |
commit | 2a5fdf6434cc0bee885bf52bdf5f600e33421e39 (patch) | |
tree | 5ed894dec4eefdad467eea13fed283ae5a5b43cd /packages/linux/linux-rp-2.6.21/sharpsl_pm-r1.patch | |
parent | 25550bf2091bb90cbde005e19b8e0dd049d239c8 (diff) |
linux-rp 2.6.21: adapted collie patches to apply - close #2592
Diffstat (limited to 'packages/linux/linux-rp-2.6.21/sharpsl_pm-r1.patch')
-rw-r--r-- | packages/linux/linux-rp-2.6.21/sharpsl_pm-r1.patch | 213 |
1 files changed, 213 insertions, 0 deletions
diff --git a/packages/linux/linux-rp-2.6.21/sharpsl_pm-r1.patch b/packages/linux/linux-rp-2.6.21/sharpsl_pm-r1.patch new file mode 100644 index 0000000000..9e7632fe0a --- /dev/null +++ b/packages/linux/linux-rp-2.6.21/sharpsl_pm-r1.patch @@ -0,0 +1,213 @@ +Index: linux-2.6.21/arch/arm/common/sharpsl_pm.c +=================================================================== +--- linux-2.6.21.orig/arch/arm/common/sharpsl_pm.c 2007-07-03 21:42:09.000000000 +0200 ++++ linux-2.6.21/arch/arm/common/sharpsl_pm.c 2007-07-03 21:42:57.000000000 +0200 +@@ -28,10 +28,8 @@ + #include <asm/hardware.h> + #include <asm/mach-types.h> + #include <asm/irq.h> +-#include <asm/arch/pm.h> +-#include <asm/arch/pxa-regs.h> +-#include <asm/arch/sharpsl.h> + #include <asm/hardware/sharpsl_pm.h> ++#include "sharpsl_pm.h" + + /* + * Constants +@@ -153,7 +151,7 @@ + sharpsl_pm.battstat.mainbat_percent = percent; + } + +- dev_dbg(sharpsl_pm.dev, "Battery: voltage: %d, status: %d, percentage: %d, time: %d\n", voltage, ++ dev_dbg(sharpsl_pm.dev, "Battery: voltage: %d, status: %d, percentage: %d, time: %ld\n", voltage, + sharpsl_pm.battstat.mainbat_status, sharpsl_pm.battstat.mainbat_percent, jiffies); + + /* If battery is low. limit backlight intensity to save power. */ +@@ -504,7 +502,7 @@ + + static void corgi_goto_sleep(unsigned long alarm_time, unsigned int alarm_enable, suspend_state_t state) + { +- dev_dbg(sharpsl_pm.dev, "Time is: %08x\n",RCNR); ++ dev_dbg(sharpsl_pm.dev, "Time is: %08lx\n",RCNR); + + dev_dbg(sharpsl_pm.dev, "Offline Charge Activate = %d\n",sharpsl_pm.flags & SHARPSL_DO_OFFLINE_CHRG); + /* not charging and AC-IN! */ +@@ -518,28 +516,28 @@ + + sharpsl_pm.machinfo->presuspend(); + +- PEDR = 0xffffffff; /* clear it */ ++ clear_pedr_on_pxa(); + + sharpsl_pm.flags &= ~SHARPSL_ALARM_ACTIVE; + if ((sharpsl_pm.charge_mode == CHRG_ON) && ((alarm_enable && ((alarm_time - RCNR) > (SHARPSL_BATCHK_TIME_SUSPEND + 30))) || !alarm_enable)) { +- RTSR &= RTSR_ALE; ++ enable_alarm_irq(); + RTAR = RCNR + SHARPSL_BATCHK_TIME_SUSPEND; +- dev_dbg(sharpsl_pm.dev, "Charging alarm at: %08x\n",RTAR); ++ dev_dbg(sharpsl_pm.dev, "Charging alarm at: %08lx\n",RTAR); + sharpsl_pm.flags |= SHARPSL_ALARM_ACTIVE; + } else if (alarm_enable) { +- RTSR &= RTSR_ALE; ++ enable_alarm_irq(); + RTAR = alarm_time; +- dev_dbg(sharpsl_pm.dev, "User alarm at: %08x\n",RTAR); ++ dev_dbg(sharpsl_pm.dev, "User alarm at: %08lx\n",RTAR); + } else { + dev_dbg(sharpsl_pm.dev, "No alarms set.\n"); + RTAR = 0; + } + +- pxa_pm_enter(state); ++ sharpsl_pm_enter(state); + + sharpsl_pm.machinfo->postsuspend(); + +- dev_dbg(sharpsl_pm.dev, "Corgi woken up from suspend: %08x\n",PEDR); ++ dev_dbg(sharpsl_pm.dev, "Corgi woken up from suspend: %08x\n",pedr_on_pxa()); + } + + static int corgi_enter_suspend(unsigned long alarm_time, unsigned int alarm_enable, suspend_state_t state) +@@ -572,7 +570,7 @@ + static int corgi_pxa_pm_enter(suspend_state_t state) + { + unsigned long alarm_time = RTAR; +- unsigned int alarm_status = ((RTSR & RTSR_ALE) != 0); ++ unsigned int alarm_status = get_alarm_status(); + + dev_dbg(sharpsl_pm.dev, "SharpSL suspending for first time.\n"); + +@@ -633,7 +631,7 @@ + } + + temp = get_select_val(buff); +- dev_dbg(sharpsl_pm.dev, "sharpsl_fatal_check: acin: %d, discharge voltage: %d, no discharge: %d\n", acin, temp, sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT)); ++ dev_dbg(sharpsl_pm.dev, "sharpsl_fatal_check: acin: %d, discharge voltage: %d, no discharge: %ld\n", acin, temp, sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT)); + + if ((acin && (temp < sharpsl_pm.machinfo->fatal_acin_volt)) || + (!acin && (temp < sharpsl_pm.machinfo->fatal_noacin_volt))) +@@ -782,9 +780,9 @@ + + static struct pm_ops sharpsl_pm_ops = { + .pm_disk_mode = PM_DISK_FIRMWARE, +- .prepare = pxa_pm_prepare, ++ .prepare = sharpsl_pm_prepare, + .enter = corgi_pxa_pm_enter, +- .finish = pxa_pm_finish, ++ .finish = sharpsl_pm_finish, + }; + + static int __init sharpsl_pm_probe(struct platform_device *pdev) +@@ -813,7 +811,7 @@ + apm_get_power_status = sharpsl_apm_get_power_status; + + pm_set_ops(&sharpsl_pm_ops); +- ++ printk(KERN_DEBUG "sharpsl register pm_ops\n"); + mod_timer(&sharpsl_pm.ac_timer, jiffies + msecs_to_jiffies(250)); + + return 0; +Index: linux-2.6.21/arch/arm/common/sharpsl_pm.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.21/arch/arm/common/sharpsl_pm.h 2007-07-03 21:42:26.000000000 +0200 +@@ -0,0 +1,78 @@ ++ ++#ifdef CONFIG_ARCH_PXA ++# include <asm/arch/pm.h> ++# include <asm/arch/pxa-regs.h> ++# include <asm/arch/sharpsl.h> ++static inline void clear_pedr_on_pxa(void) ++{ ++ PEDR = 0xffffffff; /* clear it */ ++} ++ ++static inline void enable_alarm_irq(void) ++{ ++ RTSR &= RTSR_ALE; ++} ++ ++static inline int pedr_on_pxa(void) ++{ ++ return PEDR; ++} ++ ++static inline int get_alarm_status(void) ++{ ++ return ((RTSR & RTSR_ALE) != 0); ++} ++ ++static inline int sharpsl_pm_enter(suspend_state_t state) ++{ ++ return pxa_pm_enter(state); ++} ++static inline int sharpsl_pm_prepare(suspend_state_t state) ++{ ++ return pxa_pm_prepare(state); ++} ++ ++int sharpsl_pm_finish(suspend_state_t state) ++{ ++ return pxa_pm_finish(state); ++} ++#endif ++ ++#ifdef CONFIG_ARCH_SA1100 ++# include <asm/arch/SA-1100.h> ++extern int sa11x0_pm_enter(suspend_state_t state); ++ ++static inline void clear_pedr_on_pxa(void) {} ++static inline void enable_alarm_irq(void) {} ++static inline int pedr_on_pxa(void) ++{ ++ return GPLR; ++} ++ ++static inline int get_alarm_status(void) ++{ ++ return 1; ++} ++ ++static inline int sharpsl_pm_enter(suspend_state_t state) ++{ ++ return sa11x0_pm_enter(state); ++} ++ ++static inline int sharpsl_pm_prepare(suspend_state_t state) ++{ ++ switch (state) { ++ case PM_SUSPEND_MEM: ++ case PM_SUSPEND_STANDBY: ++ return 0; ++ default: ++ return -EINVAL; ++ } ++} ++ ++int sharpsl_pm_finish(suspend_state_t state) ++{ ++ return 0; ++} ++#endif ++ +Index: linux-2.6.21/arch/arm/mach-sa1100/pm.c +=================================================================== +--- linux-2.6.21.orig/arch/arm/mach-sa1100/pm.c 2007-04-26 05:08:32.000000000 +0200 ++++ linux-2.6.21/arch/arm/mach-sa1100/pm.c 2007-07-03 21:42:26.000000000 +0200 +@@ -54,7 +54,7 @@ + }; + + +-static int sa11x0_pm_enter(suspend_state_t state) ++int sa11x0_pm_enter(suspend_state_t state) + { + unsigned long gpio, sleep_save[SLEEP_SAVE_SIZE]; + struct timespec delta, rtc; +@@ -128,6 +128,7 @@ + + return 0; + } ++EXPORT_SYMBOL(sa1x00_pm_enter); + + unsigned long sleep_phys_sp(void *sp) + { |