ci_otg_queue_work(ci);
}
-static void b_ase0_brst_tmout_func(void *ptr, unsigned long indicator)
-{
- struct ci_hdrc *ci = (struct ci_hdrc *)ptr;
-
- set_tmout(ci, indicator);
- if (!hw_read_otgsc(ci, OTGSC_BSV))
- ci->fsm.b_sess_vld = 0;
-
- ci_otg_queue_work(ci);
-}
-
static void b_ssend_srp_tmout_func(void *ptr, unsigned long indicator)
{
struct ci_hdrc *ci = (struct ci_hdrc *)ptr;
ci_otg_queue_work(ci);
}
-static void b_sess_vld_tmout_func(void *ptr, unsigned long indicator)
-{
- struct ci_hdrc *ci = (struct ci_hdrc *)ptr;
-
- /* Check if A detached */
- if (!(hw_read_otgsc(ci, OTGSC_BSV))) {
- ci->fsm.b_sess_vld = 0;
- ci_otg_add_timer(ci, B_SSEND_SRP);
- ci_otg_queue_work(ci);
- }
-}
-
static void b_data_pulse_end(void *ptr, unsigned long indicator)
{
struct ci_hdrc *ci = (struct ci_hdrc *)ptr;
return -ENOMEM;
ci->fsm_timer->timer_list[B_ASE0_BRST] =
- otg_timer_initializer(ci, &b_ase0_brst_tmout_func, TB_ASE0_BRST,
+ otg_timer_initializer(ci, &set_tmout_and_fsm, TB_ASE0_BRST,
(unsigned long)&fsm->b_ase0_brst_tmout);
if (ci->fsm_timer->timer_list[B_ASE0_BRST] == NULL)
return -ENOMEM;
if (ci->fsm_timer->timer_list[B_DATA_PLS] == NULL)
return -ENOMEM;
- ci->fsm_timer->timer_list[B_SESS_VLD] = otg_timer_initializer(ci,
- &b_sess_vld_tmout_func, TB_SESS_VLD, 0);
- if (ci->fsm_timer->timer_list[B_SESS_VLD] == NULL)
- return -ENOMEM;
-
return 0;
}
fsm->a_conn = 0;
fsm->b_bus_req = 0;
ci_otg_queue_work(ci);
- ci_otg_add_timer(ci, B_SESS_VLD);
}
break;
case OTG_STATE_A_PERIPHERAL:
/* SSEND time before SRP */
#define TB_SSEND_SRP (1500) /* minimum 1.5 sec, section:5.1.2 */
-#define TB_SESS_VLD (1000)
-
enum ci_otg_fsm_timer_index {
/*
* CI specific timers, start from the end
*/
B_DATA_PLS = NUM_OTG_FSM_TIMERS,
B_SSEND_SRP,
- B_SESS_VLD,
NUM_CI_OTG_FSM_TIMERS,
};