aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLi Jun <b47624@freescale.com>2015-03-20 04:28:05 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-26 05:54:39 -0400
commit2f8a467a11aeec61f5077cd337b4efe74847e1d3 (patch)
tree3fe6e54a4d9427d54f65e0416916cbc98df6a396
parent01ecd156905f6bbfe4f5bd278325071f9141726d (diff)
usb: otg-fsm: move 2 otg fsm timers definition to otg_fsm_timer
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>
-rw-r--r--drivers/usb/chipidea/otg_fsm.c8
-rw-r--r--drivers/usb/chipidea/otg_fsm.h13
-rw-r--r--include/linux/usb/otg-fsm.h2
3 files changed, 7 insertions, 16 deletions
diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c
index 3014e2c0ac37..ba2cb91cb790 100644
--- a/drivers/usb/chipidea/otg_fsm.c
+++ b/drivers/usb/chipidea/otg_fsm.c
@@ -206,13 +206,13 @@ static struct attribute_group inputs_attr_group = {
206/* 206/*
207 * Add timer to active timer list 207 * Add timer to active timer list
208 */ 208 */
209static void ci_otg_add_timer(struct ci_hdrc *ci, enum ci_otg_fsm_timer_index t) 209static void ci_otg_add_timer(struct ci_hdrc *ci, enum otg_fsm_timer t)
210{ 210{
211 struct ci_otg_fsm_timer *tmp_timer; 211 struct ci_otg_fsm_timer *tmp_timer;
212 struct ci_otg_fsm_timer *timer = ci->fsm_timer->timer_list[t]; 212 struct ci_otg_fsm_timer *timer = ci->fsm_timer->timer_list[t];
213 struct list_head *active_timers = &ci->fsm_timer->active_timers; 213 struct list_head *active_timers = &ci->fsm_timer->active_timers;
214 214
215 if (t >= NUM_CI_OTG_FSM_TIMERS) 215 if (t >= NUM_OTG_FSM_TIMERS)
216 return; 216 return;
217 217
218 /* 218 /*
@@ -239,14 +239,14 @@ static void ci_otg_add_timer(struct ci_hdrc *ci, enum ci_otg_fsm_timer_index t)
239/* 239/*
240 * Remove timer from active timer list 240 * Remove timer from active timer list
241 */ 241 */
242static void ci_otg_del_timer(struct ci_hdrc *ci, enum ci_otg_fsm_timer_index t) 242static void ci_otg_del_timer(struct ci_hdrc *ci, enum otg_fsm_timer t)
243{ 243{
244 struct ci_otg_fsm_timer *tmp_timer, *del_tmp; 244 struct ci_otg_fsm_timer *tmp_timer, *del_tmp;
245 struct ci_otg_fsm_timer *timer = ci->fsm_timer->timer_list[t]; 245 struct ci_otg_fsm_timer *timer = ci->fsm_timer->timer_list[t];
246 struct list_head *active_timers = &ci->fsm_timer->active_timers; 246 struct list_head *active_timers = &ci->fsm_timer->active_timers;
247 int flag = 0; 247 int flag = 0;
248 248
249 if (t >= NUM_CI_OTG_FSM_TIMERS) 249 if (t >= NUM_OTG_FSM_TIMERS)
250 return; 250 return;
251 251
252 list_for_each_entry_safe(tmp_timer, del_tmp, active_timers, list) 252 list_for_each_entry_safe(tmp_timer, del_tmp, active_timers, list)
diff --git a/drivers/usb/chipidea/otg_fsm.h b/drivers/usb/chipidea/otg_fsm.h
index d0ad4f9ef950..9e0fc4c83f13 100644
--- a/drivers/usb/chipidea/otg_fsm.h
+++ b/drivers/usb/chipidea/otg_fsm.h
@@ -62,17 +62,6 @@
62/* SSEND time before SRP */ 62/* SSEND time before SRP */
63#define TB_SSEND_SRP (1500) /* minimum 1.5 sec, section:5.1.2 */ 63#define TB_SSEND_SRP (1500) /* minimum 1.5 sec, section:5.1.2 */
64 64
65enum ci_otg_fsm_timer_index {
66 /*
67 * CI specific timers, start from the end
68 * of standard and auxiliary OTG timers
69 */
70 B_DATA_PLS = NUM_OTG_FSM_TIMERS,
71 B_SSEND_SRP,
72
73 NUM_CI_OTG_FSM_TIMERS,
74};
75
76struct ci_otg_fsm_timer { 65struct ci_otg_fsm_timer {
77 unsigned long expires; /* Number of count increase to timeout */ 66 unsigned long expires; /* Number of count increase to timeout */
78 unsigned long count; /* Tick counter */ 67 unsigned long count; /* Tick counter */
@@ -82,7 +71,7 @@ struct ci_otg_fsm_timer {
82}; 71};
83 72
84struct ci_otg_fsm_timer_list { 73struct ci_otg_fsm_timer_list {
85 struct ci_otg_fsm_timer *timer_list[NUM_CI_OTG_FSM_TIMERS]; 74 struct ci_otg_fsm_timer *timer_list[NUM_OTG_FSM_TIMERS];
86 struct list_head active_timers; 75 struct list_head active_timers;
87}; 76};
88 77
diff --git a/include/linux/usb/otg-fsm.h b/include/linux/usb/otg-fsm.h
index b6ba1bfb86f2..f728f1854829 100644
--- a/include/linux/usb/otg-fsm.h
+++ b/include/linux/usb/otg-fsm.h
@@ -53,6 +53,8 @@ enum otg_fsm_timer {
53 B_SE0_SRP, 53 B_SE0_SRP,
54 B_SRP_FAIL, 54 B_SRP_FAIL,
55 A_WAIT_ENUM, 55 A_WAIT_ENUM,
56 B_DATA_PLS,
57 B_SSEND_SRP,
56 58
57 NUM_OTG_FSM_TIMERS, 59 NUM_OTG_FSM_TIMERS,
58}; 60};