]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
usb: otg-fsm: move 2 otg fsm timers definition to otg_fsm_timer
authorLi Jun <b47624@freescale.com>
Fri, 20 Mar 2015 08:28:05 +0000 (16:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Mar 2015 09:54:39 +0000 (10:54 +0100)
B_DATA_PLS(data-line pulse time) and B_SSEND_SRP(session end to SRP init) are
also from OTG&EH 2.0 Specification and they are not chipidea specific.

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
include/linux/usb/otg-fsm.h

index 3014e2c0ac371d487502eb7f4ba7b55e9a71c61d..ba2cb91cb79010363a24a2c4b18b329720a3b697 100644 (file)
@@ -206,13 +206,13 @@ static struct attribute_group inputs_attr_group = {
 /*
  * Add timer to active timer list
  */
-static void ci_otg_add_timer(struct ci_hdrc *ci, enum ci_otg_fsm_timer_index t)
+static void ci_otg_add_timer(struct ci_hdrc *ci, enum otg_fsm_timer t)
 {
        struct ci_otg_fsm_timer *tmp_timer;
        struct ci_otg_fsm_timer *timer = ci->fsm_timer->timer_list[t];
        struct list_head *active_timers = &ci->fsm_timer->active_timers;
 
-       if (t >= NUM_CI_OTG_FSM_TIMERS)
+       if (t >= NUM_OTG_FSM_TIMERS)
                return;
 
        /*
@@ -239,14 +239,14 @@ static void ci_otg_add_timer(struct ci_hdrc *ci, enum ci_otg_fsm_timer_index t)
 /*
  * Remove timer from active timer list
  */
-static void ci_otg_del_timer(struct ci_hdrc *ci, enum ci_otg_fsm_timer_index t)
+static void ci_otg_del_timer(struct ci_hdrc *ci, enum otg_fsm_timer t)
 {
        struct ci_otg_fsm_timer *tmp_timer, *del_tmp;
        struct ci_otg_fsm_timer *timer = ci->fsm_timer->timer_list[t];
        struct list_head *active_timers = &ci->fsm_timer->active_timers;
        int flag = 0;
 
-       if (t >= NUM_CI_OTG_FSM_TIMERS)
+       if (t >= NUM_OTG_FSM_TIMERS)
                return;
 
        list_for_each_entry_safe(tmp_timer, del_tmp, active_timers, list)
index d0ad4f9ef950e35a89eb4fd59fdc27addc61ff08..9e0fc4c83f13f7b8a36c63de22180fc2089712e6 100644 (file)
 /* SSEND time before SRP */
 #define TB_SSEND_SRP         (1500)    /* minimum 1.5 sec, section:5.1.2 */
 
-enum ci_otg_fsm_timer_index {
-       /*
-        * CI specific timers, start from the end
-        * of standard and auxiliary OTG timers
-        */
-       B_DATA_PLS = NUM_OTG_FSM_TIMERS,
-       B_SSEND_SRP,
-
-       NUM_CI_OTG_FSM_TIMERS,
-};
-
 struct ci_otg_fsm_timer {
        unsigned long expires;  /* Number of count increase to timeout */
        unsigned long count;    /* Tick counter */
@@ -82,7 +71,7 @@ struct ci_otg_fsm_timer {
 };
 
 struct ci_otg_fsm_timer_list {
-       struct ci_otg_fsm_timer *timer_list[NUM_CI_OTG_FSM_TIMERS];
+       struct ci_otg_fsm_timer *timer_list[NUM_OTG_FSM_TIMERS];
        struct list_head active_timers;
 };
 
index b6ba1bfb86f2aa7cfb348bc2e704e48c34796b1b..f728f1854829e01c99663ded8f50973b3e311c80 100644 (file)
@@ -53,6 +53,8 @@ enum otg_fsm_timer {
        B_SE0_SRP,
        B_SRP_FAIL,
        A_WAIT_ENUM,
+       B_DATA_PLS,
+       B_SSEND_SRP,
 
        NUM_OTG_FSM_TIMERS,
 };