[RFC/PATCH 2/2] Triton Battery charger interface driver for OMAP3430

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Madhusudhan Chikkature <madhu.cr@xxxxxx>

This patch updates the twl4030 usb driver to call the functionality supported
by the TWL4030 battery charger interface driver to enable/disable battery
charging upon cable attach/detach.

Signed-off-by: Madhusudhan Chikkature <madhu.cr@xxxxxx>
---
 drivers/i2c/chips/twl4030-usb.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

Index: linux-omap-2.6/drivers/i2c/chips/twl4030-usb.c
===================================================================
--- linux-omap-2.6.orig/drivers/i2c/chips/twl4030-usb.c	2008-06-20
15:42:26.000000000 +0530
+++ linux-omap-2.6/drivers/i2c/chips/twl4030-usb.c	2008-06-20
15:47:40.000000000 +0530
@@ -589,6 +589,12 @@
 	twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, PROTECT_KEY);
 }

+#ifdef CONFIG_TWL4030_BCI_BATTERY
+extern int twl4030charger_usb_en(int enable);
+#else
+static inline int twl4030charger_usb_en(int enable) { return 0; }
+#endif
+
 static irqreturn_t twl4030_usb_irq(int irq, void *_twl)
 {
 	int ret = IRQ_NONE;
@@ -601,10 +607,13 @@
 		goto done;
 	}

-	if (val & USB_PRES_RISING)
+	if (val & USB_PRES_RISING) {
 		twl4030_phy_resume();
-	else
+		twl4030charger_usb_en(1);
+	} else {
+		twl4030charger_usb_en(0);
 		twl4030_phy_suspend(0);
+	}

 	ret = IRQ_HANDLED;



--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux