aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/whci/wusb.c
diff options
context:
space:
mode:
authorDavid Vrabel <david.vrabel@csr.com>2008-10-27 11:42:31 -0400
committerDavid Vrabel <david.vrabel@csr.com>2008-10-28 08:08:46 -0400
commit4d2bea4ca0adb4cebfbf89d34869c74081c42577 (patch)
tree3ed316eca5ab3228e2e01fc4a83c04297becd105 /drivers/usb/host/whci/wusb.c
parentd409f3bf47c5e5ae10601d079204e263bc176bcf (diff)
wusb: do a proper channel stop
When stopping the WUSB channel the host should send Channel Stop IEs giving the WUSB Channel Time of the last MMC. Both WHCI and HWA hosts provide a channel stop command for this. Signed-off-by: David Vrabel <david.vrabel@csr.com>
Diffstat (limited to 'drivers/usb/host/whci/wusb.c')
-rw-r--r--drivers/usb/host/whci/wusb.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/usb/host/whci/wusb.c b/drivers/usb/host/whci/wusb.c
index 66e4ddcd961d..2befd475def4 100644
--- a/drivers/usb/host/whci/wusb.c
+++ b/drivers/usb/host/whci/wusb.c
@@ -64,8 +64,9 @@ static int whc_update_di(struct whc *whc, int idx)
64} 64}
65 65
66/* 66/*
67 * WHCI starts and stops MMCs based on there being a valid GTK so 67 * WHCI starts MMCs based on there being a valid GTK so these need
68 * these need only start/stop the asynchronous and periodic schedules. 68 * only start/stop the asynchronous and periodic schedules and send a
69 * channel stop command.
69 */ 70 */
70 71
71int whc_wusbhc_start(struct wusbhc *wusbhc) 72int whc_wusbhc_start(struct wusbhc *wusbhc)
@@ -78,12 +79,20 @@ int whc_wusbhc_start(struct wusbhc *wusbhc)
78 return 0; 79 return 0;
79} 80}
80 81
81void whc_wusbhc_stop(struct wusbhc *wusbhc) 82void whc_wusbhc_stop(struct wusbhc *wusbhc, int delay)
82{ 83{
83 struct whc *whc = wusbhc_to_whc(wusbhc); 84 struct whc *whc = wusbhc_to_whc(wusbhc);
85 u32 stop_time, now_time;
86 int ret;
84 87
85 pzl_stop(whc); 88 pzl_stop(whc);
86 asl_stop(whc); 89 asl_stop(whc);
90
91 now_time = le_readl(whc->base + WUSBTIME) & WUSBTIME_CHANNEL_TIME_MASK;
92 stop_time = (now_time + ((delay * 8) << 7)) & 0x00ffffff;
93 ret = whc_do_gencmd(whc, WUSBGENCMDSTS_CHAN_STOP, stop_time, NULL, 0);
94 if (ret == 0)
95 msleep(delay);
87} 96}
88 97
89int whc_mmcie_add(struct wusbhc *wusbhc, u8 interval, u8 repeat_cnt, 98int whc_mmcie_add(struct wusbhc *wusbhc, u8 interval, u8 repeat_cnt,