usb: phy: fsm: update OTG HNP state transition
authorLi Jun <B47624@freescale.com>
Thu, 13 Mar 2014 07:22:50 +0000 (15:22 +0800)
committerFelipe Balbi <balbi@ti.com>
Thu, 24 Apr 2014 14:53:57 +0000 (09:53 -0500)
According to:"On-The-Go and Embedded Host Supplement to the USB Revision 2.0
Specification July 27, 2012 Revision 2.0 version 1.1a"

- add a_wait_vrise to a_wait_vfall
- update condition from a_wait_vrise to a_wait_bcon

Signed-off-by: Li Jun <b47624@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/phy/phy-fsm-usb.c

index c47e5a6edde28a1d35d64d6f375df401a8519709..731b4a5d6639da129c5e99476f33e1f7266c70b1 100644 (file)
@@ -303,10 +303,11 @@ int otg_statemachine(struct otg_fsm *fsm)
                        otg_set_state(fsm, OTG_STATE_A_WAIT_VRISE);
                break;
        case OTG_STATE_A_WAIT_VRISE:
-               if (fsm->id || fsm->a_bus_drop || fsm->a_vbus_vld ||
-                               fsm->a_wait_vrise_tmout) {
+               if (fsm->a_vbus_vld)
                        otg_set_state(fsm, OTG_STATE_A_WAIT_BCON);
-               }
+               else if (fsm->id || fsm->a_bus_drop ||
+                               fsm->a_wait_vrise_tmout)
+                       otg_set_state(fsm, OTG_STATE_A_WAIT_VFALL);
                break;
        case OTG_STATE_A_WAIT_BCON:
                if (!fsm->a_vbus_vld)