MLK-9617-17 usb: common: otg: clear b_bus_req in b_peripheral state
authorLi Jun <B47624@freescale.com>
Thu, 16 Oct 2014 14:17:54 +0000 (22:17 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:47:14 +0000 (14:47 -0500)
This patch is clearing b_bus_req input to be 0 when entering b_peripheral state.
b_bus_req is only TRUE when b device wants to use the bus and switch to be host
role.

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit eb610e73aa38bbb45aed6a79265cd79fe80cdd05)
(cherry picked from commit 427b0f80a51c50629131090c6f8b82d747fb7d24)

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

index e25bc07..7db965f 100644 (file)
@@ -269,6 +269,7 @@ static int otg_set_state(struct otg_fsm *fsm, enum usb_otg_state new_state)
                otg_loc_sof(fsm, 0);
                otg_set_protocol(fsm, PROTO_GADGET);
                otg_loc_conn(fsm, 1);
+               fsm->b_bus_req = 0;
                break;
        case OTG_STATE_B_WAIT_ACON:
                otg_chrg_vbus(fsm, 0);