summaryrefslogtreecommitdiffstats
path: root/drivers/usb/otg/twl6030-usb.c
diff options
context:
space:
mode:
authorHema HK <hemahk@ti.com>2011-03-22 16:54:21 +0530
committerFelipe Balbi <balbi@ti.com>2011-05-13 14:43:55 +0300
commit603ab524ed95f566b0f25566484d4f449e433d74 (patch)
treee9f065e1fca07f2daec63bff4c823cc75e2e15b2 /drivers/usb/otg/twl6030-usb.c
parentc51e36dc11e44aa960744ec1c36fb2ab8d68b218 (diff)
usb: otg: TWL6030: OMAP4430: Adding SRP VBUS pulsing API
Implement the start_srp API to generate the VBUS pulsing and assign it to otg_transciever function pointer. This will be used by the link driver when there is SRP initiation from user. Signed-off-by: Hema HK <hemahk@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/otg/twl6030-usb.c')
-rw-r--r--drivers/usb/otg/twl6030-usb.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/usb/otg/twl6030-usb.c b/drivers/usb/otg/twl6030-usb.c
index 6e920de64ef..3f2e07011a4 100644
--- a/drivers/usb/otg/twl6030-usb.c
+++ b/drivers/usb/otg/twl6030-usb.c
@@ -31,6 +31,7 @@
#include <linux/err.h>
#include <linux/notifier.h>
#include <linux/slab.h>
+#include <linux/delay.h>
/* usb register definitions */
#define USB_VENDOR_ID_LSB 0x00
@@ -188,6 +189,19 @@ static int twl6030_phy_suspend(struct otg_transceiver *x, int suspend)
return 0;
}
+static int twl6030_start_srp(struct otg_transceiver *x)
+{
+ struct twl6030_usb *twl = xceiv_to_twl(x);
+
+ twl6030_writeb(twl, TWL_MODULE_USB, 0x24, USB_VBUS_CTRL_SET);
+ twl6030_writeb(twl, TWL_MODULE_USB, 0x84, USB_VBUS_CTRL_SET);
+
+ mdelay(100);
+ twl6030_writeb(twl, TWL_MODULE_USB, 0xa0, USB_VBUS_CTRL_CLR);
+
+ return 0;
+}
+
static int twl6030_usb_ldo_init(struct twl6030_usb *twl)
{
@@ -403,6 +417,7 @@ static int __devinit twl6030_usb_probe(struct platform_device *pdev)
twl->otg.init = twl6030_phy_init;
twl->otg.shutdown = twl6030_phy_shutdown;
twl->otg.set_suspend = twl6030_phy_suspend;
+ twl->otg.start_srp = twl6030_start_srp;
/* init spinlock for workqueue */
spin_lock_init(&twl->lock);