]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ENGR00331016-4 usb: chipidea: otg: remove unnecessary b_sess_vld tracking
authorLi Jun <B47624@freescale.com>
Wed, 17 Sep 2014 07:05:24 +0000 (15:05 +0800)
committerLi Jun <jun.li@freescale.com>
Wed, 28 Jan 2015 03:08:36 +0000 (11:08 +0800)
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.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit a7d0b864b613c555add9ea864eb8c163e1d3362e)

drivers/usb/chipidea/otg_fsm.c
drivers/usb/chipidea/otg_fsm.h

index 04cdecec867201541c987ba270c94ecfaf444619..748942e3b09b324f8801af7948231ac4e87ca150 100644 (file)
@@ -333,17 +333,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;
@@ -355,18 +344,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;
@@ -449,7 +426,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;
@@ -477,11 +454,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;
-
        ci->fsm_timer->timer_list[A_DP_END] = otg_timer_initializer(ci,
                                &a_wait_dp_end_tmout_func, TA_DP_END, 0);
        if (ci->fsm_timer->timer_list[A_DP_END] == NULL)
@@ -750,7 +722,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 85e17e3c2491e2e384675b09859359a40f863d62..e71fb7a9336c393720999b2f44b5b81b2a8ff763 100644 (file)
@@ -63,8 +63,6 @@
 /* SSEND time before SRP */
 #define TB_SSEND_SRP         (1500)    /* minimum 1.5 sec, section:5.1.2 */
 
-#define TB_SESS_VLD          (1000)
-
 #define T_HOST_REQ_POLL      (1500)    /* HNP polling interval 1s~2s */
 
 enum ci_otg_fsm_timer_index {
@@ -74,7 +72,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,
 };