diff options
-rw-r--r-- | drivers/usb/renesas_usbhs/mod.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/drivers/usb/renesas_usbhs/mod.c b/drivers/usb/renesas_usbhs/mod.c index 73604a1d6843..d0f5f67e0749 100644 --- a/drivers/usb/renesas_usbhs/mod.c +++ b/drivers/usb/renesas_usbhs/mod.c | |||
@@ -179,15 +179,17 @@ static void usbhs_status_get_each_irq(struct usbhs_priv *priv, | |||
179 | state->intsts0 = usbhs_read(priv, INTSTS0); | 179 | state->intsts0 = usbhs_read(priv, INTSTS0); |
180 | state->intsts1 = usbhs_read(priv, INTSTS1); | 180 | state->intsts1 = usbhs_read(priv, INTSTS1); |
181 | 181 | ||
182 | state->brdysts = usbhs_read(priv, BRDYSTS); | ||
183 | state->nrdysts = usbhs_read(priv, NRDYSTS); | ||
184 | state->bempsts = usbhs_read(priv, BEMPSTS); | ||
185 | |||
186 | state->dvstctr = usbhs_read(priv, DVSTCTR); | 182 | state->dvstctr = usbhs_read(priv, DVSTCTR); |
187 | 183 | ||
188 | /* mask */ | 184 | /* mask */ |
189 | state->bempsts &= mod->irq_bempsts; | 185 | if (mod) { |
190 | state->brdysts &= mod->irq_brdysts; | 186 | state->brdysts = usbhs_read(priv, BRDYSTS); |
187 | state->nrdysts = usbhs_read(priv, NRDYSTS); | ||
188 | state->bempsts = usbhs_read(priv, BEMPSTS); | ||
189 | |||
190 | state->bempsts &= mod->irq_bempsts; | ||
191 | state->brdysts &= mod->irq_brdysts; | ||
192 | } | ||
191 | } | 193 | } |
192 | 194 | ||
193 | /* | 195 | /* |
@@ -259,17 +261,19 @@ void usbhs_irq_callback_update(struct usbhs_priv *priv, struct usbhs_mod *mod) | |||
259 | * but "mod->irq_dev_state" will be called. | 261 | * but "mod->irq_dev_state" will be called. |
260 | */ | 262 | */ |
261 | 263 | ||
262 | if (mod->irq_ctrl_stage) | 264 | if (mod) { |
263 | intenb0 |= CTRE; | 265 | if (mod->irq_ctrl_stage) |
266 | intenb0 |= CTRE; | ||
264 | 267 | ||
265 | if (mod->irq_empty && mod->irq_bempsts) { | 268 | if (mod->irq_empty && mod->irq_bempsts) { |
266 | usbhs_write(priv, BEMPENB, mod->irq_bempsts); | 269 | usbhs_write(priv, BEMPENB, mod->irq_bempsts); |
267 | intenb0 |= BEMPE; | 270 | intenb0 |= BEMPE; |
268 | } | 271 | } |
269 | 272 | ||
270 | if (mod->irq_ready && mod->irq_brdysts) { | 273 | if (mod->irq_ready && mod->irq_brdysts) { |
271 | usbhs_write(priv, BRDYENB, mod->irq_brdysts); | 274 | usbhs_write(priv, BRDYENB, mod->irq_brdysts); |
272 | intenb0 |= BRDYE; | 275 | intenb0 |= BRDYE; |
276 | } | ||
273 | } | 277 | } |
274 | 278 | ||
275 | usbhs_write(priv, INTENB0, intenb0); | 279 | usbhs_write(priv, INTENB0, intenb0); |