This patch clears otg_hnp_reqd feature related flags when the HNP test ends.
There are two otg fsm paths to end this feature request:
- b_peripheral --> b_wait_acon --> b_idle: we clear them when entering b_idle;
- b_peripheral --> b_wait_acon --> b_host --> b_peripheral : we clear them
when leaving b_host.
Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit
39d25f04ed047e15f23b44e8465ce46257547df7)
(cherry picked from commit
f92c4e5794a278946d3f4e7c8bc30e3e43a80c28)
fsm->b_ase0_brst_tmout = 0;
break;
case OTG_STATE_B_HOST:
+ if (fsm->otg_hnp_reqd) {
+ fsm->otg_hnp_reqd = 0;
+ fsm->b_bus_req = 0;
+ }
break;
case OTG_STATE_A_IDLE:
fsm->adp_prb = 0;
otg_start_adp_sns(fsm);
otg_set_protocol(fsm, PROTO_UNDEF);
otg_add_timer(fsm, B_SE0_SRP);
+ if (fsm->otg_hnp_reqd) {
+ fsm->otg_hnp_reqd = 0;
+ fsm->b_bus_req = 0;
+ }
break;
case OTG_STATE_B_SRP_INIT:
otg_start_pulse(fsm);