aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/isp116x-hcd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/isp116x-hcd.c')
-rw-r--r--drivers/usb/host/isp116x-hcd.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c
index 20b9a0d07420..ce1ca0ba0515 100644
--- a/drivers/usb/host/isp116x-hcd.c
+++ b/drivers/usb/host/isp116x-hcd.c
@@ -94,6 +94,10 @@ static void write_ptddata_to_fifo(struct isp116x *isp116x, void *buf, int len)
94 u16 w; 94 u16 w;
95 int quot = len % 4; 95 int quot = len % 4;
96 96
97 /* buffer is already in 'usb data order', which is LE. */
98 /* When reading buffer as u16, we have to take care byte order */
99 /* doesn't get mixed up */
100
97 if ((unsigned long)dp2 & 1) { 101 if ((unsigned long)dp2 & 1) {
98 /* not aligned */ 102 /* not aligned */
99 for (; len > 1; len -= 2) { 103 for (; len > 1; len -= 2) {
@@ -105,8 +109,11 @@ static void write_ptddata_to_fifo(struct isp116x *isp116x, void *buf, int len)
105 isp116x_write_data16(isp116x, (u16) * dp); 109 isp116x_write_data16(isp116x, (u16) * dp);
106 } else { 110 } else {
107 /* aligned */ 111 /* aligned */
108 for (; len > 1; len -= 2) 112 for (; len > 1; len -= 2) {
109 isp116x_raw_write_data16(isp116x, *dp2++); 113 /* Keep byte order ! */
114 isp116x_raw_write_data16(isp116x, cpu_to_le16(*dp2++));
115 }
116
110 if (len) 117 if (len)
111 isp116x_write_data16(isp116x, 0xff & *((u8 *) dp2)); 118 isp116x_write_data16(isp116x, 0xff & *((u8 *) dp2));
112 } 119 }
@@ -124,6 +131,10 @@ static void read_ptddata_from_fifo(struct isp116x *isp116x, void *buf, int len)
124 u16 w; 131 u16 w;
125 int quot = len % 4; 132 int quot = len % 4;
126 133
134 /* buffer is already in 'usb data order', which is LE. */
135 /* When reading buffer as u16, we have to take care byte order */
136 /* doesn't get mixed up */
137
127 if ((unsigned long)dp2 & 1) { 138 if ((unsigned long)dp2 & 1) {
128 /* not aligned */ 139 /* not aligned */
129 for (; len > 1; len -= 2) { 140 for (; len > 1; len -= 2) {
@@ -131,12 +142,16 @@ static void read_ptddata_from_fifo(struct isp116x *isp116x, void *buf, int len)
131 *dp++ = w & 0xff; 142 *dp++ = w & 0xff;
132 *dp++ = (w >> 8) & 0xff; 143 *dp++ = (w >> 8) & 0xff;
133 } 144 }
145
134 if (len) 146 if (len)
135 *dp = 0xff & isp116x_read_data16(isp116x); 147 *dp = 0xff & isp116x_read_data16(isp116x);
136 } else { 148 } else {
137 /* aligned */ 149 /* aligned */
138 for (; len > 1; len -= 2) 150 for (; len > 1; len -= 2) {
139 *dp2++ = isp116x_raw_read_data16(isp116x); 151 /* Keep byte order! */
152 *dp2++ = le16_to_cpu(isp116x_raw_read_data16(isp116x));
153 }
154
140 if (len) 155 if (len)
141 *(u8 *) dp2 = 0xff & isp116x_read_data16(isp116x); 156 *(u8 *) dp2 = 0xff & isp116x_read_data16(isp116x);
142 } 157 }
@@ -867,7 +882,7 @@ static void isp116x_endpoint_disable(struct usb_hcd *hcd,
867 for (i = 0; i < 100 && !list_empty(&hep->urb_list); i++) 882 for (i = 0; i < 100 && !list_empty(&hep->urb_list); i++)
868 msleep(3); 883 msleep(3);
869 if (!list_empty(&hep->urb_list)) 884 if (!list_empty(&hep->urb_list))
870 WARN("ep %p not empty?\n", ep); 885 WARNING("ep %p not empty?\n", ep);
871 886
872 kfree(ep); 887 kfree(ep);
873 hep->hcpriv = NULL; 888 hep->hcpriv = NULL;
@@ -1592,7 +1607,7 @@ static int __devinit isp116x_probe(struct platform_device *pdev)
1592 } 1607 }
1593 1608
1594 /* allocate and initialize hcd */ 1609 /* allocate and initialize hcd */
1595 hcd = usb_create_hcd(&isp116x_hc_driver, &pdev->dev, pdev->dev.bus_id); 1610 hcd = usb_create_hcd(&isp116x_hc_driver, &pdev->dev, dev_name(&pdev->dev));
1596 if (!hcd) { 1611 if (!hcd) {
1597 ret = -ENOMEM; 1612 ret = -ENOMEM;
1598 goto err5; 1613 goto err5;