aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.osdl.org>2007-01-06 03:10:21 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2007-01-06 03:10:21 -0500
commitf87c8e80545fd277f69521ef859c3e71c6af5656 (patch)
treeef5e7274559ec6fcdc9b758411a9c7a07cab0711
parent91f7b5c41811154706448b2bf500000cbbfa96ba (diff)
parent14e51f28ade783cd948cd10202a696ff7e5d33d6 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: USB: asix: Fix AX88772 device PHY selection USB: usblp.c - add Kyocera Mita FS 820 to list of "quirky" printers sisusb_con warning fixes USB: Fixed bug in endpoint release function. USB: small update to Documentation/usb/acm.txt USB storage: fix ipod ejecting issue USB Storage: unusual_devs: add supertop drives USB: omap_udc build fixes (sync with linux-omap) USB: funsoft is borken on sparc USB: fix interaction between different interfaces in an "Option" usb device UHCI: support device_may_wakeup UHCI: make test for ASUS motherboard more specific
-rw-r--r--Documentation/usb/acm.txt4
-rw-r--r--drivers/usb/class/usblp.c1
-rw-r--r--drivers/usb/core/endpoint.c2
-rw-r--r--drivers/usb/gadget/omap_udc.c245
-rw-r--r--drivers/usb/gadget/omap_udc.h3
-rw-r--r--drivers/usb/host/uhci-hcd.c20
-rw-r--r--drivers/usb/misc/sisusbvga/sisusb_con.c12
-rw-r--r--drivers/usb/net/asix.c2
-rw-r--r--drivers/usb/serial/Kconfig2
-rw-r--r--drivers/usb/serial/option.c3
-rw-r--r--drivers/usb/storage/unusual_devs.h17
11 files changed, 235 insertions, 76 deletions
diff --git a/Documentation/usb/acm.txt b/Documentation/usb/acm.txt
index 737d6104c3f3..17f5c2e1a570 100644
--- a/Documentation/usb/acm.txt
+++ b/Documentation/usb/acm.txt
@@ -46,6 +46,10 @@ Abstract Control Model (USB CDC ACM) specification.
46 46
47 3Com USR ISDN Pro TA 47 3Com USR ISDN Pro TA
48 48
49 Some cell phones also connect via USB. I know the following phones work:
50
51 SonyEricsson K800i
52
49 Unfortunately many modems and most ISDN TAs use proprietary interfaces and 53 Unfortunately many modems and most ISDN TAs use proprietary interfaces and
50thus won't work with this drivers. Check for ACM compliance before buying. 54thus won't work with this drivers. Check for ACM compliance before buying.
51 55
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index 24ee8be359f5..6377db1b446d 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -217,6 +217,7 @@ static const struct quirk_printer_struct quirk_printers[] = {
217 { 0x0409, 0xbef4, USBLP_QUIRK_BIDIR }, /* NEC Picty760 (HP OEM) */ 217 { 0x0409, 0xbef4, USBLP_QUIRK_BIDIR }, /* NEC Picty760 (HP OEM) */
218 { 0x0409, 0xf0be, USBLP_QUIRK_BIDIR }, /* NEC Picty920 (HP OEM) */ 218 { 0x0409, 0xf0be, USBLP_QUIRK_BIDIR }, /* NEC Picty920 (HP OEM) */
219 { 0x0409, 0xf1be, USBLP_QUIRK_BIDIR }, /* NEC Picty800 (HP OEM) */ 219 { 0x0409, 0xf1be, USBLP_QUIRK_BIDIR }, /* NEC Picty800 (HP OEM) */
220 { 0x0482, 0x0010, USBLP_QUIRK_BIDIR }, /* Kyocera Mita FS 820, by zut <kernel@zut.de> */
220 { 0, 0 } 221 { 0, 0 }
221}; 222};
222 223
diff --git a/drivers/usb/core/endpoint.c b/drivers/usb/core/endpoint.c
index c505b767cee1..5e628ae3aec7 100644
--- a/drivers/usb/core/endpoint.c
+++ b/drivers/usb/core/endpoint.c
@@ -268,6 +268,7 @@ static void ep_device_release(struct device *dev)
268 struct ep_device *ep_dev = to_ep_device(dev); 268 struct ep_device *ep_dev = to_ep_device(dev);
269 269
270 dev_dbg(dev, "%s called for %s\n", __FUNCTION__, dev->bus_id); 270 dev_dbg(dev, "%s called for %s\n", __FUNCTION__, dev->bus_id);
271 endpoint_free_minor(ep_dev);
271 kfree(ep_dev); 272 kfree(ep_dev);
272} 273}
273 274
@@ -349,7 +350,6 @@ void usb_remove_ep_files(struct usb_host_endpoint *endpoint)
349 sprintf(name, "ep_%02x", endpoint->desc.bEndpointAddress); 350 sprintf(name, "ep_%02x", endpoint->desc.bEndpointAddress);
350 sysfs_remove_link(&ep_dev->dev.parent->kobj, name); 351 sysfs_remove_link(&ep_dev->dev.parent->kobj, name);
351 sysfs_remove_group(&ep_dev->dev.kobj, &ep_dev_attr_grp); 352 sysfs_remove_group(&ep_dev->dev.kobj, &ep_dev_attr_grp);
352 endpoint_free_minor(ep_dev);
353 device_unregister(&ep_dev->dev); 353 device_unregister(&ep_dev->dev);
354 endpoint->ep_dev = NULL; 354 endpoint->ep_dev = NULL;
355 destroy_endpoint_class(); 355 destroy_endpoint_class();
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
index 15d77c307930..cdcfd42843d4 100644
--- a/drivers/usb/gadget/omap_udc.c
+++ b/drivers/usb/gadget/omap_udc.c
@@ -42,6 +42,7 @@
42#include <linux/usb_gadget.h> 42#include <linux/usb_gadget.h>
43#include <linux/usb/otg.h> 43#include <linux/usb/otg.h>
44#include <linux/dma-mapping.h> 44#include <linux/dma-mapping.h>
45#include <linux/clk.h>
45 46
46#include <asm/byteorder.h> 47#include <asm/byteorder.h>
47#include <asm/io.h> 48#include <asm/io.h>
@@ -60,6 +61,11 @@
60/* bulk DMA seems to be behaving for both IN and OUT */ 61/* bulk DMA seems to be behaving for both IN and OUT */
61#define USE_DMA 62#define USE_DMA
62 63
64/* FIXME: OMAP2 currently has some problem in DMA mode */
65#ifdef CONFIG_ARCH_OMAP2
66#undef USE_DMA
67#endif
68
63/* ISO too */ 69/* ISO too */
64#define USE_ISO 70#define USE_ISO
65 71
@@ -99,7 +105,7 @@ static unsigned fifo_mode = 0;
99 * boot parameter "omap_udc:fifo_mode=42" 105 * boot parameter "omap_udc:fifo_mode=42"
100 */ 106 */
101module_param (fifo_mode, uint, 0); 107module_param (fifo_mode, uint, 0);
102MODULE_PARM_DESC (fifo_mode, "endpoint setup (0 == default)"); 108MODULE_PARM_DESC (fifo_mode, "endpoint configuration");
103 109
104#ifdef USE_DMA 110#ifdef USE_DMA
105static unsigned use_dma = 1; 111static unsigned use_dma = 1;
@@ -122,7 +128,7 @@ static const char driver_desc [] = DRIVER_DESC;
122/*-------------------------------------------------------------------------*/ 128/*-------------------------------------------------------------------------*/
123 129
124/* there's a notion of "current endpoint" for modifying endpoint 130/* there's a notion of "current endpoint" for modifying endpoint
125 * state, and PIO access to its FIFO. 131 * state, and PIO access to its FIFO.
126 */ 132 */
127 133
128static void use_ep(struct omap_ep *ep, u16 select) 134static void use_ep(struct omap_ep *ep, u16 select)
@@ -391,7 +397,7 @@ done(struct omap_ep *ep, struct omap_req *req, int status)
391#define FIFO_EMPTY (UDC_NON_ISO_FIFO_EMPTY | UDC_ISO_FIFO_EMPTY) 397#define FIFO_EMPTY (UDC_NON_ISO_FIFO_EMPTY | UDC_ISO_FIFO_EMPTY)
392#define FIFO_UNREADABLE (UDC_EP_HALTED | FIFO_EMPTY) 398#define FIFO_UNREADABLE (UDC_EP_HALTED | FIFO_EMPTY)
393 399
394static inline int 400static inline int
395write_packet(u8 *buf, struct omap_req *req, unsigned max) 401write_packet(u8 *buf, struct omap_req *req, unsigned max)
396{ 402{
397 unsigned len; 403 unsigned len;
@@ -456,7 +462,7 @@ static int write_fifo(struct omap_ep *ep, struct omap_req *req)
456 return is_last; 462 return is_last;
457} 463}
458 464
459static inline int 465static inline int
460read_packet(u8 *buf, struct omap_req *req, unsigned avail) 466read_packet(u8 *buf, struct omap_req *req, unsigned avail)
461{ 467{
462 unsigned len; 468 unsigned len;
@@ -542,9 +548,9 @@ static inline dma_addr_t dma_csac(unsigned lch)
542 /* omap 3.2/3.3 erratum: sometimes 0 is returned if CSAC/CDAC is 548 /* omap 3.2/3.3 erratum: sometimes 0 is returned if CSAC/CDAC is
543 * read before the DMA controller finished disabling the channel. 549 * read before the DMA controller finished disabling the channel.
544 */ 550 */
545 csac = omap_readw(OMAP_DMA_CSAC(lch)); 551 csac = OMAP_DMA_CSAC_REG(lch);
546 if (csac == 0) 552 if (csac == 0)
547 csac = omap_readw(OMAP_DMA_CSAC(lch)); 553 csac = OMAP_DMA_CSAC_REG(lch);
548 return csac; 554 return csac;
549} 555}
550 556
@@ -555,9 +561,9 @@ static inline dma_addr_t dma_cdac(unsigned lch)
555 /* omap 3.2/3.3 erratum: sometimes 0 is returned if CSAC/CDAC is 561 /* omap 3.2/3.3 erratum: sometimes 0 is returned if CSAC/CDAC is
556 * read before the DMA controller finished disabling the channel. 562 * read before the DMA controller finished disabling the channel.
557 */ 563 */
558 cdac = omap_readw(OMAP_DMA_CDAC(lch)); 564 cdac = OMAP_DMA_CDAC_REG(lch);
559 if (cdac == 0) 565 if (cdac == 0)
560 cdac = omap_readw(OMAP_DMA_CDAC(lch)); 566 cdac = OMAP_DMA_CDAC_REG(lch);
561 return cdac; 567 return cdac;
562} 568}
563 569
@@ -582,7 +588,7 @@ static u16 dma_src_len(struct omap_ep *ep, dma_addr_t start)
582} 588}
583 589
584#define DMA_DEST_LAST(x) (cpu_is_omap15xx() \ 590#define DMA_DEST_LAST(x) (cpu_is_omap15xx() \
585 ? omap_readw(OMAP_DMA_CSAC(x)) /* really: CPC */ \ 591 ? OMAP_DMA_CSAC_REG(x) /* really: CPC */ \
586 : dma_cdac(x)) 592 : dma_cdac(x))
587 593
588static u16 dma_dest_len(struct omap_ep *ep, dma_addr_t start) 594static u16 dma_dest_len(struct omap_ep *ep, dma_addr_t start)
@@ -620,17 +626,19 @@ static void next_in_dma(struct omap_ep *ep, struct omap_req *req)
620 || (cpu_is_omap15xx() && length < ep->maxpacket)) { 626 || (cpu_is_omap15xx() && length < ep->maxpacket)) {
621 txdma_ctrl = UDC_TXN_EOT | length; 627 txdma_ctrl = UDC_TXN_EOT | length;
622 omap_set_dma_transfer_params(ep->lch, OMAP_DMA_DATA_TYPE_S8, 628 omap_set_dma_transfer_params(ep->lch, OMAP_DMA_DATA_TYPE_S8,
623 length, 1, sync_mode); 629 length, 1, sync_mode, 0, 0);
624 } else { 630 } else {
625 length = min(length / ep->maxpacket, 631 length = min(length / ep->maxpacket,
626 (unsigned) UDC_TXN_TSC + 1); 632 (unsigned) UDC_TXN_TSC + 1);
627 txdma_ctrl = length; 633 txdma_ctrl = length;
628 omap_set_dma_transfer_params(ep->lch, OMAP_DMA_DATA_TYPE_S16, 634 omap_set_dma_transfer_params(ep->lch, OMAP_DMA_DATA_TYPE_S16,
629 ep->ep.maxpacket >> 1, length, sync_mode); 635 ep->ep.maxpacket >> 1, length, sync_mode,
636 0, 0);
630 length *= ep->maxpacket; 637 length *= ep->maxpacket;
631 } 638 }
632 omap_set_dma_src_params(ep->lch, OMAP_DMA_PORT_EMIFF, 639 omap_set_dma_src_params(ep->lch, OMAP_DMA_PORT_EMIFF,
633 OMAP_DMA_AMODE_POST_INC, req->req.dma + req->req.actual); 640 OMAP_DMA_AMODE_POST_INC, req->req.dma + req->req.actual,
641 0, 0);
634 642
635 omap_start_dma(ep->lch); 643 omap_start_dma(ep->lch);
636 ep->dma_counter = dma_csac(ep->lch); 644 ep->dma_counter = dma_csac(ep->lch);
@@ -675,9 +683,11 @@ static void next_out_dma(struct omap_ep *ep, struct omap_req *req)
675 req->dma_bytes = packets * ep->ep.maxpacket; 683 req->dma_bytes = packets * ep->ep.maxpacket;
676 omap_set_dma_transfer_params(ep->lch, OMAP_DMA_DATA_TYPE_S16, 684 omap_set_dma_transfer_params(ep->lch, OMAP_DMA_DATA_TYPE_S16,
677 ep->ep.maxpacket >> 1, packets, 685 ep->ep.maxpacket >> 1, packets,
678 OMAP_DMA_SYNC_ELEMENT); 686 OMAP_DMA_SYNC_ELEMENT,
687 0, 0);
679 omap_set_dma_dest_params(ep->lch, OMAP_DMA_PORT_EMIFF, 688 omap_set_dma_dest_params(ep->lch, OMAP_DMA_PORT_EMIFF,
680 OMAP_DMA_AMODE_POST_INC, req->req.dma + req->req.actual); 689 OMAP_DMA_AMODE_POST_INC, req->req.dma + req->req.actual,
690 0, 0);
681 ep->dma_counter = DMA_DEST_LAST(ep->lch); 691 ep->dma_counter = DMA_DEST_LAST(ep->lch);
682 692
683 UDC_RXDMA_REG(ep->dma_channel) = UDC_RXN_STOP | (packets - 1); 693 UDC_RXDMA_REG(ep->dma_channel) = UDC_RXN_STOP | (packets - 1);
@@ -820,7 +830,8 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel)
820 omap_set_dma_dest_params(ep->lch, 830 omap_set_dma_dest_params(ep->lch,
821 OMAP_DMA_PORT_TIPB, 831 OMAP_DMA_PORT_TIPB,
822 OMAP_DMA_AMODE_CONSTANT, 832 OMAP_DMA_AMODE_CONSTANT,
823 (unsigned long) io_v2p((u32)&UDC_DATA_DMA_REG)); 833 (unsigned long) io_v2p((u32)&UDC_DATA_DMA_REG),
834 0, 0);
824 } 835 }
825 } else { 836 } else {
826 status = omap_request_dma(OMAP_DMA_USB_W2FC_RX0 - 1 + channel, 837 status = omap_request_dma(OMAP_DMA_USB_W2FC_RX0 - 1 + channel,
@@ -831,7 +842,8 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel)
831 omap_set_dma_src_params(ep->lch, 842 omap_set_dma_src_params(ep->lch,
832 OMAP_DMA_PORT_TIPB, 843 OMAP_DMA_PORT_TIPB,
833 OMAP_DMA_AMODE_CONSTANT, 844 OMAP_DMA_AMODE_CONSTANT,
834 (unsigned long) io_v2p((u32)&UDC_DATA_DMA_REG)); 845 (unsigned long) io_v2p((u32)&UDC_DATA_DMA_REG),
846 0, 0);
835 /* EMIFF */ 847 /* EMIFF */
836 omap_set_dma_dest_burst_mode(ep->lch, 848 omap_set_dma_dest_burst_mode(ep->lch,
837 OMAP_DMA_DATA_BURST_4); 849 OMAP_DMA_DATA_BURST_4);
@@ -846,7 +858,7 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel)
846 858
847 /* channel type P: hw synch (fifo) */ 859 /* channel type P: hw synch (fifo) */
848 if (!cpu_is_omap15xx()) 860 if (!cpu_is_omap15xx())
849 omap_writew(2, OMAP_DMA_LCH_CTRL(ep->lch)); 861 OMAP1_DMA_LCH_CTRL_REG(ep->lch) = 2;
850 } 862 }
851 863
852just_restart: 864just_restart:
@@ -893,7 +905,7 @@ static void dma_channel_release(struct omap_ep *ep)
893 else 905 else
894 req = NULL; 906 req = NULL;
895 907
896 active = ((1 << 7) & omap_readl(OMAP_DMA_CCR(ep->lch))) != 0; 908 active = ((1 << 7) & OMAP_DMA_CCR_REG(ep->lch)) != 0;
897 909
898 DBG("%s release %s %cxdma%d %p\n", ep->ep.name, 910 DBG("%s release %s %cxdma%d %p\n", ep->ep.name,
899 active ? "active" : "idle", 911 active ? "active" : "idle",
@@ -1117,7 +1129,7 @@ static int omap_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
1117 */ 1129 */
1118 dma_channel_release(ep); 1130 dma_channel_release(ep);
1119 dma_channel_claim(ep, channel); 1131 dma_channel_claim(ep, channel);
1120 } else 1132 } else
1121 done(ep, req, -ECONNRESET); 1133 done(ep, req, -ECONNRESET);
1122 spin_unlock_irqrestore(&ep->udc->lock, flags); 1134 spin_unlock_irqrestore(&ep->udc->lock, flags);
1123 return 0; 1135 return 0;
@@ -1153,7 +1165,7 @@ static int omap_ep_set_halt(struct usb_ep *_ep, int value)
1153 1165
1154 /* IN endpoints must already be idle */ 1166 /* IN endpoints must already be idle */
1155 if ((ep->bEndpointAddress & USB_DIR_IN) 1167 if ((ep->bEndpointAddress & USB_DIR_IN)
1156 && !list_empty(&ep->queue)) { 1168 && !list_empty(&ep->queue)) {
1157 status = -EAGAIN; 1169 status = -EAGAIN;
1158 goto done; 1170 goto done;
1159 } 1171 }
@@ -1298,6 +1310,23 @@ static void pullup_disable(struct omap_udc *udc)
1298 UDC_SYSCON1_REG &= ~UDC_PULLUP_EN; 1310 UDC_SYSCON1_REG &= ~UDC_PULLUP_EN;
1299} 1311}
1300 1312
1313static struct omap_udc *udc;
1314
1315static void omap_udc_enable_clock(int enable)
1316{
1317 if (udc == NULL || udc->dc_clk == NULL || udc->hhc_clk == NULL)
1318 return;
1319
1320 if (enable) {
1321 clk_enable(udc->dc_clk);
1322 clk_enable(udc->hhc_clk);
1323 udelay(100);
1324 } else {
1325 clk_disable(udc->hhc_clk);
1326 clk_disable(udc->dc_clk);
1327 }
1328}
1329
1301/* 1330/*
1302 * Called by whatever detects VBUS sessions: external transceiver 1331 * Called by whatever detects VBUS sessions: external transceiver
1303 * driver, or maybe GPIO0 VBUS IRQ. May request 48 MHz clock. 1332 * driver, or maybe GPIO0 VBUS IRQ. May request 48 MHz clock.
@@ -1318,10 +1347,22 @@ static int omap_vbus_session(struct usb_gadget *gadget, int is_active)
1318 else 1347 else
1319 FUNC_MUX_CTRL_0_REG &= ~VBUS_CTRL_1510; 1348 FUNC_MUX_CTRL_0_REG &= ~VBUS_CTRL_1510;
1320 } 1349 }
1350 if (udc->dc_clk != NULL && is_active) {
1351 if (!udc->clk_requested) {
1352 omap_udc_enable_clock(1);
1353 udc->clk_requested = 1;
1354 }
1355 }
1321 if (can_pullup(udc)) 1356 if (can_pullup(udc))
1322 pullup_enable(udc); 1357 pullup_enable(udc);
1323 else 1358 else
1324 pullup_disable(udc); 1359 pullup_disable(udc);
1360 if (udc->dc_clk != NULL && !is_active) {
1361 if (udc->clk_requested) {
1362 omap_udc_enable_clock(0);
1363 udc->clk_requested = 0;
1364 }
1365 }
1325 spin_unlock_irqrestore(&udc->lock, flags); 1366 spin_unlock_irqrestore(&udc->lock, flags);
1326 return 0; 1367 return 0;
1327} 1368}
@@ -1441,7 +1482,7 @@ static void ep0_irq(struct omap_udc *udc, u16 irq_src)
1441 } 1482 }
1442 } 1483 }
1443 1484
1444 /* IN/OUT packets mean we're in the DATA or STATUS stage. 1485 /* IN/OUT packets mean we're in the DATA or STATUS stage.
1445 * This driver uses only uses protocol stalls (ep0 never halts), 1486 * This driver uses only uses protocol stalls (ep0 never halts),
1446 * and if we got this far the gadget driver already had a 1487 * and if we got this far the gadget driver already had a
1447 * chance to stall. Tries to be forgiving of host oddities. 1488 * chance to stall. Tries to be forgiving of host oddities.
@@ -1509,7 +1550,7 @@ static void ep0_irq(struct omap_udc *udc, u16 irq_src)
1509 } else if (stat == 0) 1550 } else if (stat == 0)
1510 UDC_CTRL_REG = UDC_SET_FIFO_EN; 1551 UDC_CTRL_REG = UDC_SET_FIFO_EN;
1511 UDC_EP_NUM_REG = 0; 1552 UDC_EP_NUM_REG = 0;
1512 1553
1513 /* activate status stage */ 1554 /* activate status stage */
1514 if (stat == 1) { 1555 if (stat == 1) {
1515 done(ep0, req, 0); 1556 done(ep0, req, 0);
@@ -1866,7 +1907,7 @@ static void pio_out_timer(unsigned long _ep)
1866 1907
1867 spin_lock_irqsave(&ep->udc->lock, flags); 1908 spin_lock_irqsave(&ep->udc->lock, flags);
1868 if (!list_empty(&ep->queue) && ep->ackwait) { 1909 if (!list_empty(&ep->queue) && ep->ackwait) {
1869 use_ep(ep, 0); 1910 use_ep(ep, UDC_EP_SEL);
1870 stat_flg = UDC_STAT_FLG_REG; 1911 stat_flg = UDC_STAT_FLG_REG;
1871 1912
1872 if ((stat_flg & UDC_ACK) && (!(stat_flg & UDC_FIFO_EN) 1913 if ((stat_flg & UDC_ACK) && (!(stat_flg & UDC_FIFO_EN)
@@ -1876,12 +1917,12 @@ static void pio_out_timer(unsigned long _ep)
1876 VDBG("%s: lose, %04x\n", ep->ep.name, stat_flg); 1917 VDBG("%s: lose, %04x\n", ep->ep.name, stat_flg);
1877 req = container_of(ep->queue.next, 1918 req = container_of(ep->queue.next,
1878 struct omap_req, queue); 1919 struct omap_req, queue);
1879 UDC_EP_NUM_REG = ep->bEndpointAddress | UDC_EP_SEL;
1880 (void) read_fifo(ep, req); 1920 (void) read_fifo(ep, req);
1881 UDC_EP_NUM_REG = ep->bEndpointAddress; 1921 UDC_EP_NUM_REG = ep->bEndpointAddress;
1882 UDC_CTRL_REG = UDC_SET_FIFO_EN; 1922 UDC_CTRL_REG = UDC_SET_FIFO_EN;
1883 ep->ackwait = 1 + ep->double_buf; 1923 ep->ackwait = 1 + ep->double_buf;
1884 } 1924 } else
1925 deselect_ep();
1885 } 1926 }
1886 mod_timer(&ep->timer, PIO_OUT_TIMEOUT); 1927 mod_timer(&ep->timer, PIO_OUT_TIMEOUT);
1887 spin_unlock_irqrestore(&ep->udc->lock, flags); 1928 spin_unlock_irqrestore(&ep->udc->lock, flags);
@@ -2028,7 +2069,17 @@ static irqreturn_t omap_udc_iso_irq(int irq, void *_dev)
2028 2069
2029/*-------------------------------------------------------------------------*/ 2070/*-------------------------------------------------------------------------*/
2030 2071
2031static struct omap_udc *udc; 2072static inline int machine_needs_vbus_session(void)
2073{
2074 return (machine_is_omap_innovator()
2075 || machine_is_omap_osk()
2076 || machine_is_omap_apollon()
2077#ifndef CONFIG_MACH_OMAP_H4_OTG
2078 || machine_is_omap_h4()
2079#endif
2080 || machine_is_sx1()
2081 );
2082}
2032 2083
2033int usb_gadget_register_driver (struct usb_gadget_driver *driver) 2084int usb_gadget_register_driver (struct usb_gadget_driver *driver)
2034{ 2085{
@@ -2070,6 +2121,9 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
2070 udc->gadget.dev.driver = &driver->driver; 2121 udc->gadget.dev.driver = &driver->driver;
2071 spin_unlock_irqrestore(&udc->lock, flags); 2122 spin_unlock_irqrestore(&udc->lock, flags);
2072 2123
2124 if (udc->dc_clk != NULL)
2125 omap_udc_enable_clock(1);
2126
2073 status = driver->bind (&udc->gadget); 2127 status = driver->bind (&udc->gadget);
2074 if (status) { 2128 if (status) {
2075 DBG("bind to %s --> %d\n", driver->driver.name, status); 2129 DBG("bind to %s --> %d\n", driver->driver.name, status);
@@ -2103,10 +2157,12 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
2103 /* boards that don't have VBUS sensing can't autogate 48MHz; 2157 /* boards that don't have VBUS sensing can't autogate 48MHz;
2104 * can't enter deep sleep while a gadget driver is active. 2158 * can't enter deep sleep while a gadget driver is active.
2105 */ 2159 */
2106 if (machine_is_omap_innovator() || machine_is_omap_osk()) 2160 if (machine_needs_vbus_session())
2107 omap_vbus_session(&udc->gadget, 1); 2161 omap_vbus_session(&udc->gadget, 1);
2108 2162
2109done: 2163done:
2164 if (udc->dc_clk != NULL)
2165 omap_udc_enable_clock(0);
2110 return status; 2166 return status;
2111} 2167}
2112EXPORT_SYMBOL(usb_gadget_register_driver); 2168EXPORT_SYMBOL(usb_gadget_register_driver);
@@ -2121,7 +2177,10 @@ int usb_gadget_unregister_driver (struct usb_gadget_driver *driver)
2121 if (!driver || driver != udc->driver || !driver->unbind) 2177 if (!driver || driver != udc->driver || !driver->unbind)
2122 return -EINVAL; 2178 return -EINVAL;
2123 2179
2124 if (machine_is_omap_innovator() || machine_is_omap_osk()) 2180 if (udc->dc_clk != NULL)
2181 omap_udc_enable_clock(1);
2182
2183 if (machine_needs_vbus_session())
2125 omap_vbus_session(&udc->gadget, 0); 2184 omap_vbus_session(&udc->gadget, 0);
2126 2185
2127 if (udc->transceiver) 2186 if (udc->transceiver)
@@ -2137,6 +2196,8 @@ int usb_gadget_unregister_driver (struct usb_gadget_driver *driver)
2137 udc->gadget.dev.driver = NULL; 2196 udc->gadget.dev.driver = NULL;
2138 udc->driver = NULL; 2197 udc->driver = NULL;
2139 2198
2199 if (udc->dc_clk != NULL)
2200 omap_udc_enable_clock(0);
2140 DBG("unregistered driver '%s'\n", driver->driver.name); 2201 DBG("unregistered driver '%s'\n", driver->driver.name);
2141 return status; 2202 return status;
2142} 2203}
@@ -2219,7 +2280,7 @@ static char *trx_mode(unsigned m, int enabled)
2219 case 0: return enabled ? "*6wire" : "unused"; 2280 case 0: return enabled ? "*6wire" : "unused";
2220 case 1: return "4wire"; 2281 case 1: return "4wire";
2221 case 2: return "3wire"; 2282 case 2: return "3wire";
2222 case 3: return "6wire"; 2283 case 3: return "6wire";
2223 default: return "unknown"; 2284 default: return "unknown";
2224 } 2285 }
2225} 2286}
@@ -2228,11 +2289,18 @@ static int proc_otg_show(struct seq_file *s)
2228{ 2289{
2229 u32 tmp; 2290 u32 tmp;
2230 u32 trans; 2291 u32 trans;
2292 char *ctrl_name;
2231 2293
2232 tmp = OTG_REV_REG; 2294 tmp = OTG_REV_REG;
2233 trans = USB_TRANSCEIVER_CTRL_REG; 2295 if (cpu_is_omap24xx()) {
2234 seq_printf(s, "\nOTG rev %d.%d, transceiver_ctrl %05x\n", 2296 ctrl_name = "control_devconf";
2235 tmp >> 4, tmp & 0xf, trans); 2297 trans = CONTROL_DEVCONF_REG;
2298 } else {
2299 ctrl_name = "tranceiver_ctrl";
2300 trans = USB_TRANSCEIVER_CTRL_REG;
2301 }
2302 seq_printf(s, "\nOTG rev %d.%d, %s %05x\n",
2303 tmp >> 4, tmp & 0xf, ctrl_name, trans);
2236 tmp = OTG_SYSCON_1_REG; 2304 tmp = OTG_SYSCON_1_REG;
2237 seq_printf(s, "otg_syscon1 %08x usb2 %s, usb1 %s, usb0 %s," 2305 seq_printf(s, "otg_syscon1 %08x usb2 %s, usb1 %s, usb0 %s,"
2238 FOURBITS "\n", tmp, 2306 FOURBITS "\n", tmp,
@@ -2307,7 +2375,7 @@ static int proc_udc_show(struct seq_file *s, void *_)
2307 driver_desc, 2375 driver_desc,
2308 use_dma ? " (dma)" : ""); 2376 use_dma ? " (dma)" : "");
2309 2377
2310 tmp = UDC_REV_REG & 0xff; 2378 tmp = UDC_REV_REG & 0xff;
2311 seq_printf(s, 2379 seq_printf(s,
2312 "UDC rev %d.%d, fifo mode %d, gadget %s\n" 2380 "UDC rev %d.%d, fifo mode %d, gadget %s\n"
2313 "hmc %d, transceiver %s\n", 2381 "hmc %d, transceiver %s\n",
@@ -2315,11 +2383,16 @@ static int proc_udc_show(struct seq_file *s, void *_)
2315 fifo_mode, 2383 fifo_mode,
2316 udc->driver ? udc->driver->driver.name : "(none)", 2384 udc->driver ? udc->driver->driver.name : "(none)",
2317 HMC, 2385 HMC,
2318 udc->transceiver ? udc->transceiver->label : "(none)"); 2386 udc->transceiver
2319 seq_printf(s, "ULPD control %04x req %04x status %04x\n", 2387 ? udc->transceiver->label
2320 __REG16(ULPD_CLOCK_CTRL), 2388 : ((cpu_is_omap1710() || cpu_is_omap24xx())
2321 __REG16(ULPD_SOFT_REQ), 2389 ? "external" : "(none)"));
2322 __REG16(ULPD_STATUS_REQ)); 2390 if (cpu_class_is_omap1()) {
2391 seq_printf(s, "ULPD control %04x req %04x status %04x\n",
2392 __REG16(ULPD_CLOCK_CTRL),
2393 __REG16(ULPD_SOFT_REQ),
2394 __REG16(ULPD_STATUS_REQ));
2395 }
2323 2396
2324 /* OTG controller registers */ 2397 /* OTG controller registers */
2325 if (!cpu_is_omap15xx()) 2398 if (!cpu_is_omap15xx())
@@ -2504,9 +2577,10 @@ omap_ep_setup(char *name, u8 addr, u8 type,
2504 dbuf = 1; 2577 dbuf = 1;
2505 } else { 2578 } else {
2506 /* double-buffering "not supported" on 15xx, 2579 /* double-buffering "not supported" on 15xx,
2507 * and ignored for PIO-IN on 16xx 2580 * and ignored for PIO-IN on newer chips
2581 * (for more reliable behavior)
2508 */ 2582 */
2509 if (!use_dma || cpu_is_omap15xx()) 2583 if (!use_dma || cpu_is_omap15xx() || cpu_is_omap24xx())
2510 dbuf = 0; 2584 dbuf = 0;
2511 2585
2512 switch (maxp) { 2586 switch (maxp) {
@@ -2549,7 +2623,7 @@ omap_ep_setup(char *name, u8 addr, u8 type,
2549 ep->bEndpointAddress = addr; 2623 ep->bEndpointAddress = addr;
2550 ep->bmAttributes = type; 2624 ep->bmAttributes = type;
2551 ep->double_buf = dbuf; 2625 ep->double_buf = dbuf;
2552 ep->udc = udc; 2626 ep->udc = udc;
2553 2627
2554 ep->ep.name = ep->name; 2628 ep->ep.name = ep->name;
2555 ep->ep.ops = &omap_ep_ops; 2629 ep->ep.ops = &omap_ep_ops;
@@ -2709,15 +2783,37 @@ static int __init omap_udc_probe(struct platform_device *pdev)
2709 struct otg_transceiver *xceiv = NULL; 2783 struct otg_transceiver *xceiv = NULL;
2710 const char *type = NULL; 2784 const char *type = NULL;
2711 struct omap_usb_config *config = pdev->dev.platform_data; 2785 struct omap_usb_config *config = pdev->dev.platform_data;
2786 struct clk *dc_clk;
2787 struct clk *hhc_clk;
2712 2788
2713 /* NOTE: "knows" the order of the resources! */ 2789 /* NOTE: "knows" the order of the resources! */
2714 if (!request_mem_region(pdev->resource[0].start, 2790 if (!request_mem_region(pdev->resource[0].start,
2715 pdev->resource[0].end - pdev->resource[0].start + 1, 2791 pdev->resource[0].end - pdev->resource[0].start + 1,
2716 driver_name)) { 2792 driver_name)) {
2717 DBG("request_mem_region failed\n"); 2793 DBG("request_mem_region failed\n");
2718 return -EBUSY; 2794 return -EBUSY;
2719 } 2795 }
2720 2796
2797 if (cpu_is_omap16xx()) {
2798 dc_clk = clk_get(&pdev->dev, "usb_dc_ck");
2799 hhc_clk = clk_get(&pdev->dev, "usb_hhc_ck");
2800 BUG_ON(IS_ERR(dc_clk) || IS_ERR(hhc_clk));
2801 /* can't use omap_udc_enable_clock yet */
2802 clk_enable(dc_clk);
2803 clk_enable(hhc_clk);
2804 udelay(100);
2805 }
2806
2807 if (cpu_is_omap24xx()) {
2808 dc_clk = clk_get(&pdev->dev, "usb_fck");
2809 hhc_clk = clk_get(&pdev->dev, "usb_l4_ick");
2810 BUG_ON(IS_ERR(dc_clk) || IS_ERR(hhc_clk));
2811 /* can't use omap_udc_enable_clock yet */
2812 clk_enable(dc_clk);
2813 clk_enable(hhc_clk);
2814 udelay(100);
2815 }
2816
2721 INFO("OMAP UDC rev %d.%d%s\n", 2817 INFO("OMAP UDC rev %d.%d%s\n",
2722 UDC_REV_REG >> 4, UDC_REV_REG & 0xf, 2818 UDC_REV_REG >> 4, UDC_REV_REG & 0xf,
2723 config->otg ? ", Mini-AB" : ""); 2819 config->otg ? ", Mini-AB" : "");
@@ -2727,7 +2823,7 @@ static int __init omap_udc_probe(struct platform_device *pdev)
2727 hmc = HMC_1510; 2823 hmc = HMC_1510;
2728 type = "(unknown)"; 2824 type = "(unknown)";
2729 2825
2730 if (machine_is_omap_innovator()) { 2826 if (machine_is_omap_innovator() || machine_is_sx1()) {
2731 /* just set up software VBUS detect, and then 2827 /* just set up software VBUS detect, and then
2732 * later rig it so we always report VBUS. 2828 * later rig it so we always report VBUS.
2733 * FIXME without really sensing VBUS, we can't 2829 * FIXME without really sensing VBUS, we can't
@@ -2756,6 +2852,15 @@ static int __init omap_udc_probe(struct platform_device *pdev)
2756 } 2852 }
2757 2853
2758 hmc = HMC_1610; 2854 hmc = HMC_1610;
2855
2856 if (cpu_is_omap24xx()) {
2857 /* this could be transceiverless in one of the
2858 * "we don't need to know" modes.
2859 */
2860 type = "external";
2861 goto known;
2862 }
2863
2759 switch (hmc) { 2864 switch (hmc) {
2760 case 0: /* POWERUP DEFAULT == 0 */ 2865 case 0: /* POWERUP DEFAULT == 0 */
2761 case 4: 2866 case 4:
@@ -2794,6 +2899,7 @@ bad_on_1710:
2794 goto cleanup0; 2899 goto cleanup0;
2795 } 2900 }
2796 } 2901 }
2902known:
2797 INFO("hmc mode %d, %s transceiver\n", hmc, type); 2903 INFO("hmc mode %d, %s transceiver\n", hmc, type);
2798 2904
2799 /* a "gadget" abstracts/virtualizes the controller */ 2905 /* a "gadget" abstracts/virtualizes the controller */
@@ -2818,8 +2924,8 @@ bad_on_1710:
2818 status = request_irq(pdev->resource[1].start, omap_udc_irq, 2924 status = request_irq(pdev->resource[1].start, omap_udc_irq,
2819 IRQF_SAMPLE_RANDOM, driver_name, udc); 2925 IRQF_SAMPLE_RANDOM, driver_name, udc);
2820 if (status != 0) { 2926 if (status != 0) {
2821 ERR( "can't get irq %ld, err %d\n", 2927 ERR("can't get irq %d, err %d\n",
2822 pdev->resource[1].start, status); 2928 (int) pdev->resource[1].start, status);
2823 goto cleanup1; 2929 goto cleanup1;
2824 } 2930 }
2825 2931
@@ -2827,24 +2933,41 @@ bad_on_1710:
2827 status = request_irq(pdev->resource[2].start, omap_udc_pio_irq, 2933 status = request_irq(pdev->resource[2].start, omap_udc_pio_irq,
2828 IRQF_SAMPLE_RANDOM, "omap_udc pio", udc); 2934 IRQF_SAMPLE_RANDOM, "omap_udc pio", udc);
2829 if (status != 0) { 2935 if (status != 0) {
2830 ERR( "can't get irq %ld, err %d\n", 2936 ERR("can't get irq %d, err %d\n",
2831 pdev->resource[2].start, status); 2937 (int) pdev->resource[2].start, status);
2832 goto cleanup2; 2938 goto cleanup2;
2833 } 2939 }
2834#ifdef USE_ISO 2940#ifdef USE_ISO
2835 status = request_irq(pdev->resource[3].start, omap_udc_iso_irq, 2941 status = request_irq(pdev->resource[3].start, omap_udc_iso_irq,
2836 IRQF_DISABLED, "omap_udc iso", udc); 2942 IRQF_DISABLED, "omap_udc iso", udc);
2837 if (status != 0) { 2943 if (status != 0) {
2838 ERR("can't get irq %ld, err %d\n", 2944 ERR("can't get irq %d, err %d\n",
2839 pdev->resource[3].start, status); 2945 (int) pdev->resource[3].start, status);
2840 goto cleanup3; 2946 goto cleanup3;
2841 } 2947 }
2842#endif 2948#endif
2949 if (cpu_is_omap16xx()) {
2950 udc->dc_clk = dc_clk;
2951 udc->hhc_clk = hhc_clk;
2952 clk_disable(hhc_clk);
2953 clk_disable(dc_clk);
2954 }
2955
2956 if (cpu_is_omap24xx()) {
2957 udc->dc_clk = dc_clk;
2958 udc->hhc_clk = hhc_clk;
2959 /* FIXME OMAP2 don't release hhc & dc clock */
2960#if 0
2961 clk_disable(hhc_clk);
2962 clk_disable(dc_clk);
2963#endif
2964 }
2843 2965
2844 create_proc_file(); 2966 create_proc_file();
2845 device_add(&udc->gadget.dev); 2967 status = device_add(&udc->gadget.dev);
2846 return 0; 2968 if (!status)
2847 2969 return status;
2970 /* If fail, fall through */
2848#ifdef USE_ISO 2971#ifdef USE_ISO
2849cleanup3: 2972cleanup3:
2850 free_irq(pdev->resource[2].start, udc); 2973 free_irq(pdev->resource[2].start, udc);
@@ -2860,8 +2983,17 @@ cleanup1:
2860cleanup0: 2983cleanup0:
2861 if (xceiv) 2984 if (xceiv)
2862 put_device(xceiv->dev); 2985 put_device(xceiv->dev);
2986
2987 if (cpu_is_omap16xx() || cpu_is_omap24xx()) {
2988 clk_disable(hhc_clk);
2989 clk_disable(dc_clk);
2990 clk_put(hhc_clk);
2991 clk_put(dc_clk);
2992 }
2993
2863 release_mem_region(pdev->resource[0].start, 2994 release_mem_region(pdev->resource[0].start,
2864 pdev->resource[0].end - pdev->resource[0].start + 1); 2995 pdev->resource[0].end - pdev->resource[0].start + 1);
2996
2865 return status; 2997 return status;
2866} 2998}
2867 2999
@@ -2891,6 +3023,13 @@ static int __exit omap_udc_remove(struct platform_device *pdev)
2891 free_irq(pdev->resource[2].start, udc); 3023 free_irq(pdev->resource[2].start, udc);
2892 free_irq(pdev->resource[1].start, udc); 3024 free_irq(pdev->resource[1].start, udc);
2893 3025
3026 if (udc->dc_clk) {
3027 if (udc->clk_requested)
3028 omap_udc_enable_clock(0);
3029 clk_put(udc->hhc_clk);
3030 clk_put(udc->dc_clk);
3031 }
3032
2894 release_mem_region(pdev->resource[0].start, 3033 release_mem_region(pdev->resource[0].start,
2895 pdev->resource[0].end - pdev->resource[0].start + 1); 3034 pdev->resource[0].end - pdev->resource[0].start + 1);
2896 3035
diff --git a/drivers/usb/gadget/omap_udc.h b/drivers/usb/gadget/omap_udc.h
index 652ee4627344..1dc398bb9ab2 100644
--- a/drivers/usb/gadget/omap_udc.h
+++ b/drivers/usb/gadget/omap_udc.h
@@ -175,6 +175,9 @@ struct omap_udc {
175 unsigned ep0_reset_config:1; 175 unsigned ep0_reset_config:1;
176 unsigned ep0_setup:1; 176 unsigned ep0_setup:1;
177 struct completion *done; 177 struct completion *done;
178 struct clk *dc_clk;
179 struct clk *hhc_clk;
180 unsigned clk_requested:1;
178}; 181};
179 182
180/*-------------------------------------------------------------------------*/ 183/*-------------------------------------------------------------------------*/
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index acd101caeeeb..e0d4c2358b39 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -209,24 +209,16 @@ static int resume_detect_interrupts_are_broken(struct uhci_hcd *uhci)
209 209
210static int remote_wakeup_is_broken(struct uhci_hcd *uhci) 210static int remote_wakeup_is_broken(struct uhci_hcd *uhci)
211{ 211{
212 static struct dmi_system_id broken_wakeup_table[] = {
213 {
214 .ident = "Asus A7V8X",
215 .matches = {
216 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK"),
217 DMI_MATCH(DMI_BOARD_NAME, "A7V8X"),
218 DMI_MATCH(DMI_BOARD_VERSION, "REV 1.xx"),
219 }
220 },
221 { }
222 };
223 int port; 212 int port;
213 char *sys_info;
214 static char bad_Asus_board[] = "A7V8X";
224 215
225 /* One of Asus's motherboards has a bug which causes it to 216 /* One of Asus's motherboards has a bug which causes it to
226 * wake up immediately from suspend-to-RAM if any of the ports 217 * wake up immediately from suspend-to-RAM if any of the ports
227 * are connected. In such cases we will not set EGSM. 218 * are connected. In such cases we will not set EGSM.
228 */ 219 */
229 if (dmi_check_system(broken_wakeup_table)) { 220 sys_info = dmi_get_system_info(DMI_BOARD_NAME);
221 if (sys_info && !strcmp(sys_info, bad_Asus_board)) {
230 for (port = 0; port < uhci->rh_numports; ++port) { 222 for (port = 0; port < uhci->rh_numports; ++port) {
231 if (inw(uhci->io_addr + USBPORTSC1 + port * 2) & 223 if (inw(uhci->io_addr + USBPORTSC1 + port * 2) &
232 USBPORTSC_CCS) 224 USBPORTSC_CCS)
@@ -265,7 +257,9 @@ __acquires(uhci->lock)
265 int_enable = USBINTR_RESUME; 257 int_enable = USBINTR_RESUME;
266 if (remote_wakeup_is_broken(uhci)) 258 if (remote_wakeup_is_broken(uhci))
267 egsm_enable = 0; 259 egsm_enable = 0;
268 if (resume_detect_interrupts_are_broken(uhci) || !egsm_enable) 260 if (resume_detect_interrupts_are_broken(uhci) || !egsm_enable ||
261 !device_may_wakeup(
262 &uhci_to_hcd(uhci)->self.root_hub->dev))
269 uhci->working_RD = int_enable = 0; 263 uhci->working_RD = int_enable = 0;
270 264
271 outw(int_enable, uhci->io_addr + USBINTR); 265 outw(int_enable, uhci->io_addr + USBINTR);
diff --git a/drivers/usb/misc/sisusbvga/sisusb_con.c b/drivers/usb/misc/sisusbvga/sisusb_con.c
index bf26c3c56990..9148694627d5 100644
--- a/drivers/usb/misc/sisusbvga/sisusb_con.c
+++ b/drivers/usb/misc/sisusbvga/sisusb_con.c
@@ -403,7 +403,7 @@ sisusbcon_putc(struct vc_data *c, int ch, int y, int x)
403 403
404 404
405 sisusb_copy_memory(sisusb, (char *)SISUSB_VADDR(x, y), 405 sisusb_copy_memory(sisusb, (char *)SISUSB_VADDR(x, y),
406 (u32)SISUSB_HADDR(x, y), 2, &written); 406 (long)SISUSB_HADDR(x, y), 2, &written);
407 407
408 mutex_unlock(&sisusb->lock); 408 mutex_unlock(&sisusb->lock);
409} 409}
@@ -438,7 +438,7 @@ sisusbcon_putcs(struct vc_data *c, const unsigned short *s,
438 } 438 }
439 439
440 sisusb_copy_memory(sisusb, (char *)SISUSB_VADDR(x, y), 440 sisusb_copy_memory(sisusb, (char *)SISUSB_VADDR(x, y),
441 (u32)SISUSB_HADDR(x, y), count * 2, &written); 441 (long)SISUSB_HADDR(x, y), count * 2, &written);
442 442
443 mutex_unlock(&sisusb->lock); 443 mutex_unlock(&sisusb->lock);
444} 444}
@@ -492,7 +492,7 @@ sisusbcon_clear(struct vc_data *c, int y, int x, int height, int width)
492 492
493 493
494 sisusb_copy_memory(sisusb, (unsigned char *)SISUSB_VADDR(x, y), 494 sisusb_copy_memory(sisusb, (unsigned char *)SISUSB_VADDR(x, y),
495 (u32)SISUSB_HADDR(x, y), length, &written); 495 (long)SISUSB_HADDR(x, y), length, &written);
496 496
497 mutex_unlock(&sisusb->lock); 497 mutex_unlock(&sisusb->lock);
498} 498}
@@ -564,7 +564,7 @@ sisusbcon_bmove(struct vc_data *c, int sy, int sx,
564 564
565 565
566 sisusb_copy_memory(sisusb, (unsigned char *)SISUSB_VADDR(dx, dy), 566 sisusb_copy_memory(sisusb, (unsigned char *)SISUSB_VADDR(dx, dy),
567 (u32)SISUSB_HADDR(dx, dy), length, &written); 567 (long)SISUSB_HADDR(dx, dy), length, &written);
568 568
569 mutex_unlock(&sisusb->lock); 569 mutex_unlock(&sisusb->lock);
570} 570}
@@ -612,7 +612,7 @@ sisusbcon_switch(struct vc_data *c)
612 length); 612 length);
613 613
614 sisusb_copy_memory(sisusb, (unsigned char *)c->vc_origin, 614 sisusb_copy_memory(sisusb, (unsigned char *)c->vc_origin,
615 (u32)SISUSB_HADDR(0, 0), 615 (long)SISUSB_HADDR(0, 0),
616 length, &written); 616 length, &written);
617 617
618 mutex_unlock(&sisusb->lock); 618 mutex_unlock(&sisusb->lock);
@@ -939,7 +939,7 @@ sisusbcon_scroll_area(struct vc_data *c, struct sisusb_usb_data *sisusb,
939 } 939 }
940 940
941 sisusb_copy_memory(sisusb, (char *)SISUSB_VADDR(0, t), 941 sisusb_copy_memory(sisusb, (char *)SISUSB_VADDR(0, t),
942 (u32)SISUSB_HADDR(0, t), length, &written); 942 (long)SISUSB_HADDR(0, t), length, &written);
943 943
944 mutex_unlock(&sisusb->lock); 944 mutex_unlock(&sisusb->lock);
945 945
diff --git a/drivers/usb/net/asix.c b/drivers/usb/net/asix.c
index 95e682e2c9d6..f538013965b0 100644
--- a/drivers/usb/net/asix.c
+++ b/drivers/usb/net/asix.c
@@ -920,7 +920,7 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
920 goto out2; 920 goto out2;
921 921
922 if ((ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, 922 if ((ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT,
923 0x0000, 0, 0, buf)) < 0) { 923 1, 0, 0, buf)) < 0) {
924 dbg("Select PHY #1 failed: %d", ret); 924 dbg("Select PHY #1 failed: %d", ret);
925 goto out2; 925 goto out2;
926 } 926 }
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig
index 2f4d303ee36f..c8999ae58652 100644
--- a/drivers/usb/serial/Kconfig
+++ b/drivers/usb/serial/Kconfig
@@ -170,7 +170,7 @@ config USB_SERIAL_FTDI_SIO
170 170
171config USB_SERIAL_FUNSOFT 171config USB_SERIAL_FUNSOFT
172 tristate "USB Fundamental Software Dongle Driver" 172 tristate "USB Fundamental Software Dongle Driver"
173 depends on USB_SERIAL 173 depends on USB_SERIAL && !(SPARC || SPARC64)
174 ---help--- 174 ---help---
175 Say Y here if you want to use the Fundamental Software dongle. 175 Say Y here if you want to use the Fundamental Software dongle.
176 176
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 819266b7e2f8..5ca04e82ea19 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -625,6 +625,9 @@ static int option_send_setup(struct usb_serial_port *port)
625 625
626 dbg("%s", __FUNCTION__); 626 dbg("%s", __FUNCTION__);
627 627
628 if (port->number != 0)
629 return 0;
630
628 portdata = usb_get_serial_port_data(port); 631 portdata = usb_get_serial_port_data(port);
629 632
630 if (port->tty) { 633 if (port->tty) {
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 5fe7ff441a09..cddef3efba0a 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -728,7 +728,7 @@ UNUSUAL_DEV( 0x05ac, 0x1204, 0x0000, 0x9999,
728 "Apple", 728 "Apple",
729 "iPod", 729 "iPod",
730 US_SC_DEVICE, US_PR_DEVICE, NULL, 730 US_SC_DEVICE, US_PR_DEVICE, NULL,
731 US_FL_FIX_CAPACITY ), 731 US_FL_FIX_CAPACITY | US_FL_NOT_LOCKABLE ),
732 732
733UNUSUAL_DEV( 0x05ac, 0x1205, 0x0000, 0x9999, 733UNUSUAL_DEV( 0x05ac, 0x1205, 0x0000, 0x9999,
734 "Apple", 734 "Apple",
@@ -1358,6 +1358,21 @@ UNUSUAL_DEV( 0x1370, 0x6828, 0x0110, 0x0110,
1358 US_SC_DEVICE, US_PR_DEVICE, NULL, 1358 US_SC_DEVICE, US_PR_DEVICE, NULL,
1359 US_FL_IGNORE_RESIDUE ), 1359 US_FL_IGNORE_RESIDUE ),
1360 1360
1361/* Reported by Francesco Foresti <frafore@tiscali.it> */
1362UNUSUAL_DEV( 0x14cd, 0x6600, 0x0201, 0x0201,
1363 "Super Top",
1364 "IDE DEVICE",
1365 US_SC_DEVICE, US_PR_DEVICE, NULL,
1366 US_FL_IGNORE_RESIDUE ),
1367
1368/* Reported by Robert Schedel <r.schedel@yahoo.de>
1369 * Note: this is a 'super top' device like the above 14cd/6600 device */
1370UNUSUAL_DEV( 0x1652, 0x6600, 0x0201, 0x0201,
1371 "Teac",
1372 "HD-35PUK-B",
1373 US_SC_DEVICE, US_PR_DEVICE, NULL,
1374 US_FL_IGNORE_RESIDUE ),
1375
1361/* patch submitted by Davide Perini <perini.davide@dpsoftware.org> 1376/* patch submitted by Davide Perini <perini.davide@dpsoftware.org>
1362 * and Renato Perini <rperini@email.it> 1377 * and Renato Perini <rperini@email.it>
1363 */ 1378 */