Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325881
b: refs/heads/master
c: 4e17726
h: refs/heads/master
i:
  325879: 2596fd6
v: v3
  • Loading branch information
Shimoda, Yoshihiro authored and Felipe Balbi committed Aug 23, 2012
1 parent 996b170 commit f4c9004
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 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: 8c7ca99250de69dfe97c5f4f6e2eb11dc6145779
refs/heads/master: 4e177260e547e438c78c60b6db6f755bb89e0596
25 changes: 22 additions & 3 deletions trunk/drivers/usb/renesas_usbhs/mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,18 @@ int usbhs_status_get_ctrl_stage(struct usbhs_irq_state *irq_state)
return (int)irq_state->intsts0 & CTSQ_MASK;
}

static void usbhs_status_get_each_irq(struct usbhs_priv *priv,
struct usbhs_irq_state *state)
static int usbhs_status_get_each_irq(struct usbhs_priv *priv,
struct usbhs_irq_state *state)
{
struct usbhs_mod *mod = usbhs_mod_get_current(priv);
u16 intenb0, intenb1;

state->intsts0 = usbhs_read(priv, INTSTS0);
state->intsts1 = usbhs_read(priv, INTSTS1);

intenb0 = usbhs_read(priv, INTENB0);
intenb1 = usbhs_read(priv, INTENB1);

/* mask */
if (mod) {
state->brdysts = usbhs_read(priv, BRDYSTS);
Expand All @@ -226,6 +230,20 @@ static void usbhs_status_get_each_irq(struct usbhs_priv *priv,
state->bempsts &= mod->irq_bempsts;
state->brdysts &= mod->irq_brdysts;
}

/*
* Check whether the irq enable registers and the irq status are set
* when IRQF_SHARED is set.
*/
if (priv->irqflags & IRQF_SHARED) {
if (!(intenb0 & state->intsts0) &&
!(intenb1 & state->intsts1) &&
!(state->bempsts) &&
!(state->brdysts))
return -EIO;
}

return 0;
}

/*
Expand All @@ -238,7 +256,8 @@ static irqreturn_t usbhs_interrupt(int irq, void *data)
struct usbhs_priv *priv = data;
struct usbhs_irq_state irq_state;

usbhs_status_get_each_irq(priv, &irq_state);
if (usbhs_status_get_each_irq(priv, &irq_state) < 0)
return IRQ_NONE;

/*
* clear interrupt
Expand Down

0 comments on commit f4c9004

Please sign in to comment.