r4065 - branches/src/target/kernel/2.6.24.x/patches
werner at sita.openmoko.org
werner at sita.openmoko.org
Fri Feb 15 04:34:26 CET 2008
Author: werner
Date: 2008-02-15 04:34:21 +0100 (Fri, 15 Feb 2008)
New Revision: 4065
Modified:
branches/src/target/kernel/2.6.24.x/patches/pcf506xx.patch
Log:
fix-pcf50606-coldplug-usb-presence-and-second-kick.patch
From: Andy Green <andy at openmoko.com>
Take care to notice adapter state on boot
Signed-off-by: Andy Green <andy at openmoko.com>
---
drivers/i2c/chips/pcf50606.c | 28 +++++++++++++++++++++++++++-
1 files changed, 27 insertions(+), 1 deletions(-)
Modified: branches/src/target/kernel/2.6.24.x/patches/pcf506xx.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/pcf506xx.patch 2008-02-15 03:28:23 UTC (rev 4064)
+++ branches/src/target/kernel/2.6.24.x/patches/pcf506xx.patch 2008-02-15 03:34:21 UTC (rev 4065)
@@ -8,10 +8,10 @@
Signed off-by: Werner Almesberger <werner at openmoko.org>
-Index: linux-2.6.24-rc7/include/linux/pcf50606.h
+Index: linux-2.6.24/include/linux/pcf50606.h
===================================================================
---- linux-2.6.24-rc7.orig/include/linux/pcf50606.h
-+++ linux-2.6.24-rc7/include/linux/pcf50606.h
+--- linux-2.6.24.orig/include/linux/pcf50606.h
++++ linux-2.6.24/include/linux/pcf50606.h
@@ -1,6 +1,9 @@
#ifndef _LINUX_PCF50606_H
#define _LINUX_PCF50606_H
@@ -49,10 +49,10 @@
#define PCF50606_FEAT_EXTON 0x00000001 /* not yet supported */
#define PCF50606_FEAT_MBC 0x00000002
-Index: linux-2.6.24-rc7/include/linux/pcf50633.h
+Index: linux-2.6.24/include/linux/pcf50633.h
===================================================================
---- linux-2.6.24-rc7.orig/include/linux/pcf50633.h
-+++ linux-2.6.24-rc7/include/linux/pcf50633.h
+--- linux-2.6.24.orig/include/linux/pcf50633.h
++++ linux-2.6.24/include/linux/pcf50633.h
@@ -1,6 +1,9 @@
#ifndef _LINUX_PCF50633_H
#define _LINUX_PCF50633_H
@@ -94,10 +94,10 @@
#define PCF50633_FEAT_EXTON 0x00000001 /* not yet supported */
#define PCF50633_FEAT_MBC 0x00000002
#define PCF50633_FEAT_BBC 0x00000004 /* not yet supported */
-Index: linux-2.6.24-rc7/include/linux/pcf506xx.h
+Index: linux-2.6.24/include/linux/pcf506xx.h
===================================================================
--- /dev/null
-+++ linux-2.6.24-rc7/include/linux/pcf506xx.h
++++ linux-2.6.24/include/linux/pcf506xx.h
@@ -0,0 +1,31 @@
+#ifndef _LINUX_PCF506XX_H
+#define _LINUX_PCF506XX_H
@@ -130,3 +130,56 @@
+
+
+#endif /* !_LINUX_PCF506XX_H */
+Index: linux-2.6.24/drivers/i2c/chips/pcf50606.c
+===================================================================
+--- linux-2.6.24.orig/drivers/i2c/chips/pcf50606.c
++++ linux-2.6.24/drivers/i2c/chips/pcf50606.c
+@@ -102,6 +102,7 @@
+ int allow_close;
+ int onkey_seconds;
+ int irq;
++ int coldplug_done;
+ #ifdef CONFIG_PM
+ struct {
+ u_int8_t dcdc1, dcdc2;
+@@ -572,6 +573,30 @@
+ if (ret != 3)
+ DEBUGPC("Oh crap PMU IRQ register read failed %d\n", ret);
+
++ if (!pcf->coldplug_done) {
++ DEBUGPC("PMU Coldplug init\n");
++
++ /* we used SECOND to kick ourselves started -- turn it off */
++ pcfirq[0] &= ~PCF50606_INT1_SECOND;
++ reg_set_bit_mask(pcf, PCF50606_REG_INT1M, PCF50606_INT1_SECOND,
++ PCF50606_INT1_SECOND);
++
++ /* coldplug the USB if present */
++ if (__reg_read(pcf, PCF50606_REG_OOCS) & PCF50606_OOCS_EXTON) {
++ /* Charger inserted */
++ DEBUGPC("COLD CHGINS ");
++ input_report_key(pcf->input_dev, KEY_BATTERY, 1);
++ apm_queue_event(APM_POWER_STATUS_CHANGE);
++ pcf->flags |= PCF50606_F_CHG_PRESENT;
++ if (pcf->pdata->cb)
++ pcf->pdata->cb(&pcf->client.dev,
++ PCF50606_FEAT_MBC, PMU_EVT_INSERT);
++ }
++
++ pcf->coldplug_done = 1;
++ }
++
++
+ dev_dbg(&pcf->client.dev, "INT1=0x%02x INT2=0x%02x INT3=0x%02x:",
+ pcfirq[0], pcfirq[1], pcfirq[2]);
+
+@@ -1644,7 +1669,8 @@
+ pm_power_off = &pcf50606_go_standby;
+
+ /* configure interrupt mask */
+- reg_write(data, PCF50606_REG_INT1M, PCF50606_INT1_SECOND);
++ /* we don't mask SECOND here, because we want one to do coldplug with */
++ reg_write(data, PCF50606_REG_INT1M, 0x00);
+ reg_write(data, PCF50606_REG_INT2M, 0x00);
+ reg_write(data, PCF50606_REG_INT3M, PCF50606_INT3_TSCPRES);
+
More information about the commitlog
mailing list