From: Pavel Machek <pavel@ucw.cz>
To: kernel list <linux-kernel@vger.kernel.org>,
linux-arm-kernel <linux-arm-kernel@lists.arm.linux.org.uk>
Cc: Cyril Hrubis <metan@ucw.cz>
Subject: unbreak suspend on zaurus on 2.6.30-rc6
Date: Fri, 29 May 2009 12:56:19 +0200 [thread overview]
Message-ID: <20090529105619.GA24187@elf.ucw.cz> (raw)
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
next reply other threads:[~2009-05-29 10:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-29 10:56 Pavel Machek [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090529105619.GA24187@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=metan@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®