Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280888
b: refs/heads/master
c: 309d6d2
h: refs/heads/master
v: v3
  • Loading branch information
Neil Zhang authored and Felipe Balbi committed Dec 12, 2011
1 parent 6744eb0 commit df9e3b0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 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: 487d54d172b3afd3d2bf124b24eaf7f7e7b8a668
refs/heads/master: 309d6d2be42c895c424a5090fcc2e95ce2d8499a
3 changes: 2 additions & 1 deletion trunk/drivers/usb/gadget/mv_udc.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ struct mv_udc {
softconnected:1,
force_fs:1,
clock_gating:1,
active:1;
active:1,
stopped:1; /* stop bit is setted */

struct work_struct vbus_work;
struct workqueue_struct *qwork;
Expand Down
8 changes: 8 additions & 0 deletions trunk/drivers/usb/gadget/mv_udc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,8 @@ static void udc_stop(struct mv_udc *udc)
USBINTR_PORT_CHANGE_DETECT_EN | USBINTR_RESET_EN);
writel(tmp, &udc->op_regs->usbintr);

udc->stopped = 1;

/* Reset the Run the bit in the command register to stop VUSB */
tmp = readl(&udc->op_regs->usbcmd);
tmp &= ~USBCMD_RUN_STOP;
Expand All @@ -1072,6 +1074,8 @@ static void udc_start(struct mv_udc *udc)
/* Enable interrupts */
writel(usbintr, &udc->op_regs->usbintr);

udc->stopped = 0;

/* Set the Run bit in the command register */
writel(USBCMD_RUN_STOP, &udc->op_regs->usbcmd);
}
Expand Down Expand Up @@ -2040,6 +2044,10 @@ static irqreturn_t mv_udc_irq(int irq, void *dev)
struct mv_udc *udc = (struct mv_udc *)dev;
u32 status, intr;

/* Disable ISR when stopped bit is set */
if (udc->stopped)
return IRQ_NONE;

spin_lock(&udc->lock);

status = readl(&udc->op_regs->usbsts);
Expand Down

0 comments on commit df9e3b0

Please sign in to comment.