Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364491
b: refs/heads/master
c: 571bb7a
h: refs/heads/master
i:
  364489: b9985fe
  364487: 4a51522
v: v3
  • Loading branch information
Peter Chen authored and Greg Kroah-Hartman committed Mar 30, 2013
1 parent 8ea509e commit 6c2a94c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 40 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 19290816c5fa3f289465d24bfbac9d669cc2f061
refs/heads/master: 571bb7abac4ed02cf7d5094b4a04a8bdca3783ed
1 change: 0 additions & 1 deletion trunk/drivers/usb/chipidea/ci.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ struct ci13xxx {
enum ci_role role;
bool is_otg;
struct work_struct work;
struct work_struct vbus_work;
struct workqueue_struct *wq;

struct dma_pool *qh_pool;
Expand Down
39 changes: 1 addition & 38 deletions trunk/drivers/usb/chipidea/udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,18 +299,6 @@ static u32 hw_test_and_clear_intr_active(struct ci13xxx *ci)
return reg;
}

static void hw_enable_vbus_intr(struct ci13xxx *ci)
{
hw_write(ci, OP_OTGSC, OTGSC_AVVIS, OTGSC_AVVIS);
hw_write(ci, OP_OTGSC, OTGSC_AVVIE, OTGSC_AVVIE);
queue_work(ci->wq, &ci->vbus_work);
}

static void hw_disable_vbus_intr(struct ci13xxx *ci)
{
hw_write(ci, OP_OTGSC, OTGSC_AVVIE, 0);
}

/**
* hw_test_and_clear_setup_guard: test & clear setup guard (execute without
* interruption)
Expand Down Expand Up @@ -377,16 +365,6 @@ static int hw_usb_reset(struct ci13xxx *ci)
return 0;
}

static void vbus_work(struct work_struct *work)
{
struct ci13xxx *ci = container_of(work, struct ci13xxx, vbus_work);

if (hw_read(ci, OP_OTGSC, OTGSC_AVV))
usb_gadget_vbus_connect(&ci->gadget);
else
usb_gadget_vbus_disconnect(&ci->gadget);
}

/******************************************************************************
* UTIL block
*****************************************************************************/
Expand Down Expand Up @@ -1386,7 +1364,6 @@ static int ci13xxx_vbus_session(struct usb_gadget *_gadget, int is_active)
if (is_active) {
pm_runtime_get_sync(&_gadget->dev);
hw_device_reset(ci, USBMODE_CM_DC);
hw_enable_vbus_intr(ci);
hw_device_state(ci, ci->ep0out->qh.dma);
} else {
hw_device_state(ci, 0);
Expand Down Expand Up @@ -1561,10 +1538,8 @@ static int ci13xxx_start(struct usb_gadget *gadget,
pm_runtime_get_sync(&ci->gadget.dev);
if (ci->platdata->flags & CI13XXX_PULLUP_ON_VBUS) {
if (ci->vbus_active) {
if (ci->platdata->flags & CI13XXX_REGS_SHARED) {
if (ci->platdata->flags & CI13XXX_REGS_SHARED)
hw_device_reset(ci, USBMODE_CM_DC);
hw_enable_vbus_intr(ci);
}
} else {
pm_runtime_put_sync(&ci->gadget.dev);
goto done;
Expand Down Expand Up @@ -1670,13 +1645,6 @@ static irqreturn_t udc_irq(struct ci13xxx *ci)
} else {
retval = IRQ_NONE;
}

intr = hw_read(ci, OP_OTGSC, ~0);
hw_write(ci, OP_OTGSC, ~0, intr);

if (intr & (OTGSC_AVVIE & OTGSC_AVVIS))
queue_work(ci->wq, &ci->vbus_work);

spin_unlock(&ci->lock);

return retval;
Expand Down Expand Up @@ -1752,7 +1720,6 @@ static int udc_start(struct ci13xxx *ci)
retval = hw_device_reset(ci, USBMODE_CM_DC);
if (retval)
goto put_transceiver;
hw_enable_vbus_intr(ci);
}

retval = device_register(&ci->gadget.dev);
Expand Down Expand Up @@ -1815,9 +1782,6 @@ static void udc_stop(struct ci13xxx *ci)
if (ci == NULL)
return;

hw_disable_vbus_intr(ci);
cancel_work_sync(&ci->vbus_work);

usb_del_gadget_udc(&ci->gadget);

destroy_eps(ci);
Expand Down Expand Up @@ -1858,7 +1822,6 @@ int ci_hdrc_gadget_init(struct ci13xxx *ci)
rdrv->irq = udc_irq;
rdrv->name = "gadget";
ci->roles[CI_ROLE_GADGET] = rdrv;
INIT_WORK(&ci->vbus_work, vbus_work);

return 0;
}

0 comments on commit 6c2a94c

Please sign in to comment.