aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHao Wu <hao.wu@intel.com>2010-12-09 10:37:43 +0000
committerAlan Cox <alan@linux.intel.com>2010-12-09 10:37:43 +0000
commitb7bfe7d6f50386cba8b265271fa76772ea4d3418 (patch)
tree9b491e9890a9653d0f115bf4ff5996fdc4b1f2c7
parentcdda84b569996429b381ae0b47c62d342e90b37b (diff)
downloadmrst-s0i3-test-b7bfe7d6f50386cba8b265271fa76772ea4d3418.tar.gz
mrst-s0i3-test-b7bfe7d6f50386cba8b265271fa76772ea4d3418.tar.xz
mrst-s0i3-test-b7bfe7d6f50386cba8b265271fa76772ea4d3418.zip
usb: langwell_udc: set vbus_active flag according to state
This patch adds active bit setting in order to avoid issues with composite gadget on pullup functions which query on this bit. Signed-off-by: Hao Wu <hao.wu@intel.com>
-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;
}