MLK-9606-3 usb: otg: test: remove test maintain timer if HNP happens
authorLi Jun <B47624@freescale.com>
Wed, 24 Sep 2014 06:17:29 +0000 (14:17 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:47:10 +0000 (14:47 -0500)
If B device set host request flag before test maintain timer expires, remove
the timer and clear test maintain session flag, do HNP as a normal OTG device.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit d914c80921652419037d935f14545fe87f74a71c)
(cherry picked from commit 243c0fcf492748219f4c581203b9bccb078a61d8)

drivers/usb/common/usb-otg-fsm.c

index 2f537bb..3478b16 100644 (file)
@@ -183,6 +183,11 @@ static void otg_hnp_polling_work(struct work_struct *work)
                                fsm->otg->host->b_hnp_enable = 1;
                }
                fsm->a_bus_req = 0;
+               if (fsm->tst_maint) {
+                       fsm->tst_maint = 0;
+                       fsm->otg_vbus_off = 0;
+                       otg_del_timer(fsm, A_TST_MAINT);
+               }
        } else if (state == OTG_STATE_B_HOST) {
                fsm->b_bus_req = 0;
        }