public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* unbreak suspend on zaurus on 2.6.30-rc6
@ 2009-05-29 10:56 Pavel Machek
  2009-05-29 21:30 ` Stanislav Brabec
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2009-05-29 10:56 UTC (permalink / raw)
  To: kernel list, linux-arm-kernel; +Cc: Cyril Hrubis

Hi!

This is hacky patch to unbreak suspend on -rc6; perhaps it will be
useful to someone.

								Pavel

--- clean-rc6/arch/arm/common/sharpsl_pm.c	2009-05-29 01:10:31.000000000 +0200
+++ linux-rc6/arch/arm/common/sharpsl_pm.c	2009-05-28 23:28:30.000000000 +0200
@@ -12,7 +12,7 @@
  *
  */
 
-#undef DEBUG
+#define DEBUG
 
 #include <linux/module.h>
 #include <linux/timer.h>
@@ -546,6 +546,9 @@
 
 static int corgi_enter_suspend(unsigned long alarm_time, unsigned int alarm_enable, suspend_state_t state)
 {
+
+  return 0;
+
 	if (!sharpsl_pm.machinfo->should_wakeup(!(sharpsl_pm.flags & SHARPSL_ALARM_ACTIVE) && alarm_enable) )
 	{
 		if (!(sharpsl_pm.flags & SHARPSL_ALARM_ACTIVE)) {
@@ -553,7 +556,7 @@
 			corgi_goto_sleep(alarm_time, alarm_enable, state);
 			return 1;
 		}
-		if(sharpsl_off_charge_battery()) {
+		if (sharpsl_off_charge_battery()) {
 			dev_dbg(sharpsl_pm.dev, "Charging. Suspend...\n");
 			corgi_goto_sleep(alarm_time, alarm_enable, state);
 			return 1;
diff -ur clean-rc6/arch/arm/mach-pxa/pm.c linux-rc6/arch/arm/mach-pxa/pm.c
--- clean-rc6/arch/arm/mach-pxa/pm.c	2009-05-29 01:11:02.000000000 +0200
+++ linux-rc6/arch/arm/mach-pxa/pm.c	2009-05-28 23:29:54.000000000 +0200
@@ -15,11 +15,14 @@
 #include <linux/suspend.h>
 #include <linux/errno.h>
 
+#include <mach/spitz.h>
 #include <mach/pm.h>
 
 struct pxa_cpu_pm_fns *pxa_cpu_pm_fns;
 static unsigned long *sleep_save;
 
+extern  int pxa27x_cpu_pm_prepare(void);
+
 int pxa_pm_enter(suspend_state_t state)
 {
 	unsigned long sleep_save_checksum = 0, checksum = 0;
@@ -39,15 +42,21 @@
 			sleep_save_checksum += sleep_save[i];
 	}
 
+	pxa27x_cpu_pm_prepare();
+	//	PSPR = virt_to_phys(pxa_cpu_resume);
+
 	/* *** go zzz *** */
 	pxa_cpu_pm_fns->enter(state);
 	cpu_init();
 
+	gpio_set_value(SPITZ_GPIO_LED_ORANGE, 1);
+
+
 	if (state != PM_SUSPEND_STANDBY) {
 		/* after sleeping, validate the checksum */
 		for (i = 0; i < pxa_cpu_pm_fns->save_count - 1; i++)
 			checksum += sleep_save[i];
-
+#if 0
 		/* if invalid, display message and wait for a hardware reset */
 		if (checksum != sleep_save_checksum) {
 
@@ -56,6 +65,7 @@
 			while (1)
 				pxa_cpu_pm_fns->enter(state);
 		}
+#endif
 		pxa_cpu_pm_fns->restore(sleep_save);
 	}
 
diff -ur clean-rc6/arch/arm/mach-pxa/pxa27x.c linux-rc6/arch/arm/mach-pxa/pxa27x.c
--- clean-rc6/arch/arm/mach-pxa/pxa27x.c	2009-05-29 01:11:02.000000000 +0200
+++ linux-rc6/arch/arm/mach-pxa/pxa27x.c	2009-05-28 23:28:30.000000000 +0200
@@ -264,7 +264,7 @@
 	return state == PM_SUSPEND_MEM || state == PM_SUSPEND_STANDBY;
 }
 
-static int pxa27x_cpu_pm_prepare(void)
+ int pxa27x_cpu_pm_prepare(void)
 {
 	/* set resume return address */
 	PSPR = virt_to_phys(pxa_cpu_resume);
diff -ur clean-rc6/arch/arm/mach-pxa/spitz_pm.c linux-rc6/arch/arm/mach-pxa/spitz_pm.c
--- clean-rc6/arch/arm/mach-pxa/spitz_pm.c	2009-05-29 01:11:02.000000000 +0200
+++ linux-rc6/arch/arm/mach-pxa/spitz_pm.c	2009-05-28 23:28:30.000000000 +0200
@@ -124,6 +124,7 @@
 	int is_resume = 0;
 	int acin = sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN);
 
+#if 0
 	if (spitz_last_ac_status != acin) {
 		if (acin) {
 			/* charge on */
@@ -141,6 +142,8 @@
 		return 0;
 	}
 
+#endif
+
 	if (PEDR & GPIO_bit(SPITZ_GPIO_KEY_INT))
 		is_resume |= GPIO_bit(SPITZ_GPIO_KEY_INT);
 

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-06-27 11:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-29 10:56 unbreak suspend on zaurus on 2.6.30-rc6 Pavel Machek
2009-05-29 21:30 ` Stanislav Brabec
2009-05-30  9:55   ` Pavel Machek
2009-05-30 14:41     ` Dmitry Eremin-Solenikov
2009-06-24 15:02       ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox