aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-05-10 13:49:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-05-10 13:49:41 -0400
commit6580cd59f9d11b62ebef5b27662bdc1fdf34eb64 (patch)
tree5b779889655bde267e0552d0efa4d1ccdfe19a2c /drivers
parent0016effb90589a87290a2ee721e34dc37e87b67c (diff)
parentc45d63202fbaccef7ef7946c03f27f72c809b1cc (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: usb-serial: ftdi_sio: fix reference counting of ftdi_private USB: unusual_devs: extend nokia 6288 bcd range USB: Gadget: fix UTF conversion in the usbstring library USB: Fix makefile so that CONFIG_WDM and CONFIG_TMC work. USB: ftdi_sio: add vendor/product id for the Marvell SheevaPlug USB: cxacru: Fix negative dB output
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/Makefile2
-rw-r--r--drivers/usb/atm/cxacru.c10
-rw-r--r--drivers/usb/gadget/usbstring.c6
-rw-r--r--drivers/usb/serial/ftdi_sio.c20
-rw-r--r--drivers/usb/serial/ftdi_sio.h6
-rw-r--r--drivers/usb/storage/unusual_devs.h5
6 files changed, 38 insertions, 11 deletions
diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile
index 89299a5ce168..0716cdb44cd8 100644
--- a/drivers/usb/Makefile
+++ b/drivers/usb/Makefile
@@ -27,6 +27,8 @@ obj-$(CONFIG_USB_WUSB) += wusbcore/
27 27
28obj-$(CONFIG_USB_ACM) += class/ 28obj-$(CONFIG_USB_ACM) += class/
29obj-$(CONFIG_USB_PRINTER) += class/ 29obj-$(CONFIG_USB_PRINTER) += class/
30obj-$(CONFIG_USB_WDM) += class/
31obj-$(CONFIG_USB_TMC) += class/
30 32
31obj-$(CONFIG_USB_STORAGE) += storage/ 33obj-$(CONFIG_USB_STORAGE) += storage/
32obj-$(CONFIG_USB) += storage/ 34obj-$(CONFIG_USB) += storage/
diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c
index 6789089e2461..56802d2e994b 100644
--- a/drivers/usb/atm/cxacru.c
+++ b/drivers/usb/atm/cxacru.c
@@ -227,8 +227,14 @@ static ssize_t cxacru_sysfs_showattr_s8(s8 value, char *buf)
227 227
228static ssize_t cxacru_sysfs_showattr_dB(s16 value, char *buf) 228static ssize_t cxacru_sysfs_showattr_dB(s16 value, char *buf)
229{ 229{
230 return snprintf(buf, PAGE_SIZE, "%d.%02u\n", 230 if (likely(value >= 0)) {
231 value / 100, abs(value) % 100); 231 return snprintf(buf, PAGE_SIZE, "%u.%02u\n",
232 value / 100, value % 100);
233 } else {
234 value = -value;
235 return snprintf(buf, PAGE_SIZE, "-%u.%02u\n",
236 value / 100, value % 100);
237 }
232} 238}
233 239
234static ssize_t cxacru_sysfs_showattr_bool(u32 value, char *buf) 240static ssize_t cxacru_sysfs_showattr_bool(u32 value, char *buf)
diff --git a/drivers/usb/gadget/usbstring.c b/drivers/usb/gadget/usbstring.c
index 4154be375c7a..58c4d37d312a 100644
--- a/drivers/usb/gadget/usbstring.c
+++ b/drivers/usb/gadget/usbstring.c
@@ -38,7 +38,7 @@ static int utf8_to_utf16le(const char *s, __le16 *cp, unsigned len)
38 uchar = (c & 0x1f) << 6; 38 uchar = (c & 0x1f) << 6;
39 39
40 c = (u8) *s++; 40 c = (u8) *s++;
41 if ((c & 0xc0) != 0xc0) 41 if ((c & 0xc0) != 0x80)
42 goto fail; 42 goto fail;
43 c &= 0x3f; 43 c &= 0x3f;
44 uchar |= c; 44 uchar |= c;
@@ -49,13 +49,13 @@ static int utf8_to_utf16le(const char *s, __le16 *cp, unsigned len)
49 uchar = (c & 0x0f) << 12; 49 uchar = (c & 0x0f) << 12;
50 50
51 c = (u8) *s++; 51 c = (u8) *s++;
52 if ((c & 0xc0) != 0xc0) 52 if ((c & 0xc0) != 0x80)
53 goto fail; 53 goto fail;
54 c &= 0x3f; 54 c &= 0x3f;
55 uchar |= c << 6; 55 uchar |= c << 6;
56 56
57 c = (u8) *s++; 57 c = (u8) *s++;
58 if ((c & 0xc0) != 0xc0) 58 if ((c & 0xc0) != 0x80)
59 goto fail; 59 goto fail;
60 c &= 0x3f; 60 c &= 0x3f;
61 uchar |= c; 61 uchar |= c;
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 8100f1d25904..0ab8474b00cb 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -56,6 +56,7 @@ static __u16 vendor = FTDI_VID;
56static __u16 product; 56static __u16 product;
57 57
58struct ftdi_private { 58struct ftdi_private {
59 struct kref kref;
59 ftdi_chip_type_t chip_type; 60 ftdi_chip_type_t chip_type;
60 /* type of device, either SIO or FT8U232AM */ 61 /* type of device, either SIO or FT8U232AM */
61 int baud_base; /* baud base clock for divisor setting */ 62 int baud_base; /* baud base clock for divisor setting */
@@ -669,6 +670,8 @@ static struct usb_device_id id_table_combined [] = {
669 { USB_DEVICE(ADI_VID, ADI_GNICE_PID), 670 { USB_DEVICE(ADI_VID, ADI_GNICE_PID),
670 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 671 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
671 { USB_DEVICE(JETI_VID, JETI_SPC1201_PID) }, 672 { USB_DEVICE(JETI_VID, JETI_SPC1201_PID) },
673 { USB_DEVICE(MARVELL_VID, MARVELL_SHEEVAPLUG_PID),
674 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
672 { }, /* Optional parameter entry */ 675 { }, /* Optional parameter entry */
673 { } /* Terminating entry */ 676 { } /* Terminating entry */
674}; 677};
@@ -1352,6 +1355,7 @@ static int ftdi_sio_port_probe(struct usb_serial_port *port)
1352 return -ENOMEM; 1355 return -ENOMEM;
1353 } 1356 }
1354 1357
1358 kref_init(&priv->kref);
1355 spin_lock_init(&priv->rx_lock); 1359 spin_lock_init(&priv->rx_lock);
1356 spin_lock_init(&priv->tx_lock); 1360 spin_lock_init(&priv->tx_lock);
1357 init_waitqueue_head(&priv->delta_msr_wait); 1361 init_waitqueue_head(&priv->delta_msr_wait);
@@ -1468,6 +1472,13 @@ static void ftdi_shutdown(struct usb_serial *serial)
1468 dbg("%s", __func__); 1472 dbg("%s", __func__);
1469} 1473}
1470 1474
1475static void ftdi_sio_priv_release(struct kref *k)
1476{
1477 struct ftdi_private *priv = container_of(k, struct ftdi_private, kref);
1478
1479 kfree(priv);
1480}
1481
1471static int ftdi_sio_port_remove(struct usb_serial_port *port) 1482static int ftdi_sio_port_remove(struct usb_serial_port *port)
1472{ 1483{
1473 struct ftdi_private *priv = usb_get_serial_port_data(port); 1484 struct ftdi_private *priv = usb_get_serial_port_data(port);
@@ -1482,7 +1493,7 @@ static int ftdi_sio_port_remove(struct usb_serial_port *port)
1482 1493
1483 if (priv) { 1494 if (priv) {
1484 usb_set_serial_port_data(port, NULL); 1495 usb_set_serial_port_data(port, NULL);
1485 kfree(priv); 1496 kref_put(&priv->kref, ftdi_sio_priv_release);
1486 } 1497 }
1487 1498
1488 return 0; 1499 return 0;
@@ -1547,7 +1558,8 @@ static int ftdi_open(struct tty_struct *tty,
1547 dev_err(&port->dev, 1558 dev_err(&port->dev,
1548 "%s - failed submitting read urb, error %d\n", 1559 "%s - failed submitting read urb, error %d\n",
1549 __func__, result); 1560 __func__, result);
1550 1561 else
1562 kref_get(&priv->kref);
1551 1563
1552 return result; 1564 return result;
1553} /* ftdi_open */ 1565} /* ftdi_open */
@@ -1589,11 +1601,11 @@ static void ftdi_close(struct tty_struct *tty,
1589 mutex_unlock(&port->serial->disc_mutex); 1601 mutex_unlock(&port->serial->disc_mutex);
1590 1602
1591 /* cancel any scheduled reading */ 1603 /* cancel any scheduled reading */
1592 cancel_delayed_work(&priv->rx_work); 1604 cancel_delayed_work_sync(&priv->rx_work);
1593 flush_scheduled_work();
1594 1605
1595 /* shutdown our bulk read */ 1606 /* shutdown our bulk read */
1596 usb_kill_urb(port->read_urb); 1607 usb_kill_urb(port->read_urb);
1608 kref_put(&priv->kref, ftdi_sio_priv_release);
1597} /* ftdi_close */ 1609} /* ftdi_close */
1598 1610
1599 1611
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
index c09f658a448b..12330fa1c095 100644
--- a/drivers/usb/serial/ftdi_sio.h
+++ b/drivers/usb/serial/ftdi_sio.h
@@ -920,6 +920,12 @@
920#define JETI_SPC1201_PID 0x04b2 920#define JETI_SPC1201_PID 0x04b2
921 921
922/* 922/*
923 * Marvell SheevaPlug
924 */
925#define MARVELL_VID 0x9e88
926#define MARVELL_SHEEVAPLUG_PID 0x9e8f
927
928/*
923 * BmRequestType: 1100 0000b 929 * BmRequestType: 1100 0000b
924 * bRequest: FTDI_E2_READ 930 * bRequest: FTDI_E2_READ
925 * wValue: 0 931 * wValue: 0
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index fa65a3b08601..4b8b69045fe6 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -160,8 +160,9 @@ UNUSUAL_DEV( 0x0420, 0x0001, 0x0100, 0x0100,
160 US_SC_DEVICE, US_PR_DEVICE, NULL, 160 US_SC_DEVICE, US_PR_DEVICE, NULL,
161 US_FL_IGNORE_RESIDUE ), 161 US_FL_IGNORE_RESIDUE ),
162 162
163/* Reported by Andrew Nayenko <relan@bk.ru> */ 163/* Reported by Andrew Nayenko <relan@bk.ru>
164UNUSUAL_DEV( 0x0421, 0x0019, 0x0592, 0x0592, 164 * Updated for new firmware by Phillip Potter <phillipinda@hotmail.com> */
165UNUSUAL_DEV( 0x0421, 0x0019, 0x0592, 0x0610,
165 "Nokia", 166 "Nokia",
166 "Nokia 6288", 167 "Nokia 6288",
167 US_SC_DEVICE, US_PR_DEVICE, NULL, 168 US_SC_DEVICE, US_PR_DEVICE, NULL,