r4045 - branches/src/target/kernel/2.6.24.x/patches

werner at sita.openmoko.org werner at sita.openmoko.org
Mon Feb 11 01:20:19 CET 2008


Author: werner
Date: 2008-02-11 01:20:15 +0100 (Mon, 11 Feb 2008)
New Revision: 4045

Added:
   branches/src/target/kernel/2.6.24.x/patches/fix-pcf50633-LOWBAT-kill-init.patch
Modified:
   branches/src/target/kernel/2.6.24.x/patches/series
Log:
fix-pcf50633-LOWBAT-kill-init.patch

(Corrected a & vs. == precedence inversion.)

From: Andy Green <andy at openmoko.com>

Until now the driver treats LOWBAT as a fatal crisis and responds
by going postal on init.  But the driver didn't think that we can
have adapter or USB power and no battery, which is fine.

This patch reserves the crisis behaviour for when we have no
adapter / USB power and just acknowledges the PMU exception when
we do.

Signed-off-by: Andy Green <andy at openmoko.com>

---

 drivers/i2c/chips/pcf50633.c |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)



Added: branches/src/target/kernel/2.6.24.x/patches/fix-pcf50633-LOWBAT-kill-init.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/fix-pcf50633-LOWBAT-kill-init.patch	2008-02-10 23:37:02 UTC (rev 4044)
+++ branches/src/target/kernel/2.6.24.x/patches/fix-pcf50633-LOWBAT-kill-init.patch	2008-02-11 00:20:15 UTC (rev 4045)
@@ -0,0 +1,37 @@
+Index: linux-2.6.24/drivers/i2c/chips/pcf50633.c
+===================================================================
+--- linux-2.6.24.orig/drivers/i2c/chips/pcf50633.c
++++ linux-2.6.24/drivers/i2c/chips/pcf50633.c
+@@ -637,15 +637,25 @@
+ 	}
+ 
+ 	if (int4 & (PCF50633_INT4_LOWBAT|PCF50633_INT4_LOWSYS)) {
+-		/* Really low battery voltage, we have 8 seconds left */
+-		DEBUGPC("LOWBAT ");
+-		apm_queue_event(APM_LOW_BATTERY);
+-		DEBUGPC("SIGPWR(init) ");
+-		kill_proc(1, SIGPWR, 1);
++		if ((__reg_read(pcf, PCF50633_REG_MBCS1) &
++		    (PCF50633_MBCS1_USBPRES | PCF50633_MBCS1_USBOK)) ==
++		    (PCF50633_MBCS1_USBPRES | PCF50633_MBCS1_USBOK)) {
++			/*
++			 * hey no need to freak out, we have some kind of
++			 * valid charger power
++			 */
++			DEBUGPC("(NO)BAT ");
++		} else {
++			/* Really low battery voltage, we have 8 seconds left */
++			DEBUGPC("LOWBAT ");
++			apm_queue_event(APM_LOW_BATTERY);
++			DEBUGPC("SIGPWR(init) ");
++			kill_proc(1, SIGPWR, 1);
++		}
+ 		/* Tell PMU we are taking care of this */
+ 		reg_set_bit_mask(pcf, PCF50633_REG_OOCSHDWN,
+-				 PCF50633_OOCSHDWN_TOTRST,
+-				 PCF50633_OOCSHDWN_TOTRST);
++				PCF50633_OOCSHDWN_TOTRST,
++				PCF50633_OOCSHDWN_TOTRST);
+ 	}
+ 	if (int4 & PCF50633_INT4_HIGHTMP) {
+ 		/* High temperature */

Modified: branches/src/target/kernel/2.6.24.x/patches/series
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/series	2008-02-10 23:37:02 UTC (rev 4044)
+++ branches/src/target/kernel/2.6.24.x/patches/series	2008-02-11 00:20:15 UTC (rev 4045)
@@ -76,9 +76,10 @@
 introduce-fiq-basis.patch
 introduce-fiq-use-timer3-as-source.patch
 introduce-fiq-migrate-vibrator-gta02-only.patch
+fiq-hdq.patch
+#bq27000-battery-driver.patch
 
 # OE patches
-fiq-hdq.patch
 fix-EVIOCGRAB-semantics.patch
 iis-suspend.patch
 s3c24xx-pcm-suspend.patch
@@ -93,6 +94,9 @@
 # bad bug
 fix-hwecc-2410.patch
 
+# this may not be the last word on this issue, but the patch certainly helps
+fix-pcf50633-LOWBAT-kill-init.patch
+
 # leapfrogged from upstream
 kexec-atags.patch
 





More information about the commitlog mailing list