Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+235 -76
+4
Documentation/usb/acm.txt
··· 46 46 47 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 53 Unfortunately many modems and most ISDN TAs use proprietary interfaces and 50 54 thus won't work with this drivers. Check for ACM compliance before buying. 51 55
+1
drivers/usb/class/usblp.c
··· 217 217 { 0x0409, 0xbef4, USBLP_QUIRK_BIDIR }, /* NEC Picty760 (HP OEM) */ 218 218 { 0x0409, 0xf0be, USBLP_QUIRK_BIDIR }, /* NEC Picty920 (HP OEM) */ 219 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 221 { 0, 0 } 221 222 }; 222 223
+1 -1
drivers/usb/core/endpoint.c
··· 268 268 struct ep_device *ep_dev = to_ep_device(dev); 269 269 270 270 dev_dbg(dev, "%s called for %s\n", __FUNCTION__, dev->bus_id); 271 + endpoint_free_minor(ep_dev); 271 272 kfree(ep_dev); 272 273 } 273 274 ··· 350 349 sprintf(name, "ep_%02x", endpoint->desc.bEndpointAddress); 351 350 sysfs_remove_link(&ep_dev->dev.parent->kobj, name); 352 351 sysfs_remove_group(&ep_dev->dev.kobj, &ep_dev_attr_grp); 353 - endpoint_free_minor(ep_dev); 354 352 device_unregister(&ep_dev->dev); 355 353 endpoint->ep_dev = NULL; 356 354 destroy_endpoint_class();
+192 -53
drivers/usb/gadget/omap_udc.c
··· 42 42 #include <linux/usb_gadget.h> 43 43 #include <linux/usb/otg.h> 44 44 #include <linux/dma-mapping.h> 45 + #include <linux/clk.h> 45 46 46 47 #include <asm/byteorder.h> 47 48 #include <asm/io.h> ··· 60 59 61 60 /* bulk DMA seems to be behaving for both IN and OUT */ 62 61 #define USE_DMA 62 + 63 + /* FIXME: OMAP2 currently has some problem in DMA mode */ 64 + #ifdef CONFIG_ARCH_OMAP2 65 + #undef USE_DMA 66 + #endif 63 67 64 68 /* ISO too */ 65 69 #define USE_ISO ··· 105 99 * boot parameter "omap_udc:fifo_mode=42" 106 100 */ 107 101 module_param (fifo_mode, uint, 0); 108 - MODULE_PARM_DESC (fifo_mode, "endpoint setup (0 == default)"); 102 + MODULE_PARM_DESC (fifo_mode, "endpoint configuration"); 109 103 110 104 #ifdef USE_DMA 111 105 static unsigned use_dma = 1; ··· 128 122 /*-------------------------------------------------------------------------*/ 129 123 130 124 /* there's a notion of "current endpoint" for modifying endpoint 131 - * state, and PIO access to its FIFO. 125 + * state, and PIO access to its FIFO. 132 126 */ 133 127 134 128 static void use_ep(struct omap_ep *ep, u16 select) ··· 397 391 #define FIFO_EMPTY (UDC_NON_ISO_FIFO_EMPTY | UDC_ISO_FIFO_EMPTY) 398 392 #define FIFO_UNREADABLE (UDC_EP_HALTED | FIFO_EMPTY) 399 393 400 - static inline int 394 + static inline int 401 395 write_packet(u8 *buf, struct omap_req *req, unsigned max) 402 396 { 403 397 unsigned len; ··· 462 456 return is_last; 463 457 } 464 458 465 - static inline int 459 + static inline int 466 460 read_packet(u8 *buf, struct omap_req *req, unsigned avail) 467 461 { 468 462 unsigned len; ··· 548 542 /* omap 3.2/3.3 erratum: sometimes 0 is returned if CSAC/CDAC is 549 543 * read before the DMA controller finished disabling the channel. 550 544 */ 551 - csac = omap_readw(OMAP_DMA_CSAC(lch)); 545 + csac = OMAP_DMA_CSAC_REG(lch); 552 546 if (csac == 0) 553 - csac = omap_readw(OMAP_DMA_CSAC(lch)); 547 + csac = OMAP_DMA_CSAC_REG(lch); 554 548 return csac; 555 549 } 556 550 ··· 561 555 /* omap 3.2/3.3 erratum: sometimes 0 is returned if CSAC/CDAC is 562 556 * read before the DMA controller finished disabling the channel. 563 557 */ 564 - cdac = omap_readw(OMAP_DMA_CDAC(lch)); 558 + cdac = OMAP_DMA_CDAC_REG(lch); 565 559 if (cdac == 0) 566 - cdac = omap_readw(OMAP_DMA_CDAC(lch)); 560 + cdac = OMAP_DMA_CDAC_REG(lch); 567 561 return cdac; 568 562 } 569 563 ··· 588 582 } 589 583 590 584 #define DMA_DEST_LAST(x) (cpu_is_omap15xx() \ 591 - ? omap_readw(OMAP_DMA_CSAC(x)) /* really: CPC */ \ 585 + ? OMAP_DMA_CSAC_REG(x) /* really: CPC */ \ 592 586 : dma_cdac(x)) 593 587 594 588 static u16 dma_dest_len(struct omap_ep *ep, dma_addr_t start) ··· 626 620 || (cpu_is_omap15xx() && length < ep->maxpacket)) { 627 621 txdma_ctrl = UDC_TXN_EOT | length; 628 622 omap_set_dma_transfer_params(ep->lch, OMAP_DMA_DATA_TYPE_S8, 629 - length, 1, sync_mode); 623 + length, 1, sync_mode, 0, 0); 630 624 } else { 631 625 length = min(length / ep->maxpacket, 632 626 (unsigned) UDC_TXN_TSC + 1); 633 - txdma_ctrl = length; 627 + txdma_ctrl = length; 634 628 omap_set_dma_transfer_params(ep->lch, OMAP_DMA_DATA_TYPE_S16, 635 - ep->ep.maxpacket >> 1, length, sync_mode); 629 + ep->ep.maxpacket >> 1, length, sync_mode, 630 + 0, 0); 636 631 length *= ep->maxpacket; 637 632 } 638 633 omap_set_dma_src_params(ep->lch, OMAP_DMA_PORT_EMIFF, 639 - OMAP_DMA_AMODE_POST_INC, req->req.dma + req->req.actual); 634 + OMAP_DMA_AMODE_POST_INC, req->req.dma + req->req.actual, 635 + 0, 0); 640 636 641 637 omap_start_dma(ep->lch); 642 638 ep->dma_counter = dma_csac(ep->lch); ··· 683 675 req->dma_bytes = packets * ep->ep.maxpacket; 684 676 omap_set_dma_transfer_params(ep->lch, OMAP_DMA_DATA_TYPE_S16, 685 677 ep->ep.maxpacket >> 1, packets, 686 - OMAP_DMA_SYNC_ELEMENT); 678 + OMAP_DMA_SYNC_ELEMENT, 679 + 0, 0); 687 680 omap_set_dma_dest_params(ep->lch, OMAP_DMA_PORT_EMIFF, 688 - OMAP_DMA_AMODE_POST_INC, req->req.dma + req->req.actual); 681 + OMAP_DMA_AMODE_POST_INC, req->req.dma + req->req.actual, 682 + 0, 0); 689 683 ep->dma_counter = DMA_DEST_LAST(ep->lch); 690 684 691 685 UDC_RXDMA_REG(ep->dma_channel) = UDC_RXN_STOP | (packets - 1); ··· 830 820 omap_set_dma_dest_params(ep->lch, 831 821 OMAP_DMA_PORT_TIPB, 832 822 OMAP_DMA_AMODE_CONSTANT, 833 - (unsigned long) io_v2p((u32)&UDC_DATA_DMA_REG)); 823 + (unsigned long) io_v2p((u32)&UDC_DATA_DMA_REG), 824 + 0, 0); 834 825 } 835 826 } else { 836 827 status = omap_request_dma(OMAP_DMA_USB_W2FC_RX0 - 1 + channel, ··· 842 831 omap_set_dma_src_params(ep->lch, 843 832 OMAP_DMA_PORT_TIPB, 844 833 OMAP_DMA_AMODE_CONSTANT, 845 - (unsigned long) io_v2p((u32)&UDC_DATA_DMA_REG)); 834 + (unsigned long) io_v2p((u32)&UDC_DATA_DMA_REG), 835 + 0, 0); 846 836 /* EMIFF */ 847 837 omap_set_dma_dest_burst_mode(ep->lch, 848 838 OMAP_DMA_DATA_BURST_4); ··· 858 846 859 847 /* channel type P: hw synch (fifo) */ 860 848 if (!cpu_is_omap15xx()) 861 - omap_writew(2, OMAP_DMA_LCH_CTRL(ep->lch)); 849 + OMAP1_DMA_LCH_CTRL_REG(ep->lch) = 2; 862 850 } 863 851 864 852 just_restart: ··· 905 893 else 906 894 req = NULL; 907 895 908 - active = ((1 << 7) & omap_readl(OMAP_DMA_CCR(ep->lch))) != 0; 896 + active = ((1 << 7) & OMAP_DMA_CCR_REG(ep->lch)) != 0; 909 897 910 898 DBG("%s release %s %cxdma%d %p\n", ep->ep.name, 911 899 active ? "active" : "idle", ··· 1129 1117 */ 1130 1118 dma_channel_release(ep); 1131 1119 dma_channel_claim(ep, channel); 1132 - } else 1120 + } else 1133 1121 done(ep, req, -ECONNRESET); 1134 1122 spin_unlock_irqrestore(&ep->udc->lock, flags); 1135 1123 return 0; ··· 1165 1153 1166 1154 /* IN endpoints must already be idle */ 1167 1155 if ((ep->bEndpointAddress & USB_DIR_IN) 1168 - && !list_empty(&ep->queue)) { 1156 + && !list_empty(&ep->queue)) { 1169 1157 status = -EAGAIN; 1170 1158 goto done; 1171 1159 } ··· 1310 1298 UDC_SYSCON1_REG &= ~UDC_PULLUP_EN; 1311 1299 } 1312 1300 1301 + static struct omap_udc *udc; 1302 + 1303 + static void omap_udc_enable_clock(int enable) 1304 + { 1305 + if (udc == NULL || udc->dc_clk == NULL || udc->hhc_clk == NULL) 1306 + return; 1307 + 1308 + if (enable) { 1309 + clk_enable(udc->dc_clk); 1310 + clk_enable(udc->hhc_clk); 1311 + udelay(100); 1312 + } else { 1313 + clk_disable(udc->hhc_clk); 1314 + clk_disable(udc->dc_clk); 1315 + } 1316 + } 1317 + 1313 1318 /* 1314 1319 * Called by whatever detects VBUS sessions: external transceiver 1315 1320 * driver, or maybe GPIO0 VBUS IRQ. May request 48 MHz clock. ··· 1347 1318 else 1348 1319 FUNC_MUX_CTRL_0_REG &= ~VBUS_CTRL_1510; 1349 1320 } 1321 + if (udc->dc_clk != NULL && is_active) { 1322 + if (!udc->clk_requested) { 1323 + omap_udc_enable_clock(1); 1324 + udc->clk_requested = 1; 1325 + } 1326 + } 1350 1327 if (can_pullup(udc)) 1351 1328 pullup_enable(udc); 1352 1329 else 1353 1330 pullup_disable(udc); 1331 + if (udc->dc_clk != NULL && !is_active) { 1332 + if (udc->clk_requested) { 1333 + omap_udc_enable_clock(0); 1334 + udc->clk_requested = 0; 1335 + } 1336 + } 1354 1337 spin_unlock_irqrestore(&udc->lock, flags); 1355 1338 return 0; 1356 1339 } ··· 1482 1441 } 1483 1442 } 1484 1443 1485 - /* IN/OUT packets mean we're in the DATA or STATUS stage. 1444 + /* IN/OUT packets mean we're in the DATA or STATUS stage. 1486 1445 * This driver uses only uses protocol stalls (ep0 never halts), 1487 1446 * and if we got this far the gadget driver already had a 1488 1447 * chance to stall. Tries to be forgiving of host oddities. ··· 1550 1509 } else if (stat == 0) 1551 1510 UDC_CTRL_REG = UDC_SET_FIFO_EN; 1552 1511 UDC_EP_NUM_REG = 0; 1553 - 1512 + 1554 1513 /* activate status stage */ 1555 1514 if (stat == 1) { 1556 1515 done(ep0, req, 0); ··· 1907 1866 1908 1867 spin_lock_irqsave(&ep->udc->lock, flags); 1909 1868 if (!list_empty(&ep->queue) && ep->ackwait) { 1910 - use_ep(ep, 0); 1869 + use_ep(ep, UDC_EP_SEL); 1911 1870 stat_flg = UDC_STAT_FLG_REG; 1912 1871 1913 1872 if ((stat_flg & UDC_ACK) && (!(stat_flg & UDC_FIFO_EN) ··· 1917 1876 VDBG("%s: lose, %04x\n", ep->ep.name, stat_flg); 1918 1877 req = container_of(ep->queue.next, 1919 1878 struct omap_req, queue); 1920 - UDC_EP_NUM_REG = ep->bEndpointAddress | UDC_EP_SEL; 1921 1879 (void) read_fifo(ep, req); 1922 1880 UDC_EP_NUM_REG = ep->bEndpointAddress; 1923 1881 UDC_CTRL_REG = UDC_SET_FIFO_EN; 1924 1882 ep->ackwait = 1 + ep->double_buf; 1925 - } 1883 + } else 1884 + deselect_ep(); 1926 1885 } 1927 1886 mod_timer(&ep->timer, PIO_OUT_TIMEOUT); 1928 1887 spin_unlock_irqrestore(&ep->udc->lock, flags); ··· 2069 2028 2070 2029 /*-------------------------------------------------------------------------*/ 2071 2030 2072 - static struct omap_udc *udc; 2031 + static inline int machine_needs_vbus_session(void) 2032 + { 2033 + return (machine_is_omap_innovator() 2034 + || machine_is_omap_osk() 2035 + || machine_is_omap_apollon() 2036 + #ifndef CONFIG_MACH_OMAP_H4_OTG 2037 + || machine_is_omap_h4() 2038 + #endif 2039 + || machine_is_sx1() 2040 + ); 2041 + } 2073 2042 2074 2043 int usb_gadget_register_driver (struct usb_gadget_driver *driver) 2075 2044 { ··· 2121 2070 udc->gadget.dev.driver = &driver->driver; 2122 2071 spin_unlock_irqrestore(&udc->lock, flags); 2123 2072 2073 + if (udc->dc_clk != NULL) 2074 + omap_udc_enable_clock(1); 2075 + 2124 2076 status = driver->bind (&udc->gadget); 2125 2077 if (status) { 2126 2078 DBG("bind to %s --> %d\n", driver->driver.name, status); ··· 2157 2103 /* boards that don't have VBUS sensing can't autogate 48MHz; 2158 2104 * can't enter deep sleep while a gadget driver is active. 2159 2105 */ 2160 - if (machine_is_omap_innovator() || machine_is_omap_osk()) 2106 + if (machine_needs_vbus_session()) 2161 2107 omap_vbus_session(&udc->gadget, 1); 2162 2108 2163 2109 done: 2110 + if (udc->dc_clk != NULL) 2111 + omap_udc_enable_clock(0); 2164 2112 return status; 2165 2113 } 2166 2114 EXPORT_SYMBOL(usb_gadget_register_driver); ··· 2177 2121 if (!driver || driver != udc->driver || !driver->unbind) 2178 2122 return -EINVAL; 2179 2123 2180 - if (machine_is_omap_innovator() || machine_is_omap_osk()) 2124 + if (udc->dc_clk != NULL) 2125 + omap_udc_enable_clock(1); 2126 + 2127 + if (machine_needs_vbus_session()) 2181 2128 omap_vbus_session(&udc->gadget, 0); 2182 2129 2183 2130 if (udc->transceiver) ··· 2196 2137 udc->gadget.dev.driver = NULL; 2197 2138 udc->driver = NULL; 2198 2139 2140 + if (udc->dc_clk != NULL) 2141 + omap_udc_enable_clock(0); 2199 2142 DBG("unregistered driver '%s'\n", driver->driver.name); 2200 2143 return status; 2201 2144 } ··· 2280 2219 case 0: return enabled ? "*6wire" : "unused"; 2281 2220 case 1: return "4wire"; 2282 2221 case 2: return "3wire"; 2283 - case 3: return "6wire"; 2222 + case 3: return "6wire"; 2284 2223 default: return "unknown"; 2285 2224 } 2286 2225 } ··· 2289 2228 { 2290 2229 u32 tmp; 2291 2230 u32 trans; 2231 + char *ctrl_name; 2292 2232 2293 2233 tmp = OTG_REV_REG; 2294 - trans = USB_TRANSCEIVER_CTRL_REG; 2295 - seq_printf(s, "\nOTG rev %d.%d, transceiver_ctrl %05x\n", 2296 - tmp >> 4, tmp & 0xf, trans); 2234 + if (cpu_is_omap24xx()) { 2235 + ctrl_name = "control_devconf"; 2236 + trans = CONTROL_DEVCONF_REG; 2237 + } else { 2238 + ctrl_name = "tranceiver_ctrl"; 2239 + trans = USB_TRANSCEIVER_CTRL_REG; 2240 + } 2241 + seq_printf(s, "\nOTG rev %d.%d, %s %05x\n", 2242 + tmp >> 4, tmp & 0xf, ctrl_name, trans); 2297 2243 tmp = OTG_SYSCON_1_REG; 2298 2244 seq_printf(s, "otg_syscon1 %08x usb2 %s, usb1 %s, usb0 %s," 2299 2245 FOURBITS "\n", tmp, ··· 2375 2307 driver_desc, 2376 2308 use_dma ? " (dma)" : ""); 2377 2309 2378 - tmp = UDC_REV_REG & 0xff; 2310 + tmp = UDC_REV_REG & 0xff; 2379 2311 seq_printf(s, 2380 2312 "UDC rev %d.%d, fifo mode %d, gadget %s\n" 2381 2313 "hmc %d, transceiver %s\n", ··· 2383 2315 fifo_mode, 2384 2316 udc->driver ? udc->driver->driver.name : "(none)", 2385 2317 HMC, 2386 - udc->transceiver ? udc->transceiver->label : "(none)"); 2387 - seq_printf(s, "ULPD control %04x req %04x status %04x\n", 2388 - __REG16(ULPD_CLOCK_CTRL), 2389 - __REG16(ULPD_SOFT_REQ), 2390 - __REG16(ULPD_STATUS_REQ)); 2318 + udc->transceiver 2319 + ? udc->transceiver->label 2320 + : ((cpu_is_omap1710() || cpu_is_omap24xx()) 2321 + ? "external" : "(none)")); 2322 + if (cpu_class_is_omap1()) { 2323 + seq_printf(s, "ULPD control %04x req %04x status %04x\n", 2324 + __REG16(ULPD_CLOCK_CTRL), 2325 + __REG16(ULPD_SOFT_REQ), 2326 + __REG16(ULPD_STATUS_REQ)); 2327 + } 2391 2328 2392 2329 /* OTG controller registers */ 2393 2330 if (!cpu_is_omap15xx()) ··· 2577 2504 dbuf = 1; 2578 2505 } else { 2579 2506 /* double-buffering "not supported" on 15xx, 2580 - * and ignored for PIO-IN on 16xx 2507 + * and ignored for PIO-IN on newer chips 2508 + * (for more reliable behavior) 2581 2509 */ 2582 - if (!use_dma || cpu_is_omap15xx()) 2510 + if (!use_dma || cpu_is_omap15xx() || cpu_is_omap24xx()) 2583 2511 dbuf = 0; 2584 2512 2585 2513 switch (maxp) { ··· 2623 2549 ep->bEndpointAddress = addr; 2624 2550 ep->bmAttributes = type; 2625 2551 ep->double_buf = dbuf; 2626 - ep->udc = udc; 2552 + ep->udc = udc; 2627 2553 2628 2554 ep->ep.name = ep->name; 2629 2555 ep->ep.ops = &omap_ep_ops; ··· 2783 2709 struct otg_transceiver *xceiv = NULL; 2784 2710 const char *type = NULL; 2785 2711 struct omap_usb_config *config = pdev->dev.platform_data; 2712 + struct clk *dc_clk; 2713 + struct clk *hhc_clk; 2786 2714 2787 2715 /* NOTE: "knows" the order of the resources! */ 2788 - if (!request_mem_region(pdev->resource[0].start, 2716 + if (!request_mem_region(pdev->resource[0].start, 2789 2717 pdev->resource[0].end - pdev->resource[0].start + 1, 2790 2718 driver_name)) { 2791 2719 DBG("request_mem_region failed\n"); 2792 2720 return -EBUSY; 2721 + } 2722 + 2723 + if (cpu_is_omap16xx()) { 2724 + dc_clk = clk_get(&pdev->dev, "usb_dc_ck"); 2725 + hhc_clk = clk_get(&pdev->dev, "usb_hhc_ck"); 2726 + BUG_ON(IS_ERR(dc_clk) || IS_ERR(hhc_clk)); 2727 + /* can't use omap_udc_enable_clock yet */ 2728 + clk_enable(dc_clk); 2729 + clk_enable(hhc_clk); 2730 + udelay(100); 2731 + } 2732 + 2733 + if (cpu_is_omap24xx()) { 2734 + dc_clk = clk_get(&pdev->dev, "usb_fck"); 2735 + hhc_clk = clk_get(&pdev->dev, "usb_l4_ick"); 2736 + BUG_ON(IS_ERR(dc_clk) || IS_ERR(hhc_clk)); 2737 + /* can't use omap_udc_enable_clock yet */ 2738 + clk_enable(dc_clk); 2739 + clk_enable(hhc_clk); 2740 + udelay(100); 2793 2741 } 2794 2742 2795 2743 INFO("OMAP UDC rev %d.%d%s\n", ··· 2823 2727 hmc = HMC_1510; 2824 2728 type = "(unknown)"; 2825 2729 2826 - if (machine_is_omap_innovator()) { 2730 + if (machine_is_omap_innovator() || machine_is_sx1()) { 2827 2731 /* just set up software VBUS detect, and then 2828 2732 * later rig it so we always report VBUS. 2829 2733 * FIXME without really sensing VBUS, we can't ··· 2852 2756 } 2853 2757 2854 2758 hmc = HMC_1610; 2759 + 2760 + if (cpu_is_omap24xx()) { 2761 + /* this could be transceiverless in one of the 2762 + * "we don't need to know" modes. 2763 + */ 2764 + type = "external"; 2765 + goto known; 2766 + } 2767 + 2855 2768 switch (hmc) { 2856 2769 case 0: /* POWERUP DEFAULT == 0 */ 2857 2770 case 4: ··· 2899 2794 goto cleanup0; 2900 2795 } 2901 2796 } 2797 + known: 2902 2798 INFO("hmc mode %d, %s transceiver\n", hmc, type); 2903 2799 2904 2800 /* a "gadget" abstracts/virtualizes the controller */ ··· 2924 2818 status = request_irq(pdev->resource[1].start, omap_udc_irq, 2925 2819 IRQF_SAMPLE_RANDOM, driver_name, udc); 2926 2820 if (status != 0) { 2927 - ERR( "can't get irq %ld, err %d\n", 2928 - pdev->resource[1].start, status); 2821 + ERR("can't get irq %d, err %d\n", 2822 + (int) pdev->resource[1].start, status); 2929 2823 goto cleanup1; 2930 2824 } 2931 2825 ··· 2933 2827 status = request_irq(pdev->resource[2].start, omap_udc_pio_irq, 2934 2828 IRQF_SAMPLE_RANDOM, "omap_udc pio", udc); 2935 2829 if (status != 0) { 2936 - ERR( "can't get irq %ld, err %d\n", 2937 - pdev->resource[2].start, status); 2830 + ERR("can't get irq %d, err %d\n", 2831 + (int) pdev->resource[2].start, status); 2938 2832 goto cleanup2; 2939 2833 } 2940 2834 #ifdef USE_ISO 2941 2835 status = request_irq(pdev->resource[3].start, omap_udc_iso_irq, 2942 2836 IRQF_DISABLED, "omap_udc iso", udc); 2943 2837 if (status != 0) { 2944 - ERR("can't get irq %ld, err %d\n", 2945 - pdev->resource[3].start, status); 2838 + ERR("can't get irq %d, err %d\n", 2839 + (int) pdev->resource[3].start, status); 2946 2840 goto cleanup3; 2947 2841 } 2948 2842 #endif 2843 + if (cpu_is_omap16xx()) { 2844 + udc->dc_clk = dc_clk; 2845 + udc->hhc_clk = hhc_clk; 2846 + clk_disable(hhc_clk); 2847 + clk_disable(dc_clk); 2848 + } 2849 + 2850 + if (cpu_is_omap24xx()) { 2851 + udc->dc_clk = dc_clk; 2852 + udc->hhc_clk = hhc_clk; 2853 + /* FIXME OMAP2 don't release hhc & dc clock */ 2854 + #if 0 2855 + clk_disable(hhc_clk); 2856 + clk_disable(dc_clk); 2857 + #endif 2858 + } 2949 2859 2950 2860 create_proc_file(); 2951 - device_add(&udc->gadget.dev); 2952 - return 0; 2953 - 2861 + status = device_add(&udc->gadget.dev); 2862 + if (!status) 2863 + return status; 2864 + /* If fail, fall through */ 2954 2865 #ifdef USE_ISO 2955 2866 cleanup3: 2956 2867 free_irq(pdev->resource[2].start, udc); ··· 2983 2860 cleanup0: 2984 2861 if (xceiv) 2985 2862 put_device(xceiv->dev); 2863 + 2864 + if (cpu_is_omap16xx() || cpu_is_omap24xx()) { 2865 + clk_disable(hhc_clk); 2866 + clk_disable(dc_clk); 2867 + clk_put(hhc_clk); 2868 + clk_put(dc_clk); 2869 + } 2870 + 2986 2871 release_mem_region(pdev->resource[0].start, 2987 2872 pdev->resource[0].end - pdev->resource[0].start + 1); 2873 + 2988 2874 return status; 2989 2875 } 2990 2876 ··· 3022 2890 #endif 3023 2891 free_irq(pdev->resource[2].start, udc); 3024 2892 free_irq(pdev->resource[1].start, udc); 2893 + 2894 + if (udc->dc_clk) { 2895 + if (udc->clk_requested) 2896 + omap_udc_enable_clock(0); 2897 + clk_put(udc->hhc_clk); 2898 + clk_put(udc->dc_clk); 2899 + } 3025 2900 3026 2901 release_mem_region(pdev->resource[0].start, 3027 2902 pdev->resource[0].end - pdev->resource[0].start + 1);
+3
drivers/usb/gadget/omap_udc.h
··· 175 175 unsigned ep0_reset_config:1; 176 176 unsigned ep0_setup:1; 177 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 /*-------------------------------------------------------------------------*/
+7 -13
drivers/usb/host/uhci-hcd.c
··· 209 209 210 210 static 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 212 int port; 213 + char *sys_info; 214 + static char bad_Asus_board[] = "A7V8X"; 224 215 225 216 /* One of Asus's motherboards has a bug which causes it to 226 217 * wake up immediately from suspend-to-RAM if any of the ports 227 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 222 for (port = 0; port < uhci->rh_numports; ++port) { 231 223 if (inw(uhci->io_addr + USBPORTSC1 + port * 2) & 232 224 USBPORTSC_CCS) ··· 257 265 int_enable = USBINTR_RESUME; 258 266 if (remote_wakeup_is_broken(uhci)) 259 267 egsm_enable = 0; 260 - if (resume_detect_interrupts_are_broken(uhci) || !egsm_enable) 268 + if (resume_detect_interrupts_are_broken(uhci) || !egsm_enable || 269 + !device_may_wakeup( 270 + &uhci_to_hcd(uhci)->self.root_hub->dev)) 261 271 uhci->working_RD = int_enable = 0; 262 272 263 273 outw(int_enable, uhci->io_addr + USBINTR);
+6 -6
drivers/usb/misc/sisusbvga/sisusb_con.c
··· 403 403 404 404 405 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 408 mutex_unlock(&sisusb->lock); 409 409 } ··· 438 438 } 439 439 440 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 443 mutex_unlock(&sisusb->lock); 444 444 } ··· 492 492 493 493 494 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 497 mutex_unlock(&sisusb->lock); 498 498 } ··· 564 564 565 565 566 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 569 mutex_unlock(&sisusb->lock); 570 570 } ··· 612 612 length); 613 613 614 614 sisusb_copy_memory(sisusb, (unsigned char *)c->vc_origin, 615 - (u32)SISUSB_HADDR(0, 0), 615 + (long)SISUSB_HADDR(0, 0), 616 616 length, &written); 617 617 618 618 mutex_unlock(&sisusb->lock); ··· 939 939 } 940 940 941 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 944 mutex_unlock(&sisusb->lock); 945 945
+1 -1
drivers/usb/net/asix.c
··· 920 920 goto out2; 921 921 922 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 924 dbg("Select PHY #1 failed: %d", ret); 925 925 goto out2; 926 926 }
+1 -1
drivers/usb/serial/Kconfig
··· 170 170 171 171 config USB_SERIAL_FUNSOFT 172 172 tristate "USB Fundamental Software Dongle Driver" 173 - depends on USB_SERIAL 173 + depends on USB_SERIAL && !(SPARC || SPARC64) 174 174 ---help--- 175 175 Say Y here if you want to use the Fundamental Software dongle. 176 176
+3
drivers/usb/serial/option.c
··· 625 625 626 626 dbg("%s", __FUNCTION__); 627 627 628 + if (port->number != 0) 629 + return 0; 630 + 628 631 portdata = usb_get_serial_port_data(port); 629 632 630 633 if (port->tty) {
+16 -1
drivers/usb/storage/unusual_devs.h
··· 728 728 "Apple", 729 729 "iPod", 730 730 US_SC_DEVICE, US_PR_DEVICE, NULL, 731 - US_FL_FIX_CAPACITY ), 731 + US_FL_FIX_CAPACITY | US_FL_NOT_LOCKABLE ), 732 732 733 733 UNUSUAL_DEV( 0x05ac, 0x1205, 0x0000, 0x9999, 734 734 "Apple", ··· 1355 1355 UNUSUAL_DEV( 0x1370, 0x6828, 0x0110, 0x0110, 1356 1356 "SWISSBIT", 1357 1357 "Black Silver", 1358 + US_SC_DEVICE, US_PR_DEVICE, NULL, 1359 + US_FL_IGNORE_RESIDUE ), 1360 + 1361 + /* Reported by Francesco Foresti <frafore@tiscali.it> */ 1362 + UNUSUAL_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 */ 1370 + UNUSUAL_DEV( 0x1652, 0x6600, 0x0201, 0x0201, 1371 + "Teac", 1372 + "HD-35PUK-B", 1358 1373 US_SC_DEVICE, US_PR_DEVICE, NULL, 1359 1374 US_FL_IGNORE_RESIDUE ), 1360 1375