Skip to content

Commit

Permalink
dwc2xx-hcd: tidy up interrupt handler
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Arlott <sa.me.uk>
  • Loading branch information
nomis committed Jun 3, 2012
1 parent f14aab6 commit 2853e38
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 44 deletions.
50 changes: 7 additions & 43 deletions drivers/usb/host/dwc2xx-hcd.c
Expand Up @@ -149,17 +149,14 @@ static irqreturn_t dwc2xx_hcd_irq(struct usb_hcd *hcd)
status &= mask;
dev_dbg(dwc->dev, "%s: status = %08x\n", __func__, status);

if (status & DWC_CURRENT_MODE_INT)
dev_warn(dwc->dev, "%s: DWC_CURRENT_MODE_INT\n", __func__);

if (status & DWC_MODE_MISMATCH_INT)
dev_warn(dwc->dev, "%s: DWC_MODE_MISMATCH_INT\n", __func__);

if (status & DWC_OTG_INT)
dev_warn(dwc->dev, "%s: DWC_OTG_INT\n", __func__);
if (status & DWC_MODE_MISMATCH_INT) {
dev_emerg(dwc->dev, "%s: OTG USB mode mismatch\n", __func__);
/* We could turn off the power? */
handled |= DWC_MODE_MISMATCH_INT;
}

if (status & DWC_SOF_INT)
dev_warn(dwc->dev, "%s: DWC_SOF_INT\n", __func__);
if (status & DWC_DMA_SOF_INT)
dev_warn(dwc->dev, "%s: DWC_DMA_SOF_INT\n", __func__);

if (status & DWC_RX_STAT_LEVEL_INT) {
dev_dbg(dwc->dev, "%s: DWC_RX_STAT_LEVEL_INT\n", __func__);
Expand Down Expand Up @@ -188,12 +185,6 @@ static irqreturn_t dwc2xx_hcd_irq(struct usb_hcd *hcd)
if (status & DWC_EARLY_SUSPEND_INT)
dev_warn(dwc->dev, "%s: DWC_EARLY_SUSPEND_INT\n", __func__);

if (status & DWC_USB_SUSPEND_INT) {
dev_dbg(dwc->dev, "%s: DWC_USB_SUSPEND_INT\n", __func__);
/* TODO */
handled |= DWC_USB_SUSPEND_INT;
}

if (status & DWC_USB_RESET_INT)
dev_warn(dwc->dev, "%s: DWC_USB_RESET_INT\n", __func__);

Expand Down Expand Up @@ -270,33 +261,6 @@ static irqreturn_t dwc2xx_hcd_irq(struct usb_hcd *hcd)
handled |= DWC_HP_TX_FIFO_EMPTY_INT;
}

if (status & DWC_LPM_TXN_RCVD_INT)
dev_warn(dwc->dev, "%s: DWC_LPM_TXN_RCVD_INT\n", __func__);

if (status & DWC_CON_ID_STAT_CHG_INT) {
dev_dbg(dwc->dev, "%s: DWC_CON_ID_STAT_CHG_INT\n", __func__);
/* TODO */
handled |= DWC_CON_ID_STAT_CHG_INT;
}

if (status & DWC_DISCONNECT_INT) {
dev_dbg(dwc->dev, "%s: DWC_DISCONNECT_INT\n", __func__);
/* TODO */
handled |= DWC_DISCONNECT_INT;
}

if (status & DWC_SESS_REQ_INT) {
dev_dbg(dwc->dev, "%s: DWC_SESS_REQ_INT\n", __func__);
/* TODO */
handled |= DWC_SESS_REQ_INT;
}

if (status & DWC_WAKEUP_INT) {
dev_dbg(dwc->dev, "%s: DWC_WAKEUP_INT\n", __func__);
/* TODO */
handled |= DWC_WAKEUP_INT;
}

writel(handled, hcd->regs + DWC_CORE_INT_STAT_REG);
if (status & handled) {
dev_warn(dwc->dev, "%s: IRQ_NONE %08x\n", __func__,
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/dwc2xx-hcd.h
Expand Up @@ -407,7 +407,7 @@ enum dwc2xx_hcd_core_int {
DWC_CURRENT_MODE_INT = BIT(0),
DWC_MODE_MISMATCH_INT = BIT(1),
DWC_OTG_INT = BIT(2),
DWC_SOF_INT = BIT(3),
DWC_DMA_SOF_INT = BIT(3),
DWC_RX_STAT_LEVEL_INT = BIT(4),
DWC_NP_TX_FIFO_EMPTY_INT = BIT(5),
DWC_GINNAKEFF_INT = BIT(6), /* TODO: rename */
Expand Down

0 comments on commit 2853e38

Please sign in to comment.