Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Li Jun and committed by
Greg Kroah-Hartman
2f8a467a 01ecd156

+7 -16
+4 -4
drivers/usb/chipidea/otg_fsm.c
··· 206 206 /* 207 207 * Add timer to active timer list 208 208 */ 209 - static void ci_otg_add_timer(struct ci_hdrc *ci, enum ci_otg_fsm_timer_index t) 209 + static void ci_otg_add_timer(struct ci_hdrc *ci, enum otg_fsm_timer t) 210 210 { 211 211 struct ci_otg_fsm_timer *tmp_timer; 212 212 struct ci_otg_fsm_timer *timer = ci->fsm_timer->timer_list[t]; 213 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 216 return; 217 217 218 218 /* ··· 239 239 /* 240 240 * Remove timer from active timer list 241 241 */ 242 - static void ci_otg_del_timer(struct ci_hdrc *ci, enum ci_otg_fsm_timer_index t) 242 + static void ci_otg_del_timer(struct ci_hdrc *ci, enum otg_fsm_timer t) 243 243 { 244 244 struct ci_otg_fsm_timer *tmp_timer, *del_tmp; 245 245 struct ci_otg_fsm_timer *timer = ci->fsm_timer->timer_list[t]; 246 246 struct list_head *active_timers = &ci->fsm_timer->active_timers; 247 247 int flag = 0; 248 248 249 - if (t >= NUM_CI_OTG_FSM_TIMERS) 249 + if (t >= NUM_OTG_FSM_TIMERS) 250 250 return; 251 251 252 252 list_for_each_entry_safe(tmp_timer, del_tmp, active_timers, list)
+1 -12
drivers/usb/chipidea/otg_fsm.h
··· 62 62 /* SSEND time before SRP */ 63 63 #define TB_SSEND_SRP (1500) /* minimum 1.5 sec, section:5.1.2 */ 64 64 65 - enum 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 - 76 65 struct ci_otg_fsm_timer { 77 66 unsigned long expires; /* Number of count increase to timeout */ 78 67 unsigned long count; /* Tick counter */ ··· 71 82 }; 72 83 73 84 struct ci_otg_fsm_timer_list { 74 - struct ci_otg_fsm_timer *timer_list[NUM_CI_OTG_FSM_TIMERS]; 85 + struct ci_otg_fsm_timer *timer_list[NUM_OTG_FSM_TIMERS]; 75 86 struct list_head active_timers; 76 87 }; 77 88
+2
include/linux/usb/otg-fsm.h
··· 53 53 B_SE0_SRP, 54 54 B_SRP_FAIL, 55 55 A_WAIT_ENUM, 56 + B_DATA_PLS, 57 + B_SSEND_SRP, 56 58 57 59 NUM_OTG_FSM_TIMERS, 58 60 };