TB_SSEND_SRP,
TA_DP_END,
TA_TST_MAINT,
+ TB_SRP_REQD,
0,
};
return 0;
}
+/*
+ * otg_srp_reqd feature
+ * After A(PET) turn off vbus, B(UUT) should start this timer to do SRP
+ * when the timer expires.
+ */
+static int b_srp_reqd_tmout(struct ci_hdrc *ci)
+{
+ ci->fsm.otg_srp_reqd = 0;
+ if (ci->fsm.otg->state == OTG_STATE_B_IDLE) {
+ ci->fsm.b_bus_req = 1;
+ return 0;
+ }
+ return 1;
+}
+
/*
* Keep this list in the same order as timers indexed
* by enum otg_fsm_timer in include/linux/usb/otg-fsm.h
b_ssend_srp_tmout, /* B_SSEND_SRP */
a_dp_end_tmout, /* A_DP_END */
a_tst_maint_tmout, /* A_TST_MAINT */
+ b_srp_reqd_tmout, /* B_SRP_REQD */
NULL, /* HNP_POLLING */
};
ci_otg_add_timer(ci, B_SSEND_SRP);
if (fsm->b_bus_req)
fsm->b_bus_req = 0;
+ if (fsm->otg_srp_reqd)
+ ci_otg_add_timer(ci, B_SRP_REQD);
} else {
ci->vbus_glitch_check_event = true;
}
#define TB_SSEND_SRP (1500) /* minimum 1.5 sec, section:5.1.2 */
#define TB_AIDL_BDIS (20) /* 4ms ~ 150ms, section 5.2.1 */
+#define TB_SRP_REQD (2000) /* For otg_srp_reqd to start data
+ * pulse after A(PET) turn off v-bus
+ */
#if IS_ENABLED(CONFIG_USB_OTG_FSM)