Skip to contentSkip to conversation

unbreak suspend on zaurus on 2.6.30-rc6

PATCH Pavel Machek 3 participants 5 messages May 29, 2009 – Jun 27, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi!

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

Pavel

arch/arm/common/sharpsl_pm.c +5 -2
@@ -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;
arch/arm/mach-pxa/pm.c +11 -1
diff -ur clean-rc6/arch/arm/mach-pxa/pm.c linux-rc6/arch/arm/mach-pxa/pm.c
@@ -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);
 	}
 
arch/arm/mach-pxa/pxa27x.c +1 -1
diff -ur clean-rc6/arch/arm/mach-pxa/pxa27x.c linux-rc6/arch/arm/mach-pxa/pxa27x.c
@@ -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);
arch/arm/mach-pxa/spitz_pm.c +3 -0
diff -ur clean-rc6/arch/arm/mach-pxa/spitz_pm.c linux-rc6/arch/arm/mach-pxa/spitz_pm.c
@@ -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);
 
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#1 lore raw
Quoted 2 lines · Pavel Machek

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

Thanks for the patch. I tried rc7 yesterday with same problem.

Your patch makes resume working again. Serial console does not work after resume, inserting or removing charger causes resume, and syslog is a bit noisy now.

________________________________________________________________________
Stanislav Brabec
http://www.penguin.cz/~utx/zaurus

#2 lore raw
Quoted 10 lines · Stanislav Brabec
Quoted 2 lines · Pavel Machek

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

Thanks for the patch. I tried rc7 yesterday with same problem.

Your patch makes resume working again. Serial console does not work after resume, inserting or removing charger causes resume, and syslog is a bit noisy now.

Plus I guess I should mention that my patch disables offline charging. So be sure to shutdown for charger...
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#3 lore raw
Quoted 8 lines · Pavel Machek
Quoted 7 lines · Stanislav Brabec
Quoted 2 lines · Pavel Machek

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

Thanks for the patch. I tried rc7 yesterday with same problem.

Quoted 7 lines
Quoted 3 lines

Your patch makes resume working again. Serial console does not work after resume, inserting or removing charger causes resume, and syslog is a bit noisy now.

Plus I guess I should mention that my patch disables offline charging. So be sure to shutdown for charger...
Pavel

Or charge online? IIRC Zaurii don't have any problems with online charging, do they?

Signature · 2 lines
With best wishes
Dmitry
#4 lore raw
Quoted 14 lines · Dmitry Eremin-Solenikov
Quoted 12 lines · Pavel Machek
Quoted 10 lines · Stanislav Brabec
Quoted 2 lines · Pavel Machek

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

Thanks for the patch. I tried rc7 yesterday with same problem.

Your patch makes resume working again. Serial console does not work after resume, inserting or removing charger causes resume, and syslog is a bit noisy now.

Quoted 5 lines
Quoted 2 lines

Plus I guess I should mention that my patch disables offline charging. So be sure to shutdown for charger...

Or charge online? IIRC Zaurii don't have any problems with online charging, do they?

Not sure. I'd have to build some measuring equipment for that.

They seem to charge slower when 'on', but I'm not sure how much slower...

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