aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/chipidea/udc.c
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2013-03-29 20:46:43 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-29 23:55:46 -0400
commit571bb7abac4ed02cf7d5094b4a04a8bdca3783ed (patch)
treefc9d287421a3bc8d267a8403e9d254ad3c7968dd /drivers/usb/chipidea/udc.c
parent19290816c5fa3f289465d24bfbac9d669cc2f061 (diff)
Revert "USB: chipidea: add vbus detect for udc"
There are several problems with this patch: + in introduces a sparse warning for a condition that's always negative, + and because of that, it actually doesn't do anything useful, + and vbus detection belongs to otg, not device function anyway. This reverts commit 8c4fc031954b4eb72daf13d3c907a985a3eee208. Signed-off-by: Peter Chen <peter.chen@freescale.com> [Alex: amended the above text] 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.c39
1 files changed, 1 insertions, 38 deletions
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 3dc509382389..86db1def9e28 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -299,18 +299,6 @@ static u32 hw_test_and_clear_intr_active(struct ci13xxx *ci)
299 return reg; 299 return reg;
300} 300}
301 301
302static void hw_enable_vbus_intr(struct ci13xxx *ci)
303{
304 hw_write(ci, OP_OTGSC, OTGSC_AVVIS, OTGSC_AVVIS);
305 hw_write(ci, OP_OTGSC, OTGSC_AVVIE, OTGSC_AVVIE);
306 queue_work(ci->wq, &ci->vbus_work);
307}
308
309static void hw_disable_vbus_intr(struct ci13xxx *ci)
310{
311 hw_write(ci, OP_OTGSC, OTGSC_AVVIE, 0);
312}
313
314/** 302/**
315 * hw_test_and_clear_setup_guard: test & clear setup guard (execute without 303 * hw_test_and_clear_setup_guard: test & clear setup guard (execute without
316 * interruption) 304 * interruption)
@@ -377,16 +365,6 @@ static int hw_usb_reset(struct ci13xxx *ci)
377 return 0; 365 return 0;
378} 366}
379 367
380static void vbus_work(struct work_struct *work)
381{
382 struct ci13xxx *ci = container_of(work, struct ci13xxx, vbus_work);
383
384 if (hw_read(ci, OP_OTGSC, OTGSC_AVV))
385 usb_gadget_vbus_connect(&ci->gadget);
386 else
387 usb_gadget_vbus_disconnect(&ci->gadget);
388}
389
390/****************************************************************************** 368/******************************************************************************
391 * UTIL block 369 * UTIL block
392 *****************************************************************************/ 370 *****************************************************************************/
@@ -1386,7 +1364,6 @@ static int ci13xxx_vbus_session(struct usb_gadget *_gadget, int is_active)
1386 if (is_active) { 1364 if (is_active) {
1387 pm_runtime_get_sync(&_gadget->dev); 1365 pm_runtime_get_sync(&_gadget->dev);
1388 hw_device_reset(ci, USBMODE_CM_DC); 1366 hw_device_reset(ci, USBMODE_CM_DC);
1389 hw_enable_vbus_intr(ci);
1390 hw_device_state(ci, ci->ep0out->qh.dma); 1367 hw_device_state(ci, ci->ep0out->qh.dma);
1391 } else { 1368 } else {
1392 hw_device_state(ci, 0); 1369 hw_device_state(ci, 0);
@@ -1561,10 +1538,8 @@ static int ci13xxx_start(struct usb_gadget *gadget,
1561 pm_runtime_get_sync(&ci->gadget.dev); 1538 pm_runtime_get_sync(&ci->gadget.dev);
1562 if (ci->platdata->flags & CI13XXX_PULLUP_ON_VBUS) { 1539 if (ci->platdata->flags & CI13XXX_PULLUP_ON_VBUS) {
1563 if (ci->vbus_active) { 1540 if (ci->vbus_active) {
1564 if (ci->platdata->flags & CI13XXX_REGS_SHARED) { 1541 if (ci->platdata->flags & CI13XXX_REGS_SHARED)
1565 hw_device_reset(ci, USBMODE_CM_DC); 1542 hw_device_reset(ci, USBMODE_CM_DC);
1566 hw_enable_vbus_intr(ci);
1567 }
1568 } else { 1543 } else {
1569 pm_runtime_put_sync(&ci->gadget.dev); 1544 pm_runtime_put_sync(&ci->gadget.dev);
1570 goto done; 1545 goto done;
@@ -1670,13 +1645,6 @@ static irqreturn_t udc_irq(struct ci13xxx *ci)
1670 } else { 1645 } else {
1671 retval = IRQ_NONE; 1646 retval = IRQ_NONE;
1672 } 1647 }
1673
1674 intr = hw_read(ci, OP_OTGSC, ~0);
1675 hw_write(ci, OP_OTGSC, ~0, intr);
1676
1677 if (intr & (OTGSC_AVVIE & OTGSC_AVVIS))
1678 queue_work(ci->wq, &ci->vbus_work);
1679
1680 spin_unlock(&ci->lock); 1648 spin_unlock(&ci->lock);
1681 1649
1682 return retval; 1650 return retval;
@@ -1752,7 +1720,6 @@ static int udc_start(struct ci13xxx *ci)
1752 retval = hw_device_reset(ci, USBMODE_CM_DC); 1720 retval = hw_device_reset(ci, USBMODE_CM_DC);
1753 if (retval) 1721 if (retval)
1754 goto put_transceiver; 1722 goto put_transceiver;
1755 hw_enable_vbus_intr(ci);
1756 } 1723 }
1757 1724
1758 retval = device_register(&ci->gadget.dev); 1725 retval = device_register(&ci->gadget.dev);
@@ -1815,9 +1782,6 @@ static void udc_stop(struct ci13xxx *ci)
1815 if (ci == NULL) 1782 if (ci == NULL)
1816 return; 1783 return;
1817 1784
1818 hw_disable_vbus_intr(ci);
1819 cancel_work_sync(&ci->vbus_work);
1820
1821 usb_del_gadget_udc(&ci->gadget); 1785 usb_del_gadget_udc(&ci->gadget);
1822 1786
1823 destroy_eps(ci); 1787 destroy_eps(ci);
@@ -1858,7 +1822,6 @@ int ci_hdrc_gadget_init(struct ci13xxx *ci)
1858 rdrv->irq = udc_irq; 1822 rdrv->irq = udc_irq;
1859 rdrv->name = "gadget"; 1823 rdrv->name = "gadget";
1860 ci->roles[CI_ROLE_GADGET] = rdrv; 1824 ci->roles[CI_ROLE_GADGET] = rdrv;
1861 INIT_WORK(&ci->vbus_work, vbus_work);
1862 1825
1863 return 0; 1826 return 0;
1864} 1827}