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: unusual_devs.h entry for nokia 6233
USB: Fix for typo in ohci-ep93xx.c
USB: disable USB_MULTITHREAD_PROBE
USB: add vendor/device id for Option GT Max 3.6 cards
USB: unusual_devs.h for 0x046b:ff40
USB: make usbhid ignore Imation Disc Stakka
USB: rndis_host: fix crash while probing a Nokia S60 mobile
USB: asix: Detect internal PHY and enable/use accordingly
usbtouchscreen: make ITM screens report BTN_TOUCH as zero when not touched

+114 -78
-16
drivers/usb/core/Kconfig
··· 72 72 73 73 If you are unsure about this, say N here. 74 74 75 - config USB_MULTITHREAD_PROBE 76 - bool "USB Multi-threaded probe (EXPERIMENTAL)" 77 - depends on USB && EXPERIMENTAL 78 - default n 79 - help 80 - Say Y here if you want the USB core to spawn a new thread for 81 - every USB device that is probed. This can cause a small speedup 82 - in boot times on systems with a lot of different USB devices. 83 - 84 - This option should be safe to enable, but if any odd probing 85 - problems are found, please disable it, or dynamically turn it 86 - off in the /sys/module/usbcore/parameters/multithread_probe 87 - file 88 - 89 - When in doubt, say N. 90 - 91 75 config USB_OTG 92 76 bool 93 77 depends on USB && EXPERIMENTAL
+1 -8
drivers/usb/core/hub.c
··· 88 88 static struct task_struct *khubd_task; 89 89 90 90 /* multithreaded probe logic */ 91 - static int multithread_probe = 92 - #ifdef CONFIG_USB_MULTITHREAD_PROBE 93 - 1; 94 - #else 95 - 0; 96 - #endif 97 - module_param(multithread_probe, bool, S_IRUGO); 98 - MODULE_PARM_DESC(multithread_probe, "Run each USB device probe in a new thread"); 91 + static int multithread_probe = 0; 99 92 100 93 /* cycle leds on hubs that aren't blinking for attention */ 101 94 static int blinkenlights = 0;
+1 -1
drivers/usb/host/ohci-ep93xx.c
··· 169 169 static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_t state) 170 170 { 171 171 struct usb_hcd *hcd = platform_get_drvdata(pdev); 172 - struct ochi_hcd *ohci = hcd_to_ohci(hcd); 172 + struct ohci_hcd *ohci = hcd_to_ohci(hcd); 173 173 174 174 if (time_before(jiffies, ohci->next_statechange)) 175 175 msleep(5);
+4
drivers/usb/input/hid-core.c
··· 796 796 #define USB_VENDOR_ID_LOGITECH 0x046d 797 797 #define USB_DEVICE_ID_LOGITECH_USB_RECEIVER 0xc101 798 798 799 + #define USB_VENDOR_ID_IMATION 0x0718 800 + #define USB_DEVICE_ID_DISC_STAKKA 0xd000 801 + 799 802 /* 800 803 * Alphabetically sorted blacklist by quirk type. 801 804 */ ··· 886 883 { USB_VENDOR_ID_GTCO_IPANEL_1, USB_DEVICE_ID_GTCO_10, HID_QUIRK_IGNORE }, 887 884 { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_8, HID_QUIRK_IGNORE }, 888 885 { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_d, HID_QUIRK_IGNORE }, 886 + { USB_VENDOR_ID_IMATION, USB_DEVICE_ID_DISC_STAKKA, HID_QUIRK_IGNORE }, 889 887 { USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO, HID_QUIRK_IGNORE }, 890 888 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CASSY, HID_QUIRK_IGNORE }, 891 889 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POCKETCASSY, HID_QUIRK_IGNORE },
+59 -39
drivers/usb/input/usbtouchscreen.c
··· 66 66 67 67 void (*process_pkt) (struct usbtouch_usb *usbtouch, unsigned char *pkt, int len); 68 68 int (*get_pkt_len) (unsigned char *pkt, int len); 69 - int (*read_data) (unsigned char *pkt, int *x, int *y, int *touch, int *press); 69 + int (*read_data) (struct usbtouch_usb *usbtouch, unsigned char *pkt); 70 70 int (*init) (struct usbtouch_usb *usbtouch); 71 71 }; 72 72 ··· 85 85 struct usbtouch_device_info *type; 86 86 char name[128]; 87 87 char phys[64]; 88 + 89 + int x, y; 90 + int touch, press; 88 91 }; 89 92 90 93 ··· 164 161 #define EGALAX_PKT_TYPE_REPT 0x80 165 162 #define EGALAX_PKT_TYPE_DIAG 0x0A 166 163 167 - static int egalax_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) 164 + static int egalax_read_data(struct usbtouch_usb *dev, unsigned char *pkt) 168 165 { 169 166 if ((pkt[0] & EGALAX_PKT_TYPE_MASK) != EGALAX_PKT_TYPE_REPT) 170 167 return 0; 171 168 172 - *x = ((pkt[3] & 0x0F) << 7) | (pkt[4] & 0x7F); 173 - *y = ((pkt[1] & 0x0F) << 7) | (pkt[2] & 0x7F); 174 - *touch = pkt[0] & 0x01; 169 + dev->x = ((pkt[3] & 0x0F) << 7) | (pkt[4] & 0x7F); 170 + dev->y = ((pkt[1] & 0x0F) << 7) | (pkt[2] & 0x7F); 171 + dev->touch = pkt[0] & 0x01; 175 172 176 173 return 1; 177 174 } ··· 198 195 * PanJit Part 199 196 */ 200 197 #ifdef CONFIG_USB_TOUCHSCREEN_PANJIT 201 - static int panjit_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) 198 + static int panjit_read_data(struct usbtouch_usb *dev, unsigned char *pkt) 202 199 { 203 - *x = ((pkt[2] & 0x0F) << 8) | pkt[1]; 204 - *y = ((pkt[4] & 0x0F) << 8) | pkt[3]; 205 - *touch = pkt[0] & 0x01; 200 + dev->x = ((pkt[2] & 0x0F) << 8) | pkt[1]; 201 + dev->y = ((pkt[4] & 0x0F) << 8) | pkt[3]; 202 + dev->touch = pkt[0] & 0x01; 206 203 207 204 return 1; 208 205 } ··· 218 215 #define MTOUCHUSB_RESET 7 219 216 #define MTOUCHUSB_REQ_CTRLLR_ID 10 220 217 221 - static int mtouch_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) 218 + static int mtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt) 222 219 { 223 - *x = (pkt[8] << 8) | pkt[7]; 224 - *y = (pkt[10] << 8) | pkt[9]; 225 - *touch = (pkt[2] & 0x40) ? 1 : 0; 220 + dev->x = (pkt[8] << 8) | pkt[7]; 221 + dev->y = (pkt[10] << 8) | pkt[9]; 222 + dev->touch = (pkt[2] & 0x40) ? 1 : 0; 226 223 227 224 return 1; 228 225 } ··· 263 260 * ITM Part 264 261 */ 265 262 #ifdef CONFIG_USB_TOUCHSCREEN_ITM 266 - static int itm_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) 263 + static int itm_read_data(struct usbtouch_usb *dev, unsigned char *pkt) 267 264 { 268 - *x = ((pkt[0] & 0x1F) << 7) | (pkt[3] & 0x7F); 269 - *y = ((pkt[1] & 0x1F) << 7) | (pkt[4] & 0x7F); 270 - *press = ((pkt[2] & 0x01) << 7) | (pkt[5] & 0x7F); 271 - *touch = ~pkt[7] & 0x20; 265 + int touch; 266 + /* 267 + * ITM devices report invalid x/y data if not touched. 268 + * if the screen was touched before but is not touched any more 269 + * report touch as 0 with the last valid x/y data once. then stop 270 + * reporting data until touched again. 271 + */ 272 + dev->press = ((pkt[2] & 0x01) << 7) | (pkt[5] & 0x7F); 272 273 273 - return *touch; 274 + touch = ~pkt[7] & 0x20; 275 + if (!touch) { 276 + if (dev->touch) { 277 + dev->touch = 0; 278 + return 1; 279 + } 280 + 281 + return 0; 282 + } 283 + 284 + dev->x = ((pkt[0] & 0x1F) << 7) | (pkt[3] & 0x7F); 285 + dev->y = ((pkt[1] & 0x1F) << 7) | (pkt[4] & 0x7F); 286 + dev->touch = touch; 287 + 288 + return 1; 274 289 } 275 290 #endif 276 291 ··· 297 276 * eTurboTouch part 298 277 */ 299 278 #ifdef CONFIG_USB_TOUCHSCREEN_ETURBO 300 - static int eturbo_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) 279 + static int eturbo_read_data(struct usbtouch_usb *dev, unsigned char *pkt) 301 280 { 302 281 unsigned int shift; 303 282 ··· 306 285 return 0; 307 286 308 287 shift = (6 - (pkt[0] & 0x03)); 309 - *x = ((pkt[3] << 7) | pkt[4]) >> shift; 310 - *y = ((pkt[1] << 7) | pkt[2]) >> shift; 311 - *touch = (pkt[0] & 0x10) ? 1 : 0; 288 + dev->x = ((pkt[3] << 7) | pkt[4]) >> shift; 289 + dev->y = ((pkt[1] << 7) | pkt[2]) >> shift; 290 + dev->touch = (pkt[0] & 0x10) ? 1 : 0; 312 291 313 292 return 1; 314 293 } ··· 328 307 * Gunze part 329 308 */ 330 309 #ifdef CONFIG_USB_TOUCHSCREEN_GUNZE 331 - static int gunze_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) 310 + static int gunze_read_data(struct usbtouch_usb *dev, unsigned char *pkt) 332 311 { 333 312 if (!(pkt[0] & 0x80) || ((pkt[1] | pkt[2] | pkt[3]) & 0x80)) 334 313 return 0; 335 314 336 - *x = ((pkt[0] & 0x1F) << 7) | (pkt[2] & 0x7F); 337 - *y = ((pkt[1] & 0x1F) << 7) | (pkt[3] & 0x7F); 338 - *touch = pkt[0] & 0x20; 315 + dev->x = ((pkt[0] & 0x1F) << 7) | (pkt[2] & 0x7F); 316 + dev->y = ((pkt[1] & 0x1F) << 7) | (pkt[3] & 0x7F); 317 + dev->touch = pkt[0] & 0x20; 339 318 340 319 return 1; 341 320 } ··· 404 383 } 405 384 406 385 407 - static int dmc_tsc10_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) 386 + static int dmc_tsc10_read_data(struct usbtouch_usb *dev, unsigned char *pkt) 408 387 { 409 - *x = ((pkt[2] & 0x03) << 8) | pkt[1]; 410 - *y = ((pkt[4] & 0x03) << 8) | pkt[3]; 411 - *touch = pkt[0] & 0x01; 388 + dev->x = ((pkt[2] & 0x03) << 8) | pkt[1]; 389 + dev->y = ((pkt[4] & 0x03) << 8) | pkt[3]; 390 + dev->touch = pkt[0] & 0x01; 412 391 413 392 return 1; 414 393 } ··· 513 492 static void usbtouch_process_pkt(struct usbtouch_usb *usbtouch, 514 493 unsigned char *pkt, int len) 515 494 { 516 - int x, y, touch, press; 517 495 struct usbtouch_device_info *type = usbtouch->type; 518 496 519 - if (!type->read_data(pkt, &x, &y, &touch, &press)) 497 + if (!type->read_data(usbtouch, pkt)) 520 498 return; 521 499 522 - input_report_key(usbtouch->input, BTN_TOUCH, touch); 500 + input_report_key(usbtouch->input, BTN_TOUCH, usbtouch->touch); 523 501 524 502 if (swap_xy) { 525 - input_report_abs(usbtouch->input, ABS_X, y); 526 - input_report_abs(usbtouch->input, ABS_Y, x); 503 + input_report_abs(usbtouch->input, ABS_X, usbtouch->y); 504 + input_report_abs(usbtouch->input, ABS_Y, usbtouch->x); 527 505 } else { 528 - input_report_abs(usbtouch->input, ABS_X, x); 529 - input_report_abs(usbtouch->input, ABS_Y, y); 506 + input_report_abs(usbtouch->input, ABS_X, usbtouch->x); 507 + input_report_abs(usbtouch->input, ABS_Y, usbtouch->y); 530 508 } 531 509 if (type->max_press) 532 - input_report_abs(usbtouch->input, ABS_PRESSURE, press); 510 + input_report_abs(usbtouch->input, ABS_PRESSURE, usbtouch->press); 533 511 input_sync(usbtouch->input); 534 512 } 535 513
+13 -5
drivers/usb/net/asix.c
··· 898 898 899 899 static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) 900 900 { 901 - int ret; 901 + int ret, embd_phy; 902 902 void *buf; 903 903 u16 rx_ctl; 904 904 struct asix_data *data = (struct asix_data *)&dev->data; ··· 919 919 AX_GPIO_RSE | AX_GPIO_GPO_2 | AX_GPIO_GPO2EN, 5)) < 0) 920 920 goto out2; 921 921 922 + /* 0x10 is the phy id of the embedded 10/100 ethernet phy */ 923 + embd_phy = ((asix_get_phy_addr(dev) & 0x1f) == 0x10 ? 1 : 0); 922 924 if ((ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, 923 - 1, 0, 0, buf)) < 0) { 925 + embd_phy, 0, 0, buf)) < 0) { 924 926 dbg("Select PHY #1 failed: %d", ret); 925 927 goto out2; 926 928 } 927 929 928 - if ((ret = asix_sw_reset(dev, AX_SWRESET_IPPD)) < 0) 930 + if ((ret = asix_sw_reset(dev, AX_SWRESET_IPPD | AX_SWRESET_PRL)) < 0) 929 931 goto out2; 930 932 931 933 msleep(150); ··· 935 933 goto out2; 936 934 937 935 msleep(150); 938 - if ((ret = asix_sw_reset(dev, AX_SWRESET_IPRL | AX_SWRESET_PRL)) < 0) 939 - goto out2; 936 + if (embd_phy) { 937 + if ((ret = asix_sw_reset(dev, AX_SWRESET_IPRL)) < 0) 938 + goto out2; 939 + } 940 + else { 941 + if ((ret = asix_sw_reset(dev, AX_SWRESET_PRTE)) < 0) 942 + goto out2; 943 + } 940 944 941 945 msleep(150); 942 946 rx_ctl = asix_read_rx_ctl(dev);
+14 -9
drivers/usb/net/rndis_host.c
··· 379 379 { 380 380 int retval; 381 381 struct net_device *net = dev->net; 382 + struct cdc_state *info = (void *) &dev->data; 382 383 union { 383 384 void *buf; 384 385 struct rndis_msg_hdr *header; ··· 398 397 return -ENOMEM; 399 398 retval = usbnet_generic_cdc_bind(dev, intf); 400 399 if (retval < 0) 401 - goto done; 400 + goto fail; 402 401 403 402 net->hard_header_len += sizeof (struct rndis_data_hdr); 404 403 ··· 413 412 if (unlikely(retval < 0)) { 414 413 /* it might not even be an RNDIS device!! */ 415 414 dev_err(&intf->dev, "RNDIS init failed, %d\n", retval); 416 - fail: 417 - usb_driver_release_interface(driver_of(intf), 418 - ((struct cdc_state *)&(dev->data))->data); 419 - goto done; 415 + goto fail_and_release; 420 416 } 421 417 dev->hard_mtu = le32_to_cpu(u.init_c->max_transfer_size); 422 418 /* REVISIT: peripheral "alignment" request is ignored ... */ ··· 429 431 retval = rndis_command(dev, u.header); 430 432 if (unlikely(retval < 0)) { 431 433 dev_err(&intf->dev, "rndis get ethaddr, %d\n", retval); 432 - goto fail; 434 + goto fail_and_release; 433 435 } 434 436 tmp = le32_to_cpu(u.get_c->offset); 435 437 if (unlikely((tmp + 8) > (1024 - ETH_ALEN) ··· 437 439 dev_err(&intf->dev, "rndis ethaddr off %d len %d ?\n", 438 440 tmp, le32_to_cpu(u.get_c->len)); 439 441 retval = -EDOM; 440 - goto fail; 442 + goto fail_and_release; 441 443 } 442 444 memcpy(net->dev_addr, tmp + (char *)&u.get_c->request_id, ETH_ALEN); 443 445 ··· 453 455 retval = rndis_command(dev, u.header); 454 456 if (unlikely(retval < 0)) { 455 457 dev_err(&intf->dev, "rndis set packet filter, %d\n", retval); 456 - goto fail; 458 + goto fail_and_release; 457 459 } 458 460 459 461 retval = 0; 460 - done: 462 + 463 + kfree(u.buf); 464 + return retval; 465 + 466 + fail_and_release: 467 + usb_set_intfdata(info->data, NULL); 468 + usb_driver_release_interface(driver_of(intf), info->data); 469 + fail: 461 470 kfree(u.buf); 462 471 return retval; 463 472 }
+3
drivers/usb/serial/option.c
··· 78 78 #define OPTION_PRODUCT_FUSION2 0x6300 79 79 #define OPTION_PRODUCT_COBRA 0x6500 80 80 #define OPTION_PRODUCT_COBRA2 0x6600 81 + #define OPTION_PRODUCT_GTMAX36 0x6701 81 82 #define HUAWEI_PRODUCT_E600 0x1001 82 83 #define HUAWEI_PRODUCT_E220 0x1003 83 84 #define AUDIOVOX_PRODUCT_AIRCARD 0x0112 ··· 91 90 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) }, 92 91 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) }, 93 92 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) }, 93 + { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_GTMAX36) }, 94 94 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, 95 95 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) }, 96 96 { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, ··· 106 104 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) }, 107 105 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) }, 108 106 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) }, 107 + { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_GTMAX36) }, 109 108 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, 110 109 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) }, 111 110 { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) },
+19
drivers/usb/storage/unusual_devs.h
··· 197 197 US_SC_DEVICE, US_PR_DEVICE, NULL, 198 198 US_FL_MAX_SECTORS_64 ), 199 199 200 + /* Reported by Manuel Osdoba <manuel.osdoba@tu-ilmenau.de> */ 201 + UNUSUAL_DEV( 0x0421, 0x0492, 0x0452, 0x0452, 202 + "Nokia", 203 + "Nokia 6233", 204 + US_SC_DEVICE, US_PR_DEVICE, NULL, 205 + US_FL_MAX_SECTORS_64 ), 206 + 200 207 /* Reported by Alex Corcoles <alex@corcoles.net> */ 201 208 UNUSUAL_DEV( 0x0421, 0x0495, 0x0370, 0x0370, 202 209 "Nokia", ··· 260 253 "Rio Karma", 261 254 US_SC_SCSI, US_PR_KARMA, rio_karma_init, 0), 262 255 #endif 256 + 257 + /* 258 + * This virtual floppy is found in Sun equipment (x4600, x4200m2, etc.) 259 + * Reported by Pete Zaitcev <zaitcev@redhat.com> 260 + * This device chokes on both version of MODE SENSE which we have, so 261 + * use_10_for_ms is not effective, and we use US_FL_NO_WP_DETECT. 262 + */ 263 + UNUSUAL_DEV( 0x046b, 0xff40, 0x0100, 0x0100, 264 + "AMI", 265 + "Virtual Floppy", 266 + US_SC_DEVICE, US_PR_DEVICE, NULL, 267 + US_FL_NO_WP_DETECT), 263 268 264 269 /* Patch submitted by Philipp Friedrich <philipp@void.at> */ 265 270 UNUSUAL_DEV( 0x0482, 0x0100, 0x0100, 0x0100,