diff options
author | Peter Chen <peter.chen@freescale.com> | 2013-08-14 05:44:14 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-14 15:37:20 -0400 |
commit | d268e9bc23f5df4a2f4167da246d277c2a468d3d (patch) | |
tree | c513252a12c3ef3ee16b864e9cfb91bf0d4fe406 /drivers/usb/chipidea/udc.c | |
parent | e7e621eb84b0708f6a04ccb453d47e77d22440e4 (diff) |
usb: chipidea: retire flag CI_HDRC_PULLUP_ON_VBUS
Currently, the controller only runs when the ci->vbus_active is true.
So the flag CI_HDRC_PULLUP_ON_VBUS is useless no longer.
If the user doesn't have otgsc, he/she needs to change ci_handle_vbus_change
to update ci->vbus_active.
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>
Diffstat (limited to 'drivers/usb/chipidea/udc.c')
-rw-r--r-- | drivers/usb/chipidea/udc.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 45abf4d46a71..90c3572bd1b0 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c | |||
@@ -1448,9 +1448,6 @@ static int ci_udc_vbus_session(struct usb_gadget *_gadget, int is_active) | |||
1448 | unsigned long flags; | 1448 | unsigned long flags; |
1449 | int gadget_ready = 0; | 1449 | int gadget_ready = 0; |
1450 | 1450 | ||
1451 | if (!(ci->platdata->flags & CI_HDRC_PULLUP_ON_VBUS)) | ||
1452 | return -EOPNOTSUPP; | ||
1453 | |||
1454 | spin_lock_irqsave(&ci->lock, flags); | 1451 | spin_lock_irqsave(&ci->lock, flags); |
1455 | ci->vbus_active = is_active; | 1452 | ci->vbus_active = is_active; |
1456 | if (ci->driver) | 1453 | if (ci->driver) |
@@ -1635,13 +1632,11 @@ static int ci_udc_start(struct usb_gadget *gadget, | |||
1635 | 1632 | ||
1636 | ci->driver = driver; | 1633 | ci->driver = driver; |
1637 | pm_runtime_get_sync(&ci->gadget.dev); | 1634 | pm_runtime_get_sync(&ci->gadget.dev); |
1638 | if (ci->platdata->flags & CI_HDRC_PULLUP_ON_VBUS) { | 1635 | if (ci->vbus_active) { |
1639 | if (ci->vbus_active) { | 1636 | hw_device_reset(ci, USBMODE_CM_DC); |
1640 | hw_device_reset(ci, USBMODE_CM_DC); | 1637 | } else { |
1641 | } else { | 1638 | pm_runtime_put_sync(&ci->gadget.dev); |
1642 | pm_runtime_put_sync(&ci->gadget.dev); | 1639 | goto done; |
1643 | goto done; | ||
1644 | } | ||
1645 | } | 1640 | } |
1646 | 1641 | ||
1647 | retval = hw_device_state(ci, ci->ep0out->qh.dma); | 1642 | retval = hw_device_state(ci, ci->ep0out->qh.dma); |
@@ -1664,8 +1659,7 @@ static int ci_udc_stop(struct usb_gadget *gadget, | |||
1664 | 1659 | ||
1665 | spin_lock_irqsave(&ci->lock, flags); | 1660 | spin_lock_irqsave(&ci->lock, flags); |
1666 | 1661 | ||
1667 | if (!(ci->platdata->flags & CI_HDRC_PULLUP_ON_VBUS) || | 1662 | if (ci->vbus_active) { |
1668 | ci->vbus_active) { | ||
1669 | hw_device_state(ci, 0); | 1663 | hw_device_state(ci, 0); |
1670 | if (ci->platdata->notify_event) | 1664 | if (ci->platdata->notify_event) |
1671 | ci->platdata->notify_event(ci, | 1665 | ci->platdata->notify_event(ci, |
@@ -1800,12 +1794,6 @@ static int udc_start(struct ci_hdrc *ci) | |||
1800 | } | 1794 | } |
1801 | } | 1795 | } |
1802 | 1796 | ||
1803 | if (!(ci->platdata->flags & CI_HDRC_PULLUP_ON_VBUS)) { | ||
1804 | retval = hw_device_reset(ci, USBMODE_CM_DC); | ||
1805 | if (retval) | ||
1806 | goto put_transceiver; | ||
1807 | } | ||
1808 | |||
1809 | if (ci->transceiver) { | 1797 | if (ci->transceiver) { |
1810 | retval = otg_set_peripheral(ci->transceiver->otg, | 1798 | retval = otg_set_peripheral(ci->transceiver->otg, |
1811 | &ci->gadget); | 1799 | &ci->gadget); |