aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2013-08-14 05:44:13 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-14 15:37:20 -0400
commite7e621eb84b0708f6a04ccb453d47e77d22440e4 (patch)
treeb46760b2ab5b52f6824c78cd463ebb657dfd13f1
parent22fa84455a2a80566ead8efe4b5e629f2375da60 (diff)
usb: chipidea: udc: fix misuse of REGS_SHARED and PULLUP_ON_VBUS flags
CI_HDRC_REGS_SHARED stands for the controller registers is shared with other USB drivers, if all USB drivers are at chipidea/, it doesn't needed to be set. CI_HDRC_PULLUP_ON_VBUS stands for pullup dp when the vbus is on. This flag doesn't need to be set if the vbus is always on for gadget since dp has always pulled up after the gadget has initialized. So, the current code seems to misuse this two flags. - When the gadget initializes, the controller doesn't need to run if it depends on vbus (CI_HDRC_PULLUP_ON_VBUS), it does not relate to shared register. - When the gadget starts (load one gadget module), the controller can run if vbus is on (CI_HDRC_PULLUP_ON_VBUS), it also does not relate to shared register. Tested-by: Marek Vasut <marex@denx.de> Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/chipidea/udc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index c70ce3891d35..45abf4d46a71 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -1637,8 +1637,7 @@ static int ci_udc_start(struct usb_gadget *gadget,
1637 pm_runtime_get_sync(&ci->gadget.dev); 1637 pm_runtime_get_sync(&ci->gadget.dev);
1638 if (ci->platdata->flags & CI_HDRC_PULLUP_ON_VBUS) { 1638 if (ci->platdata->flags & CI_HDRC_PULLUP_ON_VBUS) {
1639 if (ci->vbus_active) { 1639 if (ci->vbus_active) {
1640 if (ci->platdata->flags & CI_HDRC_REGS_SHARED) 1640 hw_device_reset(ci, USBMODE_CM_DC);
1641 hw_device_reset(ci, USBMODE_CM_DC);
1642 } else { 1641 } else {
1643 pm_runtime_put_sync(&ci->gadget.dev); 1642 pm_runtime_put_sync(&ci->gadget.dev);
1644 goto done; 1643 goto done;
@@ -1801,7 +1800,7 @@ static int udc_start(struct ci_hdrc *ci)
1801 } 1800 }
1802 } 1801 }
1803 1802
1804 if (!(ci->platdata->flags & CI_HDRC_REGS_SHARED)) { 1803 if (!(ci->platdata->flags & CI_HDRC_PULLUP_ON_VBUS)) {
1805 retval = hw_device_reset(ci, USBMODE_CM_DC); 1804 retval = hw_device_reset(ci, USBMODE_CM_DC);
1806 if (retval) 1805 if (retval)
1807 goto put_transceiver; 1806 goto put_transceiver;