All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7 V2] mfd: TWL6030: USBOTG VBUS event generation on
@ 2010-12-10  7:03 Hema HK
  0 siblings, 0 replies; only message in thread
From: Hema HK @ 2010-12-10  7:03 UTC (permalink / raw)
  To: linux-usb, linux-omap; +Cc: Hema HK, Balaji TK, Felipe Balbi, Samuel Ortiz

With TWL6030-usb, VBUS SESS_VLD and SESS_END events are not generated
as expected. When these interrupts are enabled, charger VBUS detection
interrupt does not get generated. So USBOTG has to be dependent on charger
VBUS interrupts.
So added one bit for USBOTG and changed the handler to call the 
USBOTG handler whenever there is a charger VBUS interrpt.

VBUS SESS_VLD and SESS_END event generation issue is under debug with
HW team. This fix might not be required once after fixing the issue.

Signed-off-by: Balaji TK <balajitk@ti.com>
Signed-off-by: Hema HK <hemahk@ti.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/mfd/twl6030-irq.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Index: usb/drivers/mfd/twl6030-irq.c
===================================================================
--- usb.orig/drivers/mfd/twl6030-irq.c
+++ usb/drivers/mfd/twl6030-irq.c
@@ -74,7 +74,7 @@ static int twl6030_interrupt_mapping[24]
 	USBOTG_INTR_OFFSET,	/* Bit 16	ID_WKUP			*/
 	USBOTG_INTR_OFFSET,	/* Bit 17	VBUS_WKUP		*/
 	USBOTG_INTR_OFFSET,	/* Bit 18	ID			*/
-	USBOTG_INTR_OFFSET,	/* Bit 19	VBUS			*/
+	USB_PRES_INTR_OFFSET,	/* Bit 19	VBUS			*/
 	CHARGER_INTR_OFFSET,	/* Bit 20	CHRG_CTRL		*/
 	CHARGER_INTR_OFFSET,	/* Bit 21	EXT_CHRG		*/
 	CHARGER_INTR_OFFSET,	/* Bit 22	INT_CHRG		*/
@@ -128,6 +128,13 @@ static int twl6030_irq_thread(void *data
 
 		sts.bytes[3] = 0; /* Only 24 bits are valid*/
 
+		/*
+		 * Since VBUS status bit is not reliable for VBUS disconnect
+		 * use CHARGER VBUS detection status bit instead.
+		 */
+		if (sts.bytes[2] & 0x10)
+			sts.bytes[2] |= 0x08;
+
 		for (i = 0; sts.int_sts; sts.int_sts >>= 1, i++) {
 			local_irq_disable();
 			if (sts.int_sts & 0x1) {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-12-10  7:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-10  7:03 [PATCH 1/7 V2] mfd: TWL6030: USBOTG VBUS event generation on Hema HK

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.