diff options
Diffstat (limited to 'drivers/usb')
| -rw-r--r-- | drivers/usb/class/cdc-acm.c | 6 | ||||
| -rw-r--r-- | drivers/usb/core/driver.c | 2 | ||||
| -rw-r--r-- | drivers/usb/gadget/Kconfig | 1 | ||||
| -rw-r--r-- | drivers/usb/gadget/f_audio.c | 4 | ||||
| -rw-r--r-- | drivers/usb/gadget/fsl_qe_udc.c | 4 | ||||
| -rw-r--r-- | drivers/usb/gadget/m66592-udc.h | 22 | ||||
| -rw-r--r-- | drivers/usb/gadget/r8a66597-udc.c | 4 | ||||
| -rw-r--r-- | drivers/usb/gadget/r8a66597-udc.h | 24 | ||||
| -rw-r--r-- | drivers/usb/gadget/s3c-hsotg.c | 57 | ||||
| -rw-r--r-- | drivers/usb/host/ehci-hcd.c | 20 | ||||
| -rw-r--r-- | drivers/usb/host/ehci-xilinx-of.c | 2 | ||||
| -rw-r--r-- | drivers/usb/host/isp1362.h | 2 | ||||
| -rw-r--r-- | drivers/usb/host/r8a66597-hcd.c | 4 | ||||
| -rw-r--r-- | drivers/usb/host/r8a66597.h | 26 | ||||
| -rw-r--r-- | drivers/usb/host/xhci-pci.c | 2 | ||||
| -rw-r--r-- | drivers/usb/host/xhci-ring.c | 31 | ||||
| -rw-r--r-- | drivers/usb/host/xhci.c | 57 | ||||
| -rw-r--r-- | drivers/usb/host/xhci.h | 12 | ||||
| -rw-r--r-- | drivers/usb/serial/digi_acceleport.c | 3 | ||||
| -rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 4 | ||||
| -rw-r--r-- | drivers/usb/serial/mos7840.c | 1 |
21 files changed, 225 insertions, 63 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 0c2f14ff9696..61d75507d5d0 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
| @@ -1201,7 +1201,7 @@ made_compressed_probe: | |||
| 1201 | if (rcv->urb == NULL) { | 1201 | if (rcv->urb == NULL) { |
| 1202 | dev_dbg(&intf->dev, | 1202 | dev_dbg(&intf->dev, |
| 1203 | "out of memory (read urbs usb_alloc_urb)\n"); | 1203 | "out of memory (read urbs usb_alloc_urb)\n"); |
| 1204 | goto alloc_fail7; | 1204 | goto alloc_fail6; |
| 1205 | } | 1205 | } |
| 1206 | 1206 | ||
| 1207 | rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; | 1207 | rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; |
| @@ -1225,7 +1225,7 @@ made_compressed_probe: | |||
| 1225 | if (snd->urb == NULL) { | 1225 | if (snd->urb == NULL) { |
| 1226 | dev_dbg(&intf->dev, | 1226 | dev_dbg(&intf->dev, |
| 1227 | "out of memory (write urbs usb_alloc_urb)"); | 1227 | "out of memory (write urbs usb_alloc_urb)"); |
| 1228 | goto alloc_fail7; | 1228 | goto alloc_fail8; |
| 1229 | } | 1229 | } |
| 1230 | 1230 | ||
| 1231 | if (usb_endpoint_xfer_int(epwrite)) | 1231 | if (usb_endpoint_xfer_int(epwrite)) |
| @@ -1264,6 +1264,7 @@ made_compressed_probe: | |||
| 1264 | i = device_create_file(&intf->dev, | 1264 | i = device_create_file(&intf->dev, |
| 1265 | &dev_attr_iCountryCodeRelDate); | 1265 | &dev_attr_iCountryCodeRelDate); |
| 1266 | if (i < 0) { | 1266 | if (i < 0) { |
| 1267 | device_remove_file(&intf->dev, &dev_attr_wCountryCodes); | ||
| 1267 | kfree(acm->country_codes); | 1268 | kfree(acm->country_codes); |
| 1268 | goto skip_countries; | 1269 | goto skip_countries; |
| 1269 | } | 1270 | } |
| @@ -1300,6 +1301,7 @@ alloc_fail8: | |||
| 1300 | usb_free_urb(acm->wb[i].urb); | 1301 | usb_free_urb(acm->wb[i].urb); |
| 1301 | alloc_fail7: | 1302 | alloc_fail7: |
| 1302 | acm_read_buffers_free(acm); | 1303 | acm_read_buffers_free(acm); |
| 1304 | alloc_fail6: | ||
| 1303 | for (i = 0; i < num_rx_buf; i++) | 1305 | for (i = 0; i < num_rx_buf; i++) |
| 1304 | usb_free_urb(acm->ru[i].urb); | 1306 | usb_free_urb(acm->ru[i].urb); |
| 1305 | usb_free_urb(acm->ctrlurb); | 1307 | usb_free_urb(acm->ctrlurb); |
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index ded550eda5d9..de98a94d1853 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c | |||
| @@ -1328,6 +1328,7 @@ int usb_resume(struct device *dev, pm_message_t msg) | |||
| 1328 | 1328 | ||
| 1329 | /* For all other calls, take the device back to full power and | 1329 | /* For all other calls, take the device back to full power and |
| 1330 | * tell the PM core in case it was autosuspended previously. | 1330 | * tell the PM core in case it was autosuspended previously. |
| 1331 | * Unbind the interfaces that will need rebinding later. | ||
| 1331 | */ | 1332 | */ |
| 1332 | } else { | 1333 | } else { |
| 1333 | status = usb_resume_both(udev, msg); | 1334 | status = usb_resume_both(udev, msg); |
| @@ -1336,6 +1337,7 @@ int usb_resume(struct device *dev, pm_message_t msg) | |||
| 1336 | pm_runtime_set_active(dev); | 1337 | pm_runtime_set_active(dev); |
| 1337 | pm_runtime_enable(dev); | 1338 | pm_runtime_enable(dev); |
| 1338 | udev->last_busy = jiffies; | 1339 | udev->last_busy = jiffies; |
| 1340 | do_unbind_rebind(udev, DO_REBIND); | ||
| 1339 | } | 1341 | } |
| 1340 | } | 1342 | } |
| 1341 | 1343 | ||
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 649c0c5f7158..591ae9fde199 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig | |||
| @@ -295,6 +295,7 @@ config USB_GADGET_S3C_HSOTG | |||
| 295 | boolean "S3C HS/OtG USB Device controller" | 295 | boolean "S3C HS/OtG USB Device controller" |
| 296 | depends on S3C_DEV_USB_HSOTG | 296 | depends on S3C_DEV_USB_HSOTG |
| 297 | select USB_GADGET_S3C_HSOTG_PIO | 297 | select USB_GADGET_S3C_HSOTG_PIO |
| 298 | select USB_GADGET_DUALSPEED | ||
| 298 | help | 299 | help |
| 299 | The Samsung S3C64XX USB2.0 high-speed gadget controller | 300 | The Samsung S3C64XX USB2.0 high-speed gadget controller |
| 300 | integrated into the S3C64XX series SoC. | 301 | integrated into the S3C64XX series SoC. |
diff --git a/drivers/usb/gadget/f_audio.c b/drivers/usb/gadget/f_audio.c index 43bf44514c41..b91115f84b13 100644 --- a/drivers/usb/gadget/f_audio.c +++ b/drivers/usb/gadget/f_audio.c | |||
| @@ -101,7 +101,7 @@ static struct uac_feature_unit_descriptor_0 feature_unit_desc = { | |||
| 101 | static struct usb_audio_control mute_control = { | 101 | static struct usb_audio_control mute_control = { |
| 102 | .list = LIST_HEAD_INIT(mute_control.list), | 102 | .list = LIST_HEAD_INIT(mute_control.list), |
| 103 | .name = "Mute Control", | 103 | .name = "Mute Control", |
| 104 | .type = UAC_MUTE_CONTROL, | 104 | .type = UAC_FU_MUTE, |
| 105 | /* Todo: add real Mute control code */ | 105 | /* Todo: add real Mute control code */ |
| 106 | .set = generic_set_cmd, | 106 | .set = generic_set_cmd, |
| 107 | .get = generic_get_cmd, | 107 | .get = generic_get_cmd, |
| @@ -110,7 +110,7 @@ static struct usb_audio_control mute_control = { | |||
| 110 | static struct usb_audio_control volume_control = { | 110 | static struct usb_audio_control volume_control = { |
| 111 | .list = LIST_HEAD_INIT(volume_control.list), | 111 | .list = LIST_HEAD_INIT(volume_control.list), |
| 112 | .name = "Volume Control", | 112 | .name = "Volume Control", |
| 113 | .type = UAC_VOLUME_CONTROL, | 113 | .type = UAC_FU_VOLUME, |
| 114 | /* Todo: add real Volume control code */ | 114 | /* Todo: add real Volume control code */ |
| 115 | .set = generic_set_cmd, | 115 | .set = generic_set_cmd, |
| 116 | .get = generic_get_cmd, | 116 | .get = generic_get_cmd, |
diff --git a/drivers/usb/gadget/fsl_qe_udc.c b/drivers/usb/gadget/fsl_qe_udc.c index 2928523268b5..82506ca297d5 100644 --- a/drivers/usb/gadget/fsl_qe_udc.c +++ b/drivers/usb/gadget/fsl_qe_udc.c | |||
| @@ -2400,7 +2400,7 @@ EXPORT_SYMBOL(usb_gadget_unregister_driver); | |||
| 2400 | static struct qe_udc __devinit *qe_udc_config(struct of_device *ofdev) | 2400 | static struct qe_udc __devinit *qe_udc_config(struct of_device *ofdev) |
| 2401 | { | 2401 | { |
| 2402 | struct qe_udc *udc; | 2402 | struct qe_udc *udc; |
| 2403 | struct device_node *np = ofdev->node; | 2403 | struct device_node *np = ofdev->dev.of_node; |
| 2404 | unsigned int tmp_addr = 0; | 2404 | unsigned int tmp_addr = 0; |
| 2405 | struct usb_device_para __iomem *usbpram; | 2405 | struct usb_device_para __iomem *usbpram; |
| 2406 | unsigned int i; | 2406 | unsigned int i; |
| @@ -2525,7 +2525,7 @@ static void qe_udc_release(struct device *dev) | |||
| 2525 | static int __devinit qe_udc_probe(struct of_device *ofdev, | 2525 | static int __devinit qe_udc_probe(struct of_device *ofdev, |
| 2526 | const struct of_device_id *match) | 2526 | const struct of_device_id *match) |
| 2527 | { | 2527 | { |
| 2528 | struct device_node *np = ofdev->node; | 2528 | struct device_node *np = ofdev->dev.of_node; |
| 2529 | struct qe_ep *ep; | 2529 | struct qe_ep *ep; |
| 2530 | unsigned int ret = 0; | 2530 | unsigned int ret = 0; |
| 2531 | unsigned int i; | 2531 | unsigned int i; |
diff --git a/drivers/usb/gadget/m66592-udc.h b/drivers/usb/gadget/m66592-udc.h index 8b960deed680..c3caf1ac73ce 100644 --- a/drivers/usb/gadget/m66592-udc.h +++ b/drivers/usb/gadget/m66592-udc.h | |||
| @@ -537,35 +537,35 @@ struct m66592 { | |||
| 537 | /*-------------------------------------------------------------------------*/ | 537 | /*-------------------------------------------------------------------------*/ |
| 538 | static inline u16 m66592_read(struct m66592 *m66592, unsigned long offset) | 538 | static inline u16 m66592_read(struct m66592 *m66592, unsigned long offset) |
| 539 | { | 539 | { |
| 540 | return inw((unsigned long)m66592->reg + offset); | 540 | return ioread16(m66592->reg + offset); |
| 541 | } | 541 | } |
| 542 | 542 | ||
| 543 | static inline void m66592_read_fifo(struct m66592 *m66592, | 543 | static inline void m66592_read_fifo(struct m66592 *m66592, |
| 544 | unsigned long offset, | 544 | unsigned long offset, |
| 545 | void *buf, unsigned long len) | 545 | void *buf, unsigned long len) |
| 546 | { | 546 | { |
| 547 | unsigned long fifoaddr = (unsigned long)m66592->reg + offset; | 547 | void __iomem *fifoaddr = m66592->reg + offset; |
| 548 | 548 | ||
| 549 | if (m66592->pdata->on_chip) { | 549 | if (m66592->pdata->on_chip) { |
| 550 | len = (len + 3) / 4; | 550 | len = (len + 3) / 4; |
| 551 | insl(fifoaddr, buf, len); | 551 | ioread32_rep(fifoaddr, buf, len); |
| 552 | } else { | 552 | } else { |
| 553 | len = (len + 1) / 2; | 553 | len = (len + 1) / 2; |
| 554 | insw(fifoaddr, buf, len); | 554 | ioread16_rep(fifoaddr, buf, len); |
| 555 | } | 555 | } |
| 556 | } | 556 | } |
| 557 | 557 | ||
| 558 | static inline void m66592_write(struct m66592 *m66592, u16 val, | 558 | static inline void m66592_write(struct m66592 *m66592, u16 val, |
| 559 | unsigned long offset) | 559 | unsigned long offset) |
| 560 | { | 560 | { |
| 561 | outw(val, (unsigned long)m66592->reg + offset); | 561 | iowrite16(val, m66592->reg + offset); |
| 562 | } | 562 | } |
| 563 | 563 | ||
| 564 | static inline void m66592_write_fifo(struct m66592 *m66592, | 564 | static inline void m66592_write_fifo(struct m66592 *m66592, |
| 565 | unsigned long offset, | 565 | unsigned long offset, |
| 566 | void *buf, unsigned long len) | 566 | void *buf, unsigned long len) |
| 567 | { | 567 | { |
| 568 | unsigned long fifoaddr = (unsigned long)m66592->reg + offset; | 568 | void __iomem *fifoaddr = m66592->reg + offset; |
| 569 | 569 | ||
| 570 | if (m66592->pdata->on_chip) { | 570 | if (m66592->pdata->on_chip) { |
| 571 | unsigned long count; | 571 | unsigned long count; |
| @@ -573,25 +573,25 @@ static inline void m66592_write_fifo(struct m66592 *m66592, | |||
| 573 | int i; | 573 | int i; |
| 574 | 574 | ||
| 575 | count = len / 4; | 575 | count = len / 4; |
| 576 | outsl(fifoaddr, buf, count); | 576 | iowrite32_rep(fifoaddr, buf, count); |
| 577 | 577 | ||
| 578 | if (len & 0x00000003) { | 578 | if (len & 0x00000003) { |
| 579 | pb = buf + count * 4; | 579 | pb = buf + count * 4; |
| 580 | for (i = 0; i < (len & 0x00000003); i++) { | 580 | for (i = 0; i < (len & 0x00000003); i++) { |
| 581 | if (m66592_read(m66592, M66592_CFBCFG)) /* le */ | 581 | if (m66592_read(m66592, M66592_CFBCFG)) /* le */ |
| 582 | outb(pb[i], fifoaddr + (3 - i)); | 582 | iowrite8(pb[i], fifoaddr + (3 - i)); |
| 583 | else | 583 | else |
| 584 | outb(pb[i], fifoaddr + i); | 584 | iowrite8(pb[i], fifoaddr + i); |
| 585 | } | 585 | } |
| 586 | } | 586 | } |
| 587 | } else { | 587 | } else { |
| 588 | unsigned long odd = len & 0x0001; | 588 | unsigned long odd = len & 0x0001; |
| 589 | 589 | ||
| 590 | len = len / 2; | 590 | len = len / 2; |
| 591 | outsw(fifoaddr, buf, len); | 591 | iowrite16_rep(fifoaddr, buf, len); |
| 592 | if (odd) { | 592 | if (odd) { |
| 593 | unsigned char *p = buf + len*2; | 593 | unsigned char *p = buf + len*2; |
| 594 | outb(*p, fifoaddr); | 594 | iowrite8(*p, fifoaddr); |
| 595 | } | 595 | } |
| 596 | } | 596 | } |
| 597 | } | 597 | } |
diff --git a/drivers/usb/gadget/r8a66597-udc.c b/drivers/usb/gadget/r8a66597-udc.c index 888d8f166c0b..70a817842755 100644 --- a/drivers/usb/gadget/r8a66597-udc.c +++ b/drivers/usb/gadget/r8a66597-udc.c | |||
| @@ -1500,7 +1500,7 @@ static int __exit r8a66597_remove(struct platform_device *pdev) | |||
| 1500 | struct r8a66597 *r8a66597 = dev_get_drvdata(&pdev->dev); | 1500 | struct r8a66597 *r8a66597 = dev_get_drvdata(&pdev->dev); |
| 1501 | 1501 | ||
| 1502 | del_timer_sync(&r8a66597->timer); | 1502 | del_timer_sync(&r8a66597->timer); |
| 1503 | iounmap((void *)r8a66597->reg); | 1503 | iounmap(r8a66597->reg); |
| 1504 | free_irq(platform_get_irq(pdev, 0), r8a66597); | 1504 | free_irq(platform_get_irq(pdev, 0), r8a66597); |
| 1505 | r8a66597_free_request(&r8a66597->ep[0].ep, r8a66597->ep0_req); | 1505 | r8a66597_free_request(&r8a66597->ep[0].ep, r8a66597->ep0_req); |
| 1506 | #ifdef CONFIG_HAVE_CLK | 1506 | #ifdef CONFIG_HAVE_CLK |
| @@ -1578,7 +1578,7 @@ static int __init r8a66597_probe(struct platform_device *pdev) | |||
| 1578 | init_timer(&r8a66597->timer); | 1578 | init_timer(&r8a66597->timer); |
| 1579 | r8a66597->timer.function = r8a66597_timer; | 1579 | r8a66597->timer.function = r8a66597_timer; |
| 1580 | r8a66597->timer.data = (unsigned long)r8a66597; | 1580 | r8a66597->timer.data = (unsigned long)r8a66597; |
| 1581 | r8a66597->reg = (unsigned long)reg; | 1581 | r8a66597->reg = reg; |
| 1582 | 1582 | ||
| 1583 | #ifdef CONFIG_HAVE_CLK | 1583 | #ifdef CONFIG_HAVE_CLK |
| 1584 | if (r8a66597->pdata->on_chip) { | 1584 | if (r8a66597->pdata->on_chip) { |
diff --git a/drivers/usb/gadget/r8a66597-udc.h b/drivers/usb/gadget/r8a66597-udc.h index 9a537aa07968..f763b5190afa 100644 --- a/drivers/usb/gadget/r8a66597-udc.h +++ b/drivers/usb/gadget/r8a66597-udc.h | |||
| @@ -91,7 +91,7 @@ struct r8a66597_ep { | |||
| 91 | 91 | ||
| 92 | struct r8a66597 { | 92 | struct r8a66597 { |
| 93 | spinlock_t lock; | 93 | spinlock_t lock; |
| 94 | unsigned long reg; | 94 | void __iomem *reg; |
| 95 | 95 | ||
| 96 | #ifdef CONFIG_HAVE_CLK | 96 | #ifdef CONFIG_HAVE_CLK |
| 97 | struct clk *clk; | 97 | struct clk *clk; |
| @@ -127,7 +127,7 @@ struct r8a66597 { | |||
| 127 | 127 | ||
| 128 | static inline u16 r8a66597_read(struct r8a66597 *r8a66597, unsigned long offset) | 128 | static inline u16 r8a66597_read(struct r8a66597 *r8a66597, unsigned long offset) |
| 129 | { | 129 | { |
| 130 | return inw(r8a66597->reg + offset); | 130 | return ioread16(r8a66597->reg + offset); |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597, | 133 | static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597, |
| @@ -135,7 +135,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597, | |||
| 135 | unsigned char *buf, | 135 | unsigned char *buf, |
| 136 | int len) | 136 | int len) |
| 137 | { | 137 | { |
| 138 | unsigned long fifoaddr = r8a66597->reg + offset; | 138 | void __iomem *fifoaddr = r8a66597->reg + offset; |
| 139 | unsigned int data; | 139 | unsigned int data; |
| 140 | int i; | 140 | int i; |
| 141 | 141 | ||
| @@ -144,7 +144,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597, | |||
| 144 | 144 | ||
| 145 | /* aligned buf case */ | 145 | /* aligned buf case */ |
| 146 | if (len >= 4 && !((unsigned long)buf & 0x03)) { | 146 | if (len >= 4 && !((unsigned long)buf & 0x03)) { |
| 147 | insl(fifoaddr, buf, len / 4); | 147 | ioread32_rep(fifoaddr, buf, len / 4); |
| 148 | buf += len & ~0x03; | 148 | buf += len & ~0x03; |
| 149 | len &= 0x03; | 149 | len &= 0x03; |
| 150 | } | 150 | } |
| @@ -152,7 +152,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597, | |||
| 152 | /* unaligned buf case */ | 152 | /* unaligned buf case */ |
| 153 | for (i = 0; i < len; i++) { | 153 | for (i = 0; i < len; i++) { |
| 154 | if (!(i & 0x03)) | 154 | if (!(i & 0x03)) |
| 155 | data = inl(fifoaddr); | 155 | data = ioread32(fifoaddr); |
| 156 | 156 | ||
| 157 | buf[i] = (data >> ((i & 0x03) * 8)) & 0xff; | 157 | buf[i] = (data >> ((i & 0x03) * 8)) & 0xff; |
| 158 | } | 158 | } |
| @@ -161,7 +161,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597, | |||
| 161 | 161 | ||
| 162 | /* aligned buf case */ | 162 | /* aligned buf case */ |
| 163 | if (len >= 2 && !((unsigned long)buf & 0x01)) { | 163 | if (len >= 2 && !((unsigned long)buf & 0x01)) { |
| 164 | insw(fifoaddr, buf, len / 2); | 164 | ioread16_rep(fifoaddr, buf, len / 2); |
| 165 | buf += len & ~0x01; | 165 | buf += len & ~0x01; |
| 166 | len &= 0x01; | 166 | len &= 0x01; |
| 167 | } | 167 | } |
| @@ -169,7 +169,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597, | |||
| 169 | /* unaligned buf case */ | 169 | /* unaligned buf case */ |
| 170 | for (i = 0; i < len; i++) { | 170 | for (i = 0; i < len; i++) { |
| 171 | if (!(i & 0x01)) | 171 | if (!(i & 0x01)) |
| 172 | data = inw(fifoaddr); | 172 | data = ioread16(fifoaddr); |
| 173 | 173 | ||
| 174 | buf[i] = (data >> ((i & 0x01) * 8)) & 0xff; | 174 | buf[i] = (data >> ((i & 0x01) * 8)) & 0xff; |
| 175 | } | 175 | } |
| @@ -179,7 +179,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597, | |||
| 179 | static inline void r8a66597_write(struct r8a66597 *r8a66597, u16 val, | 179 | static inline void r8a66597_write(struct r8a66597 *r8a66597, u16 val, |
| 180 | unsigned long offset) | 180 | unsigned long offset) |
| 181 | { | 181 | { |
| 182 | outw(val, r8a66597->reg + offset); | 182 | iowrite16(val, r8a66597->reg + offset); |
| 183 | } | 183 | } |
| 184 | 184 | ||
| 185 | static inline void r8a66597_write_fifo(struct r8a66597 *r8a66597, | 185 | static inline void r8a66597_write_fifo(struct r8a66597 *r8a66597, |
| @@ -187,21 +187,21 @@ static inline void r8a66597_write_fifo(struct r8a66597 *r8a66597, | |||
| 187 | unsigned char *buf, | 187 | unsigned char *buf, |
| 188 | int len) | 188 | int len) |
| 189 | { | 189 | { |
| 190 | unsigned long fifoaddr = r8a66597->reg + offset; | 190 | void __iomem *fifoaddr = r8a66597->reg + offset; |
| 191 | int adj = 0; | 191 | int adj = 0; |
| 192 | int i; | 192 | int i; |
| 193 | 193 | ||
| 194 | if (r8a66597->pdata->on_chip) { | 194 | if (r8a66597->pdata->on_chip) { |
| 195 | /* 32-bit access only if buf is 32-bit aligned */ | 195 | /* 32-bit access only if buf is 32-bit aligned */ |
| 196 | if (len >= 4 && !((unsigned long)buf & 0x03)) { | 196 | if (len >= 4 && !((unsigned long)buf & 0x03)) { |
| 197 | outsl(fifoaddr, buf, len / 4); | 197 | iowrite32_rep(fifoaddr, buf, len / 4); |
| 198 | buf += len & ~0x03; | 198 | buf += len & ~0x03; |
| 199 | len &= 0x03; | 199 | len &= 0x03; |
| 200 | } | 200 | } |
| 201 | } else { | 201 | } else { |
| 202 | /* 16-bit access only if buf is 16-bit aligned */ | 202 | /* 16-bit access only if buf is 16-bit aligned */ |
| 203 | if (len >= 2 && !((unsigned long)buf & 0x01)) { | 203 | if (len >= 2 && !((unsigned long)buf & 0x01)) { |
| 204 | outsw(fifoaddr, buf, len / 2); | 204 | iowrite16_rep(fifoaddr, buf, len / 2); |
| 205 | buf += len & ~0x01; | 205 | buf += len & ~0x01; |
| 206 | len &= 0x01; | 206 | len &= 0x01; |
| 207 | } | 207 | } |
| @@ -216,7 +216,7 @@ static inline void r8a66597_write_fifo(struct r8a66597 *r8a66597, | |||
| 216 | } | 216 | } |
| 217 | 217 | ||
| 218 | for (i = 0; i < len; i++) | 218 | for (i = 0; i < len; i++) |
| 219 | outb(buf[i], fifoaddr + adj - (i & adj)); | 219 | iowrite8(buf[i], fifoaddr + adj - (i & adj)); |
| 220 | } | 220 | } |
| 221 | 221 | ||
| 222 | static inline void r8a66597_mdfy(struct r8a66597 *r8a66597, | 222 | static inline void r8a66597_mdfy(struct r8a66597 *r8a66597, |
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index 1f73b485732d..26193eceb323 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c | |||
| @@ -297,6 +297,12 @@ static void s3c_hsotg_ctrl_epint(struct s3c_hsotg *hsotg, | |||
| 297 | */ | 297 | */ |
| 298 | static void s3c_hsotg_init_fifo(struct s3c_hsotg *hsotg) | 298 | static void s3c_hsotg_init_fifo(struct s3c_hsotg *hsotg) |
| 299 | { | 299 | { |
| 300 | unsigned int ep; | ||
| 301 | unsigned int addr; | ||
| 302 | unsigned int size; | ||
| 303 | int timeout; | ||
| 304 | u32 val; | ||
| 305 | |||
| 300 | /* the ryu 2.6.24 release ahs | 306 | /* the ryu 2.6.24 release ahs |
| 301 | writel(0x1C0, hsotg->regs + S3C_GRXFSIZ); | 307 | writel(0x1C0, hsotg->regs + S3C_GRXFSIZ); |
| 302 | writel(S3C_GNPTXFSIZ_NPTxFStAddr(0x200) | | 308 | writel(S3C_GNPTXFSIZ_NPTxFStAddr(0x200) | |
| @@ -310,6 +316,51 @@ static void s3c_hsotg_init_fifo(struct s3c_hsotg *hsotg) | |||
| 310 | writel(S3C_GNPTXFSIZ_NPTxFStAddr(2048) | | 316 | writel(S3C_GNPTXFSIZ_NPTxFStAddr(2048) | |
| 311 | S3C_GNPTXFSIZ_NPTxFDep(0x1C0), | 317 | S3C_GNPTXFSIZ_NPTxFDep(0x1C0), |
| 312 | hsotg->regs + S3C_GNPTXFSIZ); | 318 | hsotg->regs + S3C_GNPTXFSIZ); |
| 319 | |||
| 320 | /* arange all the rest of the TX FIFOs, as some versions of this | ||
| 321 | * block have overlapping default addresses. This also ensures | ||
| 322 | * that if the settings have been changed, then they are set to | ||
| 323 | * known values. */ | ||
| 324 | |||
| 325 | /* start at the end of the GNPTXFSIZ, rounded up */ | ||
| 326 | addr = 2048 + 1024; | ||
| 327 | size = 768; | ||
| 328 | |||
| 329 | /* currently we allocate TX FIFOs for all possible endpoints, | ||
| 330 | * and assume that they are all the same size. */ | ||
| 331 | |||
| 332 | for (ep = 0; ep <= 15; ep++) { | ||
| 333 | val = addr; | ||
| 334 | val |= size << S3C_DPTXFSIZn_DPTxFSize_SHIFT; | ||
| 335 | addr += size; | ||
| 336 | |||
| 337 | writel(val, hsotg->regs + S3C_DPTXFSIZn(ep)); | ||
| 338 | } | ||
| 339 | |||
| 340 | /* according to p428 of the design guide, we need to ensure that | ||
| 341 | * all fifos are flushed before continuing */ | ||
| 342 | |||
| 343 | writel(S3C_GRSTCTL_TxFNum(0x10) | S3C_GRSTCTL_TxFFlsh | | ||
| 344 | S3C_GRSTCTL_RxFFlsh, hsotg->regs + S3C_GRSTCTL); | ||
| 345 | |||
| 346 | /* wait until the fifos are both flushed */ | ||
| 347 | timeout = 100; | ||
| 348 | while (1) { | ||
| 349 | val = readl(hsotg->regs + S3C_GRSTCTL); | ||
| 350 | |||
| 351 | if ((val & (S3C_GRSTCTL_TxFFlsh | S3C_GRSTCTL_RxFFlsh)) == 0) | ||
| 352 | break; | ||
| 353 | |||
| 354 | if (--timeout == 0) { | ||
| 355 | dev_err(hsotg->dev, | ||
| 356 | "%s: timeout flushing fifos (GRSTCTL=%08x)\n", | ||
| 357 | __func__, val); | ||
| 358 | } | ||
| 359 | |||
| 360 | udelay(1); | ||
| 361 | } | ||
| 362 | |||
| 363 | dev_dbg(hsotg->dev, "FIFOs reset, timeout at %d\n", timeout); | ||
| 313 | } | 364 | } |
| 314 | 365 | ||
| 315 | /** | 366 | /** |
| @@ -2574,6 +2625,9 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) | |||
| 2574 | writel(S3C_DCTL_CGOUTNak | S3C_DCTL_CGNPInNAK, | 2625 | writel(S3C_DCTL_CGOUTNak | S3C_DCTL_CGNPInNAK, |
| 2575 | hsotg->regs + S3C_DCTL); | 2626 | hsotg->regs + S3C_DCTL); |
| 2576 | 2627 | ||
| 2628 | /* must be at-least 3ms to allow bus to see disconnect */ | ||
| 2629 | msleep(3); | ||
| 2630 | |||
| 2577 | /* remove the soft-disconnect and let's go */ | 2631 | /* remove the soft-disconnect and let's go */ |
| 2578 | __bic32(hsotg->regs + S3C_DCTL, S3C_DCTL_SftDiscon); | 2632 | __bic32(hsotg->regs + S3C_DCTL, S3C_DCTL_SftDiscon); |
| 2579 | 2633 | ||
| @@ -2730,6 +2784,9 @@ static void s3c_hsotg_init(struct s3c_hsotg *hsotg) | |||
| 2730 | 2784 | ||
| 2731 | writel(0, hsotg->regs + S3C_DAINTMSK); | 2785 | writel(0, hsotg->regs + S3C_DAINTMSK); |
| 2732 | 2786 | ||
| 2787 | /* Be in disconnected state until gadget is registered */ | ||
| 2788 | __orr32(hsotg->regs + S3C_DCTL, S3C_DCTL_SftDiscon); | ||
| 2789 | |||
| 2733 | if (0) { | 2790 | if (0) { |
| 2734 | /* post global nak until we're ready */ | 2791 | /* post global nak until we're ready */ |
| 2735 | writel(S3C_DCTL_SGNPInNAK | S3C_DCTL_SGOUTNak, | 2792 | writel(S3C_DCTL_SGNPInNAK | S3C_DCTL_SGOUTNak, |
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index ef3e88f0b3c3..a3ef2a9d9dc2 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
| @@ -1135,7 +1135,7 @@ MODULE_LICENSE ("GPL"); | |||
| 1135 | 1135 | ||
| 1136 | #ifdef CONFIG_XPS_USB_HCD_XILINX | 1136 | #ifdef CONFIG_XPS_USB_HCD_XILINX |
| 1137 | #include "ehci-xilinx-of.c" | 1137 | #include "ehci-xilinx-of.c" |
| 1138 | #define OF_PLATFORM_DRIVER ehci_hcd_xilinx_of_driver | 1138 | #define XILINX_OF_PLATFORM_DRIVER ehci_hcd_xilinx_of_driver |
| 1139 | #endif | 1139 | #endif |
| 1140 | 1140 | ||
| 1141 | #ifdef CONFIG_PLAT_ORION | 1141 | #ifdef CONFIG_PLAT_ORION |
| @@ -1159,7 +1159,8 @@ MODULE_LICENSE ("GPL"); | |||
| 1159 | #endif | 1159 | #endif |
| 1160 | 1160 | ||
| 1161 | #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \ | 1161 | #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \ |
| 1162 | !defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER) | 1162 | !defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER) && \ |
| 1163 | !defined(XILINX_OF_PLATFORM_DRIVER) | ||
| 1163 | #error "missing bus glue for ehci-hcd" | 1164 | #error "missing bus glue for ehci-hcd" |
| 1164 | #endif | 1165 | #endif |
| 1165 | 1166 | ||
| @@ -1213,10 +1214,20 @@ static int __init ehci_hcd_init(void) | |||
| 1213 | if (retval < 0) | 1214 | if (retval < 0) |
| 1214 | goto clean3; | 1215 | goto clean3; |
| 1215 | #endif | 1216 | #endif |
| 1217 | |||
| 1218 | #ifdef XILINX_OF_PLATFORM_DRIVER | ||
| 1219 | retval = of_register_platform_driver(&XILINX_OF_PLATFORM_DRIVER); | ||
| 1220 | if (retval < 0) | ||
| 1221 | goto clean4; | ||
| 1222 | #endif | ||
| 1216 | return retval; | 1223 | return retval; |
| 1217 | 1224 | ||
| 1225 | #ifdef XILINX_OF_PLATFORM_DRIVER | ||
| 1226 | /* of_unregister_platform_driver(&XILINX_OF_PLATFORM_DRIVER); */ | ||
| 1227 | clean4: | ||
| 1228 | #endif | ||
| 1218 | #ifdef OF_PLATFORM_DRIVER | 1229 | #ifdef OF_PLATFORM_DRIVER |
| 1219 | /* of_unregister_platform_driver(&OF_PLATFORM_DRIVER); */ | 1230 | of_unregister_platform_driver(&OF_PLATFORM_DRIVER); |
| 1220 | clean3: | 1231 | clean3: |
| 1221 | #endif | 1232 | #endif |
| 1222 | #ifdef PS3_SYSTEM_BUS_DRIVER | 1233 | #ifdef PS3_SYSTEM_BUS_DRIVER |
| @@ -1243,6 +1254,9 @@ module_init(ehci_hcd_init); | |||
| 1243 | 1254 | ||
| 1244 | static void __exit ehci_hcd_cleanup(void) | 1255 | static void __exit ehci_hcd_cleanup(void) |
| 1245 | { | 1256 | { |
| 1257 | #ifdef XILINX_OF_PLATFORM_DRIVER | ||
| 1258 | of_unregister_platform_driver(&XILINX_OF_PLATFORM_DRIVER); | ||
| 1259 | #endif | ||
| 1246 | #ifdef OF_PLATFORM_DRIVER | 1260 | #ifdef OF_PLATFORM_DRIVER |
| 1247 | of_unregister_platform_driver(&OF_PLATFORM_DRIVER); | 1261 | of_unregister_platform_driver(&OF_PLATFORM_DRIVER); |
| 1248 | #endif | 1262 | #endif |
diff --git a/drivers/usb/host/ehci-xilinx-of.c b/drivers/usb/host/ehci-xilinx-of.c index 013972bbde57..4899f451add9 100644 --- a/drivers/usb/host/ehci-xilinx-of.c +++ b/drivers/usb/host/ehci-xilinx-of.c | |||
| @@ -151,7 +151,7 @@ static const struct hc_driver ehci_xilinx_of_hc_driver = { | |||
| 151 | static int __devinit | 151 | static int __devinit |
| 152 | ehci_hcd_xilinx_of_probe(struct of_device *op, const struct of_device_id *match) | 152 | ehci_hcd_xilinx_of_probe(struct of_device *op, const struct of_device_id *match) |
| 153 | { | 153 | { |
| 154 | struct device_node *dn = op->node; | 154 | struct device_node *dn = op->dev.of_node; |
| 155 | struct usb_hcd *hcd; | 155 | struct usb_hcd *hcd; |
| 156 | struct ehci_hcd *ehci; | 156 | struct ehci_hcd *ehci; |
| 157 | struct resource res; | 157 | struct resource res; |
diff --git a/drivers/usb/host/isp1362.h b/drivers/usb/host/isp1362.h index 5151516ea1de..d995351f9bed 100644 --- a/drivers/usb/host/isp1362.h +++ b/drivers/usb/host/isp1362.h | |||
| @@ -65,7 +65,7 @@ static inline void delayed_insw(unsigned int addr, void *buf, int len) | |||
| 65 | unsigned short *bp = (unsigned short *)buf; | 65 | unsigned short *bp = (unsigned short *)buf; |
| 66 | while (len--) { | 66 | while (len--) { |
| 67 | DUMMY_DELAY_ACCESS; | 67 | DUMMY_DELAY_ACCESS; |
| 68 | *bp++ = inw((void *)addr); | 68 | *bp++ = inw(addr); |
| 69 | } | 69 | } |
| 70 | } | 70 | } |
| 71 | 71 | ||
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c index 6db57ab6079d..1a2bb4ce638f 100644 --- a/drivers/usb/host/r8a66597-hcd.c +++ b/drivers/usb/host/r8a66597-hcd.c | |||
| @@ -2404,7 +2404,7 @@ static int __init_or_module r8a66597_remove(struct platform_device *pdev) | |||
| 2404 | 2404 | ||
| 2405 | del_timer_sync(&r8a66597->rh_timer); | 2405 | del_timer_sync(&r8a66597->rh_timer); |
| 2406 | usb_remove_hcd(hcd); | 2406 | usb_remove_hcd(hcd); |
| 2407 | iounmap((void *)r8a66597->reg); | 2407 | iounmap(r8a66597->reg); |
| 2408 | #ifdef CONFIG_HAVE_CLK | 2408 | #ifdef CONFIG_HAVE_CLK |
| 2409 | if (r8a66597->pdata->on_chip) | 2409 | if (r8a66597->pdata->on_chip) |
| 2410 | clk_put(r8a66597->clk); | 2410 | clk_put(r8a66597->clk); |
| @@ -2496,7 +2496,7 @@ static int __devinit r8a66597_probe(struct platform_device *pdev) | |||
| 2496 | init_timer(&r8a66597->rh_timer); | 2496 | init_timer(&r8a66597->rh_timer); |
| 2497 | r8a66597->rh_timer.function = r8a66597_timer; | 2497 | r8a66597->rh_timer.function = r8a66597_timer; |
| 2498 | r8a66597->rh_timer.data = (unsigned long)r8a66597; | 2498 | r8a66597->rh_timer.data = (unsigned long)r8a66597; |
| 2499 | r8a66597->reg = (unsigned long)reg; | 2499 | r8a66597->reg = reg; |
| 2500 | 2500 | ||
| 2501 | /* make sure no interrupts are pending */ | 2501 | /* make sure no interrupts are pending */ |
| 2502 | ret = r8a66597_clock_enable(r8a66597); | 2502 | ret = r8a66597_clock_enable(r8a66597); |
diff --git a/drivers/usb/host/r8a66597.h b/drivers/usb/host/r8a66597.h index 228e3fb23854..95d0f5adfdcf 100644 --- a/drivers/usb/host/r8a66597.h +++ b/drivers/usb/host/r8a66597.h | |||
| @@ -112,7 +112,7 @@ struct r8a66597_root_hub { | |||
| 112 | 112 | ||
| 113 | struct r8a66597 { | 113 | struct r8a66597 { |
| 114 | spinlock_t lock; | 114 | spinlock_t lock; |
| 115 | unsigned long reg; | 115 | void __iomem *reg; |
| 116 | #ifdef CONFIG_HAVE_CLK | 116 | #ifdef CONFIG_HAVE_CLK |
| 117 | struct clk *clk; | 117 | struct clk *clk; |
| 118 | #endif | 118 | #endif |
| @@ -170,67 +170,67 @@ static inline struct urb *r8a66597_get_urb(struct r8a66597 *r8a66597, | |||
| 170 | 170 | ||
| 171 | static inline u16 r8a66597_read(struct r8a66597 *r8a66597, unsigned long offset) | 171 | static inline u16 r8a66597_read(struct r8a66597 *r8a66597, unsigned long offset) |
| 172 | { | 172 | { |
| 173 | return inw(r8a66597->reg + offset); | 173 | return ioread16(r8a66597->reg + offset); |
| 174 | } | 174 | } |
| 175 | 175 | ||
| 176 | static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597, | 176 | static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597, |
| 177 | unsigned long offset, u16 *buf, | 177 | unsigned long offset, u16 *buf, |
| 178 | int len) | 178 | int len) |
| 179 | { | 179 | { |
| 180 | unsigned long fifoaddr = r8a66597->reg + offset; | 180 | void __iomem *fifoaddr = r8a66597->reg + offset; |
| 181 | unsigned long count; | 181 | unsigned long count; |
| 182 | 182 | ||
| 183 | if (r8a66597->pdata->on_chip) { | 183 | if (r8a66597->pdata->on_chip) { |
| 184 | count = len / 4; | 184 | count = len / 4; |
| 185 | insl(fifoaddr, buf, count); | 185 | ioread32_rep(fifoaddr, buf, count); |
| 186 | 186 | ||
| 187 | if (len & 0x00000003) { | 187 | if (len & 0x00000003) { |
| 188 | unsigned long tmp = inl(fifoaddr); | 188 | unsigned long tmp = ioread32(fifoaddr); |
| 189 | memcpy((unsigned char *)buf + count * 4, &tmp, | 189 | memcpy((unsigned char *)buf + count * 4, &tmp, |
| 190 | len & 0x03); | 190 | len & 0x03); |
| 191 | } | 191 | } |
| 192 | } else { | 192 | } else { |
| 193 | len = (len + 1) / 2; | 193 | len = (len + 1) / 2; |
| 194 | insw(fifoaddr, buf, len); | 194 | ioread16_rep(fifoaddr, buf, len); |
| 195 | } | 195 | } |
| 196 | } | 196 | } |
| 197 | 197 | ||
| 198 | static inline void r8a66597_write(struct r8a66597 *r8a66597, u16 val, | 198 | static inline void r8a66597_write(struct r8a66597 *r8a66597, u16 val, |
| 199 | unsigned long offset) | 199 | unsigned long offset) |
| 200 | { | 200 | { |
| 201 | outw(val, r8a66597->reg + offset); | 201 | iowrite16(val, r8a66597->reg + offset); |
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | static inline void r8a66597_write_fifo(struct r8a66597 *r8a66597, | 204 | static inline void r8a66597_write_fifo(struct r8a66597 *r8a66597, |
| 205 | unsigned long offset, u16 *buf, | 205 | unsigned long offset, u16 *buf, |
| 206 | int len) | 206 | int len) |
| 207 | { | 207 | { |
| 208 | unsigned long fifoaddr = r8a66597->reg + offset; | 208 | void __iomem *fifoaddr = r8a66597->reg + offset; |
| 209 | unsigned long count; | 209 | unsigned long count; |
| 210 | unsigned char *pb; | 210 | unsigned char *pb; |
| 211 | int i; | 211 | int i; |
| 212 | 212 | ||
| 213 | if (r8a66597->pdata->on_chip) { | 213 | if (r8a66597->pdata->on_chip) { |
| 214 | count = len / 4; | 214 | count = len / 4; |
| 215 | outsl(fifoaddr, buf, count); | 215 | iowrite32_rep(fifoaddr, buf, count); |
| 216 | 216 | ||
| 217 | if (len & 0x00000003) { | 217 | if (len & 0x00000003) { |
| 218 | pb = (unsigned char *)buf + count * 4; | 218 | pb = (unsigned char *)buf + count * 4; |
| 219 | for (i = 0; i < (len & 0x00000003); i++) { | 219 | for (i = 0; i < (len & 0x00000003); i++) { |
| 220 | if (r8a66597_read(r8a66597, CFIFOSEL) & BIGEND) | 220 | if (r8a66597_read(r8a66597, CFIFOSEL) & BIGEND) |
| 221 | outb(pb[i], fifoaddr + i); | 221 | iowrite8(pb[i], fifoaddr + i); |
| 222 | else | 222 | else |
| 223 | outb(pb[i], fifoaddr + 3 - i); | 223 | iowrite8(pb[i], fifoaddr + 3 - i); |
| 224 | } | 224 | } |
| 225 | } | 225 | } |
| 226 | } else { | 226 | } else { |
| 227 | int odd = len & 0x0001; | 227 | int odd = len & 0x0001; |
| 228 | 228 | ||
| 229 | len = len / 2; | 229 | len = len / 2; |
| 230 | outsw(fifoaddr, buf, len); | 230 | ioread16_rep(fifoaddr, buf, len); |
| 231 | if (unlikely(odd)) { | 231 | if (unlikely(odd)) { |
| 232 | buf = &buf[len]; | 232 | buf = &buf[len]; |
| 233 | outb((unsigned char)*buf, fifoaddr); | 233 | iowrite8((unsigned char)*buf, fifoaddr); |
| 234 | } | 234 | } |
| 235 | } | 235 | } |
| 236 | } | 236 | } |
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index edffd81fc253..11482b6b9381 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c | |||
| @@ -78,6 +78,8 @@ static int xhci_pci_setup(struct usb_hcd *hcd) | |||
| 78 | xhci_dbg(xhci, "QUIRK: Fresco Logic xHC needs configure" | 78 | xhci_dbg(xhci, "QUIRK: Fresco Logic xHC needs configure" |
| 79 | " endpoint cmd after reset endpoint\n"); | 79 | " endpoint cmd after reset endpoint\n"); |
| 80 | } | 80 | } |
| 81 | if (pdev->vendor == PCI_VENDOR_ID_NEC) | ||
| 82 | xhci->quirks |= XHCI_NEC_HOST; | ||
| 81 | 83 | ||
| 82 | /* Make sure the HC is halted. */ | 84 | /* Make sure the HC is halted. */ |
| 83 | retval = xhci_halt(xhci); | 85 | retval = xhci_halt(xhci); |
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 36c858e5b529..9012098add6b 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
| @@ -1071,6 +1071,15 @@ bandwidth_change: | |||
| 1071 | xhci_warn(xhci, "Reset device command completion " | 1071 | xhci_warn(xhci, "Reset device command completion " |
| 1072 | "for disabled slot %u\n", slot_id); | 1072 | "for disabled slot %u\n", slot_id); |
| 1073 | break; | 1073 | break; |
| 1074 | case TRB_TYPE(TRB_NEC_GET_FW): | ||
| 1075 | if (!(xhci->quirks & XHCI_NEC_HOST)) { | ||
| 1076 | xhci->error_bitmask |= 1 << 6; | ||
| 1077 | break; | ||
| 1078 | } | ||
| 1079 | xhci_dbg(xhci, "NEC firmware version %2x.%02x\n", | ||
| 1080 | NEC_FW_MAJOR(event->status), | ||
| 1081 | NEC_FW_MINOR(event->status)); | ||
| 1082 | break; | ||
| 1074 | default: | 1083 | default: |
| 1075 | /* Skip over unknown commands on the event ring */ | 1084 | /* Skip over unknown commands on the event ring */ |
| 1076 | xhci->error_bitmask |= 1 << 6; | 1085 | xhci->error_bitmask |= 1 << 6; |
| @@ -1079,6 +1088,17 @@ bandwidth_change: | |||
| 1079 | inc_deq(xhci, xhci->cmd_ring, false); | 1088 | inc_deq(xhci, xhci->cmd_ring, false); |
| 1080 | } | 1089 | } |
| 1081 | 1090 | ||
| 1091 | static void handle_vendor_event(struct xhci_hcd *xhci, | ||
| 1092 | union xhci_trb *event) | ||
| 1093 | { | ||
| 1094 | u32 trb_type; | ||
| 1095 | |||
| 1096 | trb_type = TRB_FIELD_TO_TYPE(event->generic.field[3]); | ||
| 1097 | xhci_dbg(xhci, "Vendor specific event TRB type = %u\n", trb_type); | ||
| 1098 | if (trb_type == TRB_NEC_CMD_COMP && (xhci->quirks & XHCI_NEC_HOST)) | ||
| 1099 | handle_cmd_completion(xhci, &event->event_cmd); | ||
| 1100 | } | ||
| 1101 | |||
| 1082 | static void handle_port_status(struct xhci_hcd *xhci, | 1102 | static void handle_port_status(struct xhci_hcd *xhci, |
| 1083 | union xhci_trb *event) | 1103 | union xhci_trb *event) |
| 1084 | { | 1104 | { |
| @@ -1659,7 +1679,10 @@ void xhci_handle_event(struct xhci_hcd *xhci) | |||
| 1659 | update_ptrs = 0; | 1679 | update_ptrs = 0; |
| 1660 | break; | 1680 | break; |
| 1661 | default: | 1681 | default: |
| 1662 | xhci->error_bitmask |= 1 << 3; | 1682 | if ((event->event_cmd.flags & TRB_TYPE_BITMASK) >= TRB_TYPE(48)) |
| 1683 | handle_vendor_event(xhci, event); | ||
| 1684 | else | ||
| 1685 | xhci->error_bitmask |= 1 << 3; | ||
| 1663 | } | 1686 | } |
| 1664 | /* Any of the above functions may drop and re-acquire the lock, so check | 1687 | /* Any of the above functions may drop and re-acquire the lock, so check |
| 1665 | * to make sure a watchdog timer didn't mark the host as non-responsive. | 1688 | * to make sure a watchdog timer didn't mark the host as non-responsive. |
| @@ -2378,6 +2401,12 @@ int xhci_queue_address_device(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr, | |||
| 2378 | false); | 2401 | false); |
| 2379 | } | 2402 | } |
| 2380 | 2403 | ||
| 2404 | int xhci_queue_vendor_command(struct xhci_hcd *xhci, | ||
| 2405 | u32 field1, u32 field2, u32 field3, u32 field4) | ||
| 2406 | { | ||
| 2407 | return queue_command(xhci, field1, field2, field3, field4, false); | ||
| 2408 | } | ||
| 2409 | |||
| 2381 | /* Queue a reset device command TRB */ | 2410 | /* Queue a reset device command TRB */ |
| 2382 | int xhci_queue_reset_device(struct xhci_hcd *xhci, u32 slot_id) | 2411 | int xhci_queue_reset_device(struct xhci_hcd *xhci, u32 slot_id) |
| 2383 | { | 2412 | { |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 40e0a0c221b8..27345cd04da0 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
| @@ -106,6 +106,33 @@ int xhci_halt(struct xhci_hcd *xhci) | |||
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | /* | 108 | /* |
| 109 | * Set the run bit and wait for the host to be running. | ||
| 110 | */ | ||
| 111 | int xhci_start(struct xhci_hcd *xhci) | ||
| 112 | { | ||
| 113 | u32 temp; | ||
| 114 | int ret; | ||
| 115 | |||
| 116 | temp = xhci_readl(xhci, &xhci->op_regs->command); | ||
| 117 | temp |= (CMD_RUN); | ||
| 118 | xhci_dbg(xhci, "// Turn on HC, cmd = 0x%x.\n", | ||
| 119 | temp); | ||
| 120 | xhci_writel(xhci, temp, &xhci->op_regs->command); | ||
| 121 | |||
| 122 | /* | ||
| 123 | * Wait for the HCHalted Status bit to be 0 to indicate the host is | ||
| 124 | * running. | ||
| 125 | */ | ||
| 126 | ret = handshake(xhci, &xhci->op_regs->status, | ||
| 127 | STS_HALT, 0, XHCI_MAX_HALT_USEC); | ||
| 128 | if (ret == -ETIMEDOUT) | ||
| 129 | xhci_err(xhci, "Host took too long to start, " | ||
| 130 | "waited %u microseconds.\n", | ||
| 131 | XHCI_MAX_HALT_USEC); | ||
| 132 | return ret; | ||
| 133 | } | ||
| 134 | |||
| 135 | /* | ||
| 109 | * Reset a halted HC, and set the internal HC state to HC_STATE_HALT. | 136 | * Reset a halted HC, and set the internal HC state to HC_STATE_HALT. |
| 110 | * | 137 | * |
| 111 | * This resets pipelines, timers, counters, state machines, etc. | 138 | * This resets pipelines, timers, counters, state machines, etc. |
| @@ -116,6 +143,7 @@ int xhci_reset(struct xhci_hcd *xhci) | |||
| 116 | { | 143 | { |
| 117 | u32 command; | 144 | u32 command; |
| 118 | u32 state; | 145 | u32 state; |
| 146 | int ret; | ||
| 119 | 147 | ||
| 120 | state = xhci_readl(xhci, &xhci->op_regs->status); | 148 | state = xhci_readl(xhci, &xhci->op_regs->status); |
| 121 | if ((state & STS_HALT) == 0) { | 149 | if ((state & STS_HALT) == 0) { |
| @@ -130,7 +158,17 @@ int xhci_reset(struct xhci_hcd *xhci) | |||
| 130 | /* XXX: Why does EHCI set this here? Shouldn't other code do this? */ | 158 | /* XXX: Why does EHCI set this here? Shouldn't other code do this? */ |
| 131 | xhci_to_hcd(xhci)->state = HC_STATE_HALT; | 159 | xhci_to_hcd(xhci)->state = HC_STATE_HALT; |
| 132 | 160 | ||
| 133 | return handshake(xhci, &xhci->op_regs->command, CMD_RESET, 0, 250 * 1000); | 161 | ret = handshake(xhci, &xhci->op_regs->command, |
| 162 | CMD_RESET, 0, 250 * 1000); | ||
| 163 | if (ret) | ||
| 164 | return ret; | ||
| 165 | |||
| 166 | xhci_dbg(xhci, "Wait for controller to be ready for doorbell rings\n"); | ||
| 167 | /* | ||
| 168 | * xHCI cannot write to any doorbells or operational registers other | ||
| 169 | * than status until the "Controller Not Ready" flag is cleared. | ||
| 170 | */ | ||
| 171 | return handshake(xhci, &xhci->op_regs->status, STS_CNR, 0, 250 * 1000); | ||
| 134 | } | 172 | } |
| 135 | 173 | ||
| 136 | 174 | ||
| @@ -448,17 +486,20 @@ int xhci_run(struct usb_hcd *hcd) | |||
| 448 | 486 | ||
| 449 | if (NUM_TEST_NOOPS > 0) | 487 | if (NUM_TEST_NOOPS > 0) |
| 450 | doorbell = xhci_setup_one_noop(xhci); | 488 | doorbell = xhci_setup_one_noop(xhci); |
| 489 | if (xhci->quirks & XHCI_NEC_HOST) | ||
| 490 | xhci_queue_vendor_command(xhci, 0, 0, 0, | ||
| 491 | TRB_TYPE(TRB_NEC_GET_FW)); | ||
| 492 | |||
| 493 | if (xhci_start(xhci)) { | ||
| 494 | xhci_halt(xhci); | ||
| 495 | return -ENODEV; | ||
| 496 | } | ||
| 451 | 497 | ||
| 452 | temp = xhci_readl(xhci, &xhci->op_regs->command); | ||
| 453 | temp |= (CMD_RUN); | ||
| 454 | xhci_dbg(xhci, "// Turn on HC, cmd = 0x%x.\n", | ||
| 455 | temp); | ||
| 456 | xhci_writel(xhci, temp, &xhci->op_regs->command); | ||
| 457 | /* Flush PCI posted writes */ | ||
| 458 | temp = xhci_readl(xhci, &xhci->op_regs->command); | ||
| 459 | xhci_dbg(xhci, "// @%p = 0x%x\n", &xhci->op_regs->command, temp); | 498 | xhci_dbg(xhci, "// @%p = 0x%x\n", &xhci->op_regs->command, temp); |
| 460 | if (doorbell) | 499 | if (doorbell) |
| 461 | (*doorbell)(xhci); | 500 | (*doorbell)(xhci); |
| 501 | if (xhci->quirks & XHCI_NEC_HOST) | ||
| 502 | xhci_ring_cmd_db(xhci); | ||
| 462 | 503 | ||
| 463 | xhci_dbg(xhci, "Finished xhci_run\n"); | 504 | xhci_dbg(xhci, "Finished xhci_run\n"); |
| 464 | return 0; | 505 | return 0; |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index dada2fb59261..8b4b7d39f79c 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
| @@ -925,6 +925,7 @@ union xhci_trb { | |||
| 925 | /* TRB bit mask */ | 925 | /* TRB bit mask */ |
| 926 | #define TRB_TYPE_BITMASK (0xfc00) | 926 | #define TRB_TYPE_BITMASK (0xfc00) |
| 927 | #define TRB_TYPE(p) ((p) << 10) | 927 | #define TRB_TYPE(p) ((p) << 10) |
| 928 | #define TRB_FIELD_TO_TYPE(p) (((p) & TRB_TYPE_BITMASK) >> 10) | ||
| 928 | /* TRB type IDs */ | 929 | /* TRB type IDs */ |
| 929 | /* bulk, interrupt, isoc scatter/gather, and control data stage */ | 930 | /* bulk, interrupt, isoc scatter/gather, and control data stage */ |
| 930 | #define TRB_NORMAL 1 | 931 | #define TRB_NORMAL 1 |
| @@ -992,6 +993,14 @@ union xhci_trb { | |||
| 992 | #define TRB_MFINDEX_WRAP 39 | 993 | #define TRB_MFINDEX_WRAP 39 |
| 993 | /* TRB IDs 40-47 reserved, 48-63 is vendor-defined */ | 994 | /* TRB IDs 40-47 reserved, 48-63 is vendor-defined */ |
| 994 | 995 | ||
| 996 | /* Nec vendor-specific command completion event. */ | ||
| 997 | #define TRB_NEC_CMD_COMP 48 | ||
| 998 | /* Get NEC firmware revision. */ | ||
| 999 | #define TRB_NEC_GET_FW 49 | ||
| 1000 | |||
| 1001 | #define NEC_FW_MINOR(p) (((p) >> 0) & 0xff) | ||
| 1002 | #define NEC_FW_MAJOR(p) (((p) >> 8) & 0xff) | ||
| 1003 | |||
| 995 | /* | 1004 | /* |
| 996 | * TRBS_PER_SEGMENT must be a multiple of 4, | 1005 | * TRBS_PER_SEGMENT must be a multiple of 4, |
| 997 | * since the command ring is 64-byte aligned. | 1006 | * since the command ring is 64-byte aligned. |
| @@ -1172,6 +1181,7 @@ struct xhci_hcd { | |||
| 1172 | unsigned int quirks; | 1181 | unsigned int quirks; |
| 1173 | #define XHCI_LINK_TRB_QUIRK (1 << 0) | 1182 | #define XHCI_LINK_TRB_QUIRK (1 << 0) |
| 1174 | #define XHCI_RESET_EP_QUIRK (1 << 1) | 1183 | #define XHCI_RESET_EP_QUIRK (1 << 1) |
| 1184 | #define XHCI_NEC_HOST (1 << 2) | ||
| 1175 | }; | 1185 | }; |
| 1176 | 1186 | ||
| 1177 | /* For testing purposes */ | 1187 | /* For testing purposes */ |
| @@ -1379,6 +1389,8 @@ void xhci_set_hc_event_deq(struct xhci_hcd *xhci); | |||
| 1379 | int xhci_queue_slot_control(struct xhci_hcd *xhci, u32 trb_type, u32 slot_id); | 1389 | int xhci_queue_slot_control(struct xhci_hcd *xhci, u32 trb_type, u32 slot_id); |
| 1380 | int xhci_queue_address_device(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr, | 1390 | int xhci_queue_address_device(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr, |
| 1381 | u32 slot_id); | 1391 | u32 slot_id); |
| 1392 | int xhci_queue_vendor_command(struct xhci_hcd *xhci, | ||
| 1393 | u32 field1, u32 field2, u32 field3, u32 field4); | ||
| 1382 | int xhci_queue_stop_endpoint(struct xhci_hcd *xhci, int slot_id, | 1394 | int xhci_queue_stop_endpoint(struct xhci_hcd *xhci, int slot_id, |
| 1383 | unsigned int ep_index); | 1395 | unsigned int ep_index); |
| 1384 | int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb, | 1396 | int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb, |
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c index 3edda3ed822a..fd35f73b5721 100644 --- a/drivers/usb/serial/digi_acceleport.c +++ b/drivers/usb/serial/digi_acceleport.c | |||
| @@ -1239,8 +1239,7 @@ static void digi_write_bulk_callback(struct urb *urb) | |||
| 1239 | 1239 | ||
| 1240 | /* port and serial sanity check */ | 1240 | /* port and serial sanity check */ |
| 1241 | if (port == NULL || (priv = usb_get_serial_port_data(port)) == NULL) { | 1241 | if (port == NULL || (priv = usb_get_serial_port_data(port)) == NULL) { |
| 1242 | dev_err(&port->dev, | 1242 | pr_err("%s: port or port->private is NULL, status=%d\n", |
| 1243 | "%s: port or port->private is NULL, status=%d\n", | ||
| 1244 | __func__, status); | 1243 | __func__, status); |
| 1245 | return; | 1244 | return; |
| 1246 | } | 1245 | } |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 050211afc07e..79dd1ae195e5 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
| @@ -2005,6 +2005,8 @@ static void ftdi_set_termios(struct tty_struct *tty, | |||
| 2005 | "urb failed to set to rts/cts flow control\n"); | 2005 | "urb failed to set to rts/cts flow control\n"); |
| 2006 | } | 2006 | } |
| 2007 | 2007 | ||
| 2008 | /* raise DTR/RTS */ | ||
| 2009 | set_mctrl(port, TIOCM_DTR | TIOCM_RTS); | ||
| 2008 | } else { | 2010 | } else { |
| 2009 | /* | 2011 | /* |
| 2010 | * Xon/Xoff code | 2012 | * Xon/Xoff code |
| @@ -2052,6 +2054,8 @@ static void ftdi_set_termios(struct tty_struct *tty, | |||
| 2052 | } | 2054 | } |
| 2053 | } | 2055 | } |
| 2054 | 2056 | ||
| 2057 | /* lower DTR/RTS */ | ||
| 2058 | clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); | ||
| 2055 | } | 2059 | } |
| 2056 | return; | 2060 | return; |
| 2057 | } | 2061 | } |
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index f8424d1bfc1b..585b7e663740 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c | |||
| @@ -730,7 +730,6 @@ static void mos7840_bulk_in_callback(struct urb *urb) | |||
| 730 | mos7840_port = urb->context; | 730 | mos7840_port = urb->context; |
| 731 | if (!mos7840_port) { | 731 | if (!mos7840_port) { |
| 732 | dbg("%s", "NULL mos7840_port pointer"); | 732 | dbg("%s", "NULL mos7840_port pointer"); |
| 733 | mos7840_port->read_urb_busy = false; | ||
| 734 | return; | 733 | return; |
| 735 | } | 734 | } |
| 736 | 735 | ||
