]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
usb: otg: usbps_otg: Automatically setup VBUS
authorMichal Simek <michal.simek@xilinx.com>
Mon, 26 Nov 2012 13:05:58 +0000 (14:05 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Sun, 2 Dec 2012 19:37:09 +0000 (20:37 +0100)
This is zedboard requirement to get otg-host to work.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/usb/otg/xilinx_usbps_otg.c
include/linux/usb/xilinx_usbps_otg.h

index ca287959c8c6d5c84ab9f106291839246f5c36d9..6a45c7f5c2b061932eafe837cfb659c6662c38ab 100644 (file)
@@ -127,6 +127,10 @@ static int xusbps_otg_set_vbus(struct usb_otg *otg, bool enabled)
 
        dev_dbg(xotg->dev, "%s <--- %s\n", __func__, enabled ? "on" : "off");
 
+       /* Enable ulpi VBUS if required */
+       if (xotg->ulpi)
+               otg_set_vbus(xotg->ulpi->otg, enabled);
+
        val = readl(xotg->base + CI_PORTSC1);
 
        if (enabled)
@@ -1939,6 +1943,9 @@ static int xusbps_otg_probe(struct platform_device *pdev)
 
        the_transceiver = xotg;
 
+       /* Setup ulpi phy for OTG */
+       xotg->ulpi = pdata->ulpi;
+
        xotg->otg.otg = kzalloc(sizeof(struct usb_otg), GFP_KERNEL);
        if (!xotg->otg.otg) {
                kfree(xotg);
index 9b1aaf6add60f0abcd71853ce244b2a474cc4ded..8c360b7a7f935f55333884898474fe67d27a8fc8 100644 (file)
@@ -166,6 +166,7 @@ struct otg_hsm {
 
 struct xusbps_otg {
        struct usb_phy          otg;
+       struct usb_phy          *ulpi;
 
        struct otg_hsm          hsm;