usb : musb : Adding USB VBUS enable functionality for DM644x DVEVM
authorThomas Abraham <t-abraham@ti.com>
Sun, 4 Jan 2009 04:11:09 +0000 (09:41 +0530)
committerRemy Bohmer <linux@bohmer.net>
Wed, 28 Jan 2009 18:57:30 +0000 (19:57 +0100)
Adding USB VBUS enable functionality for DM644x DVEVM (TI DaVinci)
platform.

Signed-off-by: Ravi Babu <ravibabu@ti.com>
Signed-off-by: Swaminathan S <swami.iyer@ti.com>
Signed-off-by: Thomas Abraham <t-abraham@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Remy Bohmer <linux@bohmer.net>
board/davinci/dvevm/dvevm.c

index abf60b35b085a032c1a4d98c50a97ef9c5498f1f..5dd081c27532df823ee4374b14126f944428815b 100644 (file)
@@ -101,3 +101,26 @@ int misc_init_r(void)
 
        return(0);
 }
+
+#ifdef CONFIG_USB_DAVINCI
+
+/* IO Expander I2C address and USB VBUS enable mask */
+#define IOEXP_I2C_ADDR 0x3A
+#define IOEXP_VBUSEN_MASK 1
+
+/*
+ * This function enables USB VBUS by writting to IO expander using I2C.
+ * Note that the I2C is already initialized at this stage. This
+ * function is used by davinci specific USB wrapper code.
+ */
+void enable_vbus(void)
+{
+       uchar data;  /* IO Expander data to enable VBUS */
+
+       /* Write to IO expander to enable VBUS */
+       i2c_read(IOEXP_I2C_ADDR, 0, 0, &data, 1);
+       data &= ~IOEXP_VBUSEN_MASK;
+       i2c_write(IOEXP_I2C_ADDR, 0, 0, &data, 1);
+}
+#endif
+