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 | |
| 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>
| -rw-r--r-- | drivers/usb/chipidea/ci_hdrc_imx.c | 1 | ||||
| -rw-r--r-- | drivers/usb/chipidea/ci_hdrc_msm.c | 1 | ||||
| -rw-r--r-- | drivers/usb/chipidea/udc.c | 24 | ||||
| -rw-r--r-- | include/linux/usb/chipidea.h | 1 |
4 files changed, 6 insertions, 21 deletions
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index 30fdc2fd8771..cc53e63c9ce9 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c | |||
| @@ -88,7 +88,6 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) | |||
| 88 | .name = "ci_hdrc_imx", | 88 | .name = "ci_hdrc_imx", |
| 89 | .capoffset = DEF_CAPOFFSET, | 89 | .capoffset = DEF_CAPOFFSET, |
| 90 | .flags = CI_HDRC_REQUIRE_TRANSCEIVER | | 90 | .flags = CI_HDRC_REQUIRE_TRANSCEIVER | |
| 91 | CI_HDRC_PULLUP_ON_VBUS | | ||
| 92 | CI_HDRC_DISABLE_STREAMING, | 91 | CI_HDRC_DISABLE_STREAMING, |
| 93 | }; | 92 | }; |
| 94 | int ret; | 93 | int ret; |
diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c index fb657ef50a9c..2d51d852b474 100644 --- a/drivers/usb/chipidea/ci_hdrc_msm.c +++ b/drivers/usb/chipidea/ci_hdrc_msm.c | |||
| @@ -49,7 +49,6 @@ static struct ci_hdrc_platform_data ci_hdrc_msm_platdata = { | |||
| 49 | .name = "ci_hdrc_msm", | 49 | .name = "ci_hdrc_msm", |
| 50 | .flags = CI_HDRC_REGS_SHARED | | 50 | .flags = CI_HDRC_REGS_SHARED | |
| 51 | CI_HDRC_REQUIRE_TRANSCEIVER | | 51 | CI_HDRC_REQUIRE_TRANSCEIVER | |
| 52 | CI_HDRC_PULLUP_ON_VBUS | | ||
| 53 | CI_HDRC_DISABLE_STREAMING, | 52 | CI_HDRC_DISABLE_STREAMING, |
| 54 | 53 | ||
| 55 | .notify_event = ci_hdrc_msm_notify_event, | 54 | .notify_event = ci_hdrc_msm_notify_event, |
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); |
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h index 10a607ce9090..7d399671a566 100644 --- a/include/linux/usb/chipidea.h +++ b/include/linux/usb/chipidea.h | |||
| @@ -18,7 +18,6 @@ struct ci_hdrc_platform_data { | |||
| 18 | unsigned long flags; | 18 | unsigned long flags; |
| 19 | #define CI_HDRC_REGS_SHARED BIT(0) | 19 | #define CI_HDRC_REGS_SHARED BIT(0) |
| 20 | #define CI_HDRC_REQUIRE_TRANSCEIVER BIT(1) | 20 | #define CI_HDRC_REQUIRE_TRANSCEIVER BIT(1) |
| 21 | #define CI_HDRC_PULLUP_ON_VBUS BIT(2) | ||
| 22 | #define CI_HDRC_DISABLE_STREAMING BIT(3) | 21 | #define CI_HDRC_DISABLE_STREAMING BIT(3) |
| 23 | /* | 22 | /* |
| 24 | * Only set it when DCCPARAMS.DC==1 and DCCPARAMS.HC==1, | 23 | * Only set it when DCCPARAMS.DC==1 and DCCPARAMS.HC==1, |
