usb: chipidea: otg: remove unnecessary B_SESS_VLD timer
authorLi Jun <b47624@freescale.com>
Fri, 20 Mar 2015 08:28:04 +0000 (16:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Mar 2015 09:54:01 +0000 (10:54 +0100)
Since BSV irq is enabled for B-device all the time, so B_SESS_VLD timer
is not required, and also no need to check BSV status when B_ASE0_BRST
timer timeout.

Signed-off-by: Li Jun <jun.li@freescale.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/chipidea/otg_fsm.c
drivers/usb/chipidea/otg_fsm.h

index e3cf5be66d3de869f21fc5a8768d4e204dd4360e..3014e2c0ac371d487502eb7f4ba7b55e9a71c61d 100644 (file)
@@ -320,17 +320,6 @@ static void a_wait_vfall_tmout_func(void *ptr, unsigned long indicator)
        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;
@@ -342,18 +331,6 @@ static void b_ssend_srp_tmout_func(void *ptr, unsigned long indicator)
                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;
@@ -405,7 +382,7 @@ static int ci_otg_init_timers(struct ci_hdrc *ci)
                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;
@@ -433,11 +410,6 @@ static int ci_otg_init_timers(struct ci_hdrc *ci)
        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;
 }
 
@@ -671,7 +643,6 @@ static void ci_otg_fsm_event(struct ci_hdrc *ci)
                        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:
index 94c085f456a9cdc999697df7266b9261fac665a7..d0ad4f9ef950e35a89eb4fd59fdc27addc61ff08 100644 (file)
@@ -62,8 +62,6 @@
 /* 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
@@ -71,7 +69,6 @@ enum ci_otg_fsm_timer_index {
         */
        B_DATA_PLS = NUM_OTG_FSM_TIMERS,
        B_SSEND_SRP,
-       B_SESS_VLD,
 
        NUM_CI_OTG_FSM_TIMERS,
 };