]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[ARM] pxa/sharpsl_pm: zaurus c3000 aka spitz: fix resume
authorPavel Machek <pavel@ucw.cz>
Sun, 6 Sep 2009 05:28:40 +0000 (07:28 +0200)
committerEric Miao <eric.y.miao@gmail.com>
Mon, 7 Sep 2009 15:14:59 +0000 (23:14 +0800)
sharpsl_pm.c code tries to read battery state very early during
resume, but those battery meters are connected on SPI and that's only
resumed way later.

Replace the check with simple checking of battery fatal signal, that
actually works at this stage.

Signed-off-by: Pavel Machek <pavel@ucw.cz>
Tested-by: Stanislav Brabec <utx@penguin.cz>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
arch/arm/mach-pxa/sharpsl_pm.c

index 2546c066cd6e9b2c1fdbf932e3793797ea5b8898..629e05d1196ef7d24a5382d91b767c3bca04ff4c 100644 (file)
@@ -678,8 +678,8 @@ static int corgi_enter_suspend(unsigned long alarm_time, unsigned int alarm_enab
                dev_dbg(sharpsl_pm.dev, "User triggered wakeup in offline charger.\n");
        }
 
-       if ((!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_LOCK)) || (sharpsl_fatal_check() < 0) )
-       {
+       if ((!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_LOCK)) ||
+           (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_FATAL))) {
                dev_err(sharpsl_pm.dev, "Fatal condition. Suspend.\n");
                corgi_goto_sleep(alarm_time, alarm_enable, state);
                return 1;