Commit 3a316ec4 authored by Li Jun's avatar Li Jun Committed by Greg Kroah-Hartman

usb: chipidea: use hrtimer for otg fsm timers

Current otg fsm timers are using controller 1ms irq and count it, this patch
is to replace it with hrtimer solution, use one hrtimer for all otg timers.
Signed-off-by: default avatarLi Jun <jun.li@freescale.com>
Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2f8a467a
......@@ -162,7 +162,10 @@ struct hw_bank {
* @role: current role
* @is_otg: if the device is otg-capable
* @fsm: otg finite state machine
* @fsm_timer: pointer to timer list of otg fsm
* @otg_fsm_hrtimer: hrtimer for otg fsm timers
* @hr_timeouts: time out list for active otg fsm timers
* @enabled_otg_timer_bits: bits of enabled otg timers
* @next_otg_timer: next nearest enabled timer to be expired
* @work: work for role changing
* @wq: workqueue thread
* @qh_pool: allocation pool for queue heads
......@@ -205,7 +208,10 @@ struct ci_hdrc {
bool is_otg;
struct usb_otg otg;
struct otg_fsm fsm;
struct ci_otg_fsm_timer_list *fsm_timer;
struct hrtimer otg_fsm_hrtimer;
ktime_t hr_timeouts[NUM_OTG_FSM_TIMERS];
unsigned enabled_otg_timer_bits;
enum otg_fsm_timer next_otg_timer;
struct work_struct work;
struct workqueue_struct *wq;
......
This diff is collapsed.
......@@ -62,19 +62,6 @@
/* SSEND time before SRP */
#define TB_SSEND_SRP (1500) /* minimum 1.5 sec, section:5.1.2 */
struct ci_otg_fsm_timer {
unsigned long expires; /* Number of count increase to timeout */
unsigned long count; /* Tick counter */
void (*function)(void *, unsigned long); /* Timeout function */
unsigned long data; /* Data passed to function */
struct list_head list;
};
struct ci_otg_fsm_timer_list {
struct ci_otg_fsm_timer *timer_list[NUM_OTG_FSM_TIMERS];
struct list_head active_timers;
};
#ifdef CONFIG_USB_OTG_FSM
int ci_hdrc_otg_fsm_init(struct ci_hdrc *ci);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment