aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/gadget/langwell_udc.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c
index 1466501a932..7359dd0ef6d 100644
--- a/drivers/usb/gadget/langwell_udc.c
+++ b/drivers/usb/gadget/langwell_udc.c
@@ -3502,8 +3502,10 @@ static struct pci_driver langwell_pci_driver = {
#ifdef OTG_TRANSCEIVER
static int intel_mid_start_peripheral(struct intel_mid_otg_xceiv *iotg)
{
- struct pci_dev *pdev;
- int retval;
+ struct langwell_udc *dev = the_controller;
+ struct pci_dev *pdev;
+ unsigned long flags;
+ int retval;
if (iotg == NULL)
return -EINVAL;
@@ -3514,13 +3516,21 @@ static int intel_mid_start_peripheral(struct intel_mid_otg_xceiv *iotg)
if (retval)
dev_dbg(&pdev->dev, "Failed to start peripheral driver\n");
+ if (dev) {
+ spin_lock_irqsave(&dev->lock, flags);
+ dev->vbus_active = 1;
+ spin_unlock_irqrestore(&dev->lock, flags);
+ }
+
return retval;
}
static int intel_mid_stop_peripheral(struct intel_mid_otg_xceiv *iotg)
{
- struct pci_dev *pdev;
- int retval;
+ struct langwell_udc *dev = the_controller;
+ struct pci_dev *pdev;
+ unsigned long flags;
+ int retval;
if (iotg == NULL)
return -EINVAL;
@@ -3531,6 +3541,12 @@ static int intel_mid_stop_peripheral(struct intel_mid_otg_xceiv *iotg)
if (retval)
dev_dbg(&pdev->dev, "Failed to stop peripheral driver\n");
+ if (dev) {
+ spin_lock_irqsave(&dev->lock, flags);
+ dev->vbus_active = 0;
+ spin_unlock_irqrestore(&dev->lock, flags);
+ }
+
return retval;
}