diff options
Diffstat (limited to 'meta/recipes-kernel/linux/linux-omap-2.6.29/musb/0013-musb_host-refactor-musb_save_toggle-take-2.patch')
-rw-r--r-- | meta/recipes-kernel/linux/linux-omap-2.6.29/musb/0013-musb_host-refactor-musb_save_toggle-take-2.patch | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/meta/recipes-kernel/linux/linux-omap-2.6.29/musb/0013-musb_host-refactor-musb_save_toggle-take-2.patch b/meta/recipes-kernel/linux/linux-omap-2.6.29/musb/0013-musb_host-refactor-musb_save_toggle-take-2.patch new file mode 100644 index 0000000000..0202871d41 --- /dev/null +++ b/meta/recipes-kernel/linux/linux-omap-2.6.29/musb/0013-musb_host-refactor-musb_save_toggle-take-2.patch | |||
@@ -0,0 +1,91 @@ | |||
1 | From 2658f7c9029967501cd4d749364f2e02d02eebd5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org> | ||
3 | Date: Fri, 27 Mar 2009 12:54:21 -0700 | ||
4 | Subject: [PATCH] musb_host: refactor musb_save_toggle() (take 2) | ||
5 | |||
6 | Refactor musb_save_toggle() as follows: | ||
7 | |||
8 | - replace 'struct musb_hw_ep *ep' parameter by 'struct | ||
9 | musb_qh *qh' to avoid re-calculating this value | ||
10 | |||
11 | - move usb_settogle() call out of the *if* operator. | ||
12 | |||
13 | This is a net minor shrink of source and object code. | ||
14 | |||
15 | Signed-off-by: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org> | ||
16 | Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org> | ||
17 | --- | ||
18 | drivers/usb/musb/musb_host.c | 35 ++++++++++++----------------------- | ||
19 | 1 files changed, 12 insertions(+), 23 deletions(-) | ||
20 | |||
21 | diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c | ||
22 | index f6e84a0..dc32ce4 100644 | ||
23 | --- a/drivers/usb/musb/musb_host.c | ||
24 | +++ b/drivers/usb/musb/musb_host.c | ||
25 | @@ -318,35 +318,24 @@ __acquires(musb->lock) | ||
26 | spin_lock(&musb->lock); | ||
27 | } | ||
28 | |||
29 | -/* for bulk/interrupt endpoints only */ | ||
30 | -static inline void | ||
31 | -musb_save_toggle(struct musb_hw_ep *ep, int is_in, struct urb *urb) | ||
32 | +/* For bulk/interrupt endpoints only */ | ||
33 | +static inline void musb_save_toggle(struct musb_qh *qh, int is_in, | ||
34 | + struct urb *urb) | ||
35 | { | ||
36 | - struct usb_device *udev = urb->dev; | ||
37 | + void __iomem *epio = qh->hw_ep->regs; | ||
38 | u16 csr; | ||
39 | - void __iomem *epio = ep->regs; | ||
40 | - struct musb_qh *qh; | ||
41 | |||
42 | - /* FIXME: the current Mentor DMA code seems to have | ||
43 | + /* | ||
44 | + * FIXME: the current Mentor DMA code seems to have | ||
45 | * problems getting toggle correct. | ||
46 | */ | ||
47 | |||
48 | - if (is_in || ep->is_shared_fifo) | ||
49 | - qh = ep->in_qh; | ||
50 | + if (is_in) | ||
51 | + csr = musb_readw(epio, MUSB_RXCSR) & MUSB_RXCSR_H_DATATOGGLE; | ||
52 | else | ||
53 | - qh = ep->out_qh; | ||
54 | + csr = musb_readw(epio, MUSB_TXCSR) & MUSB_TXCSR_H_DATATOGGLE; | ||
55 | |||
56 | - if (!is_in) { | ||
57 | - csr = musb_readw(epio, MUSB_TXCSR); | ||
58 | - usb_settoggle(udev, qh->epnum, 1, | ||
59 | - (csr & MUSB_TXCSR_H_DATATOGGLE) | ||
60 | - ? 1 : 0); | ||
61 | - } else { | ||
62 | - csr = musb_readw(epio, MUSB_RXCSR); | ||
63 | - usb_settoggle(udev, qh->epnum, 0, | ||
64 | - (csr & MUSB_RXCSR_H_DATATOGGLE) | ||
65 | - ? 1 : 0); | ||
66 | - } | ||
67 | + usb_settoggle(urb->dev, qh->epnum, !is_in, csr ? 1 : 0); | ||
68 | } | ||
69 | |||
70 | /* caller owns controller lock, irqs are blocked */ | ||
71 | @@ -362,7 +351,7 @@ musb_giveback(struct musb_qh *qh, struct urb *urb, int status) | ||
72 | switch (qh->type) { | ||
73 | case USB_ENDPOINT_XFER_BULK: | ||
74 | case USB_ENDPOINT_XFER_INT: | ||
75 | - musb_save_toggle(ep, is_in, urb); | ||
76 | + musb_save_toggle(qh, is_in, urb); | ||
77 | break; | ||
78 | case USB_ENDPOINT_XFER_ISOC: | ||
79 | if (status == 0 && urb->error_count) | ||
80 | @@ -1362,7 +1351,7 @@ static void musb_bulk_rx_nak_timeout(struct musb *musb, struct musb_hw_ep *ep) | ||
81 | urb->actual_length += dma->actual_len; | ||
82 | dma->actual_len = 0L; | ||
83 | } | ||
84 | - musb_save_toggle(ep, 1, urb); | ||
85 | + musb_save_toggle(cur_qh, 1, urb); | ||
86 | |||
87 | /* move cur_qh to end of queue */ | ||
88 | list_move_tail(&cur_qh->ring, &musb->in_bulk); | ||
89 | -- | ||
90 | 1.6.0.4 | ||
91 | |||