diff options
author | Li Jun <b47624@freescale.com> | 2015-03-20 04:28:04 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-26 05:54:01 -0400 |
commit | 01ecd156905f6bbfe4f5bd278325071f9141726d (patch) | |
tree | 269fc82edb32cc68a826e3c346281089413bca7a /drivers/usb | |
parent | 963719c872a3a71bc2abf4d4899392acab93b09d (diff) |
usb: chipidea: otg: remove unnecessary B_SESS_VLD timer
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>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/chipidea/otg_fsm.c | 31 | ||||
-rw-r--r-- | drivers/usb/chipidea/otg_fsm.h | 3 |
2 files changed, 1 insertions, 33 deletions
diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c index e3cf5be66d3d..3014e2c0ac37 100644 --- a/drivers/usb/chipidea/otg_fsm.c +++ b/drivers/usb/chipidea/otg_fsm.c | |||
@@ -320,17 +320,6 @@ static void a_wait_vfall_tmout_func(void *ptr, unsigned long indicator) | |||
320 | ci_otg_queue_work(ci); | 320 | ci_otg_queue_work(ci); |
321 | } | 321 | } |
322 | 322 | ||
323 | static void b_ase0_brst_tmout_func(void *ptr, unsigned long indicator) | ||
324 | { | ||
325 | struct ci_hdrc *ci = (struct ci_hdrc *)ptr; | ||
326 | |||
327 | set_tmout(ci, indicator); | ||
328 | if (!hw_read_otgsc(ci, OTGSC_BSV)) | ||
329 | ci->fsm.b_sess_vld = 0; | ||
330 | |||
331 | ci_otg_queue_work(ci); | ||
332 | } | ||
333 | |||
334 | static void b_ssend_srp_tmout_func(void *ptr, unsigned long indicator) | 323 | static void b_ssend_srp_tmout_func(void *ptr, unsigned long indicator) |
335 | { | 324 | { |
336 | struct ci_hdrc *ci = (struct ci_hdrc *)ptr; | 325 | struct ci_hdrc *ci = (struct ci_hdrc *)ptr; |
@@ -342,18 +331,6 @@ static void b_ssend_srp_tmout_func(void *ptr, unsigned long indicator) | |||
342 | ci_otg_queue_work(ci); | 331 | ci_otg_queue_work(ci); |
343 | } | 332 | } |
344 | 333 | ||
345 | static void b_sess_vld_tmout_func(void *ptr, unsigned long indicator) | ||
346 | { | ||
347 | struct ci_hdrc *ci = (struct ci_hdrc *)ptr; | ||
348 | |||
349 | /* Check if A detached */ | ||
350 | if (!(hw_read_otgsc(ci, OTGSC_BSV))) { | ||
351 | ci->fsm.b_sess_vld = 0; | ||
352 | ci_otg_add_timer(ci, B_SSEND_SRP); | ||
353 | ci_otg_queue_work(ci); | ||
354 | } | ||
355 | } | ||
356 | |||
357 | static void b_data_pulse_end(void *ptr, unsigned long indicator) | 334 | static void b_data_pulse_end(void *ptr, unsigned long indicator) |
358 | { | 335 | { |
359 | struct ci_hdrc *ci = (struct ci_hdrc *)ptr; | 336 | struct ci_hdrc *ci = (struct ci_hdrc *)ptr; |
@@ -405,7 +382,7 @@ static int ci_otg_init_timers(struct ci_hdrc *ci) | |||
405 | return -ENOMEM; | 382 | return -ENOMEM; |
406 | 383 | ||
407 | ci->fsm_timer->timer_list[B_ASE0_BRST] = | 384 | ci->fsm_timer->timer_list[B_ASE0_BRST] = |
408 | otg_timer_initializer(ci, &b_ase0_brst_tmout_func, TB_ASE0_BRST, | 385 | otg_timer_initializer(ci, &set_tmout_and_fsm, TB_ASE0_BRST, |
409 | (unsigned long)&fsm->b_ase0_brst_tmout); | 386 | (unsigned long)&fsm->b_ase0_brst_tmout); |
410 | if (ci->fsm_timer->timer_list[B_ASE0_BRST] == NULL) | 387 | if (ci->fsm_timer->timer_list[B_ASE0_BRST] == NULL) |
411 | return -ENOMEM; | 388 | return -ENOMEM; |
@@ -433,11 +410,6 @@ static int ci_otg_init_timers(struct ci_hdrc *ci) | |||
433 | if (ci->fsm_timer->timer_list[B_DATA_PLS] == NULL) | 410 | if (ci->fsm_timer->timer_list[B_DATA_PLS] == NULL) |
434 | return -ENOMEM; | 411 | return -ENOMEM; |
435 | 412 | ||
436 | ci->fsm_timer->timer_list[B_SESS_VLD] = otg_timer_initializer(ci, | ||
437 | &b_sess_vld_tmout_func, TB_SESS_VLD, 0); | ||
438 | if (ci->fsm_timer->timer_list[B_SESS_VLD] == NULL) | ||
439 | return -ENOMEM; | ||
440 | |||
441 | return 0; | 413 | return 0; |
442 | } | 414 | } |
443 | 415 | ||
@@ -671,7 +643,6 @@ static void ci_otg_fsm_event(struct ci_hdrc *ci) | |||
671 | fsm->a_conn = 0; | 643 | fsm->a_conn = 0; |
672 | fsm->b_bus_req = 0; | 644 | fsm->b_bus_req = 0; |
673 | ci_otg_queue_work(ci); | 645 | ci_otg_queue_work(ci); |
674 | ci_otg_add_timer(ci, B_SESS_VLD); | ||
675 | } | 646 | } |
676 | break; | 647 | break; |
677 | case OTG_STATE_A_PERIPHERAL: | 648 | case OTG_STATE_A_PERIPHERAL: |
diff --git a/drivers/usb/chipidea/otg_fsm.h b/drivers/usb/chipidea/otg_fsm.h index 94c085f456a9..d0ad4f9ef950 100644 --- a/drivers/usb/chipidea/otg_fsm.h +++ b/drivers/usb/chipidea/otg_fsm.h | |||
@@ -62,8 +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 | ||
65 | #define TB_SESS_VLD (1000) | ||
66 | |||
67 | enum ci_otg_fsm_timer_index { | 65 | enum ci_otg_fsm_timer_index { |
68 | /* | 66 | /* |
69 | * CI specific timers, start from the end | 67 | * CI specific timers, start from the end |
@@ -71,7 +69,6 @@ enum ci_otg_fsm_timer_index { | |||
71 | */ | 69 | */ |
72 | B_DATA_PLS = NUM_OTG_FSM_TIMERS, | 70 | B_DATA_PLS = NUM_OTG_FSM_TIMERS, |
73 | B_SSEND_SRP, | 71 | B_SSEND_SRP, |
74 | B_SESS_VLD, | ||
75 | 72 | ||
76 | NUM_CI_OTG_FSM_TIMERS, | 73 | NUM_CI_OTG_FSM_TIMERS, |
77 | }; | 74 | }; |