summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@iki.fi>2015-03-22 17:37:55 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-24 13:47:12 +0100
commit0ed64a4c8f5d53aaa6b20e7424b127be7392f700 (patch)
treeca62e6d8a102c1c33c2906820d6e92a6901d4105 /drivers/staging
parentc8eedbd107cc73d6dfb5f8df2307c43cf27b0107 (diff)
downloadlinux-stable-0ed64a4c8f5d53aaa6b20e7424b127be7392f700.tar.gz
linux-stable-0ed64a4c8f5d53aaa6b20e7424b127be7392f700.tar.bz2
linux-stable-0ed64a4c8f5d53aaa6b20e7424b127be7392f700.zip
staging: octeon-usb: use USB stack to turn on power
Use USB stack to turn on the power bit. It will also do the necessary delays. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/octeon-usb/octeon-hcd.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c
index 1f501ff34a62..30a96ff869e4 100644
--- a/drivers/staging/octeon-usb/octeon-hcd.c
+++ b/drivers/staging/octeon-usb/octeon-hcd.c
@@ -860,12 +860,6 @@ static int cvmx_usb_initialize(struct cvmx_usb_state *usb)
cvmx_usb_write_csr32(usb, CVMX_USBCX_HCFG(usb->index),
usbcx_hcfg.u32);
}
- /*
- * 3. Program the port power bit to drive VBUS on the USB,
- * USBC_HPRT[PRTPWR] = 1
- */
- USB_SET_FIELD32(CVMX_USBCX_HPRT(usb->index),
- union cvmx_usbcx_hprt, prtpwr, 1);
/*
* Steps 4-15 from the manual are done later in the port enable
@@ -3354,6 +3348,7 @@ static int octeon_usb_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
struct octeon_hcd *priv = hcd_to_octeon(hcd);
struct device *dev = hcd->self.controller;
struct cvmx_usb_port_status usb_port_status;
+ struct cvmx_usb_state *usb = &priv->usb;
int port_status;
struct usb_hub_descriptor *desc;
unsigned long flags;
@@ -3531,7 +3526,14 @@ static int octeon_usb_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
return -EINVAL;
case USB_PORT_FEAT_POWER:
dev_dbg(dev, " POWER\n");
- return -EINVAL;
+ /*
+ * Program the port power bit to drive VBUS on the USB.
+ */
+ spin_lock_irqsave(&priv->lock, flags);
+ USB_SET_FIELD32(CVMX_USBCX_HPRT(usb->index),
+ union cvmx_usbcx_hprt, prtpwr, 1);
+ spin_unlock_irqrestore(&priv->lock, flags);
+ return 0;
case USB_PORT_FEAT_RESET:
dev_dbg(dev, " RESET\n");
spin_lock_irqsave(&priv->lock, flags);
@@ -3709,9 +3711,6 @@ static int octeon_usb_probe(struct platform_device *pdev)
return -1;
}
- /* This delay is needed for CN3010, but I don't know why... */
- mdelay(10);
-
status = usb_add_hcd(hcd, irq, 0);
if (status) {
dev_dbg(dev, "USB add HCD failed with %d\n", status);