aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoic Poulain <loic.poulain@linaro.org>2018-09-04 11:18:58 -0400
committerPeter Chen <peter.chen@nxp.com>2018-09-20 05:04:22 -0400
commit59739131e0ca06db7560f9073fff2fb83f6bc2a5 (patch)
tree74e4108219616ba253ce9bae9181782cb4be560d
parent8b97d73c4d72a2abf58f8e49062a7ee1e5f1334e (diff)
usb: chipidea: Fix otg event handler
At OTG work running time, it's possible that several events need to be addressed (e.g. ID and VBUS events). The current implementation handles only one event at a time which leads to ignoring the other one. Fix it. Signed-off-by: Loic Poulain <loic.poulain@linaro.org> Signed-off-by: Peter Chen <peter.chen@nxp.com>
-rw-r--r--drivers/usb/chipidea/otg.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/usb/chipidea/otg.c b/drivers/usb/chipidea/otg.c
index db4ceffcf2a6..f25d4827fd49 100644
--- a/drivers/usb/chipidea/otg.c
+++ b/drivers/usb/chipidea/otg.c
@@ -203,14 +203,17 @@ static void ci_otg_work(struct work_struct *work)
203 } 203 }
204 204
205 pm_runtime_get_sync(ci->dev); 205 pm_runtime_get_sync(ci->dev);
206
206 if (ci->id_event) { 207 if (ci->id_event) {
207 ci->id_event = false; 208 ci->id_event = false;
208 ci_handle_id_switch(ci); 209 ci_handle_id_switch(ci);
209 } else if (ci->b_sess_valid_event) { 210 }
211
212 if (ci->b_sess_valid_event) {
210 ci->b_sess_valid_event = false; 213 ci->b_sess_valid_event = false;
211 ci_handle_vbus_change(ci); 214 ci_handle_vbus_change(ci);
212 } else 215 }
213 dev_err(ci->dev, "unexpected event occurs at %s\n", __func__); 216
214 pm_runtime_put_sync(ci->dev); 217 pm_runtime_put_sync(ci->dev);
215 218
216 enable_irq(ci->irq); 219 enable_irq(ci->irq);