From: Madhusudhan Chikkature Date: Tue, 22 Jul 2008 11:57:04 +0000 (+0530) Subject: Triton BCI driver for OMAP3430 - USB changes X-Git-Tag: v2.6.26-omap1~20 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=42e11feb74282ed34fb00e1af3d6fc63383898ec;p=linux-2.6-omap-h63xx.git Triton BCI driver for OMAP3430 - USB changes This patch calls the functionality supported by the TWL4030 battery charger interface driver to enable/disable battery charging upon cable attach/detach. Signed-off-by: Madhusudhan Chikkature Signed-off-by: Tony Lindgren --- diff --git a/drivers/i2c/chips/twl4030-usb.c b/drivers/i2c/chips/twl4030-usb.c index 20858b5bf78..d9760e41631 100644 --- a/drivers/i2c/chips/twl4030-usb.c +++ b/drivers/i2c/chips/twl4030-usb.c @@ -601,10 +601,13 @@ static irqreturn_t twl4030_usb_irq(int irq, void *_twl) 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; diff --git a/include/linux/i2c/twl4030.h b/include/linux/i2c/twl4030.h index 40af46e181e..b141cc73c23 100644 --- a/include/linux/i2c/twl4030.h +++ b/include/linux/i2c/twl4030.h @@ -127,4 +127,11 @@ int twl4030_set_gpio_edge_ctrl(int gpio, int edge); int twl4030_set_gpio_debounce(int gpio, int enable); int twl4030_free_gpio(int gpio); +#if defined(CONFIG_TWL4030_BCI_BATTERY) || \ + defined(CONFIG_TWL4030_BCI_BATTERY_MODULE) + extern int twl4030charger_usb_en(int enable); +#else + static inline int twl4030charger_usb_en(int enable) { return 0; } +#endif + #endif /* End of __TWL4030_H */