aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/cp210x.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-22 18:50:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-22 18:50:46 -0400
commita481991467d38afb43c3921d5b5b59ccb61b04ba (patch)
treea4b0b9a14da6fd5ef7b9b512bb32dbfcfcf2cd71 /drivers/usb/serial/cp210x.c
parentf6a26ae7699416d86bea8cb68ce413571e9cab3c (diff)
parentcda4db53e9c28061c100400e1a4d273ea61dfba9 (diff)
Merge tag 'usb-3.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB 3.5-rc1 changes from Greg Kroah-Hartman: "Here is the big USB 3.5-rc1 pull request for the 3.5-rc1 merge window. It's touches a lot of different parts of the kernel, all USB drivers, due to some API cleanups (getting rid of the ancient err() macro) and some changes that are needed for USB 3.0 power management updates. There are also lots of new drivers, pimarily gadget, but others as well. We deleted a staging driver, which was nice, and finally dropped the obsolete usbfs code, which will make Al happy to never have to touch that again. There were some build errors in the tree that linux-next found a few days ago, but those were fixed by the most recent changes (all were due to us not building with CONFIG_PM disabled.) Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" * tag 'usb-3.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (477 commits) xhci: Fix DIV_ROUND_UP compile error. xhci: Fix compile with CONFIG_USB_SUSPEND=n USB: Fix core compile with CONFIG_USB_SUSPEND=n brcm80211: Fix compile error for .disable_hub_initiated_lpm. Revert "USB: EHCI: work around bug in the Philips ISP1562 controller" MAINTAINERS: Add myself as maintainer to the USB PHY Layer USB: EHCI: fix command register configuration lost problem USB: Remove races in devio.c USB: ehci-platform: remove update_device USB: Disable hub-initiated LPM for comms devices. xhci: Add Intel U1/U2 timeout policy. xhci: Add infrastructure for host-specific LPM policies. USB: Add macros for interrupt endpoint types. xhci: Reserve one command for USB3 LPM disable. xhci: Some Evaluate Context commands must succeed. USB: Disable USB 3.0 LPM in critical sections. USB: Add support to enable/disable USB3 link states. USB: Allow drivers to disable hub-initiated LPM. USB: Calculate USB 3.0 exit latencies for LPM. USB: Refactor code to set LPM support flag. ... Conflicts: arch/arm/mach-exynos/mach-nuri.c arch/arm/mach-exynos/mach-universal_c210.c drivers/net/wireless/ath/ath6kl/usb.c
Diffstat (limited to 'drivers/usb/serial/cp210x.c')
-rw-r--r--drivers/usb/serial/cp210x.c32
1 files changed, 8 insertions, 24 deletions
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index ec30f95ef399..1b1926200ba7 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -156,13 +156,6 @@ struct cp210x_port_private {
156 __u8 bInterfaceNumber; 156 __u8 bInterfaceNumber;
157}; 157};
158 158
159static struct usb_driver cp210x_driver = {
160 .name = "cp210x",
161 .probe = usb_serial_probe,
162 .disconnect = usb_serial_disconnect,
163 .id_table = id_table,
164};
165
166static struct usb_serial_driver cp210x_device = { 159static struct usb_serial_driver cp210x_device = {
167 .driver = { 160 .driver = {
168 .owner = THIS_MODULE, 161 .owner = THIS_MODULE,
@@ -188,8 +181,10 @@ static struct usb_serial_driver * const serial_drivers[] = {
188}; 181};
189 182
190/* Config request types */ 183/* Config request types */
191#define REQTYPE_HOST_TO_DEVICE 0x41 184#define REQTYPE_HOST_TO_INTERFACE 0x41
192#define REQTYPE_DEVICE_TO_HOST 0xc1 185#define REQTYPE_INTERFACE_TO_HOST 0xc1
186#define REQTYPE_HOST_TO_DEVICE 0x40
187#define REQTYPE_DEVICE_TO_HOST 0xc0
193 188
194/* Config request codes */ 189/* Config request codes */
195#define CP210X_IFC_ENABLE 0x00 190#define CP210X_IFC_ENABLE 0x00
@@ -286,7 +281,7 @@ static int cp210x_get_config(struct usb_serial_port *port, u8 request,
286 281
287 /* Issue the request, attempting to read 'size' bytes */ 282 /* Issue the request, attempting to read 'size' bytes */
288 result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), 283 result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
289 request, REQTYPE_DEVICE_TO_HOST, 0x0000, 284 request, REQTYPE_INTERFACE_TO_HOST, 0x0000,
290 port_priv->bInterfaceNumber, buf, size, 285 port_priv->bInterfaceNumber, buf, size,
291 USB_CTRL_GET_TIMEOUT); 286 USB_CTRL_GET_TIMEOUT);
292 287
@@ -340,13 +335,13 @@ static int cp210x_set_config(struct usb_serial_port *port, u8 request,
340 if (size > 2) { 335 if (size > 2) {
341 result = usb_control_msg(serial->dev, 336 result = usb_control_msg(serial->dev,
342 usb_sndctrlpipe(serial->dev, 0), 337 usb_sndctrlpipe(serial->dev, 0),
343 request, REQTYPE_HOST_TO_DEVICE, 0x0000, 338 request, REQTYPE_HOST_TO_INTERFACE, 0x0000,
344 port_priv->bInterfaceNumber, buf, size, 339 port_priv->bInterfaceNumber, buf, size,
345 USB_CTRL_SET_TIMEOUT); 340 USB_CTRL_SET_TIMEOUT);
346 } else { 341 } else {
347 result = usb_control_msg(serial->dev, 342 result = usb_control_msg(serial->dev,
348 usb_sndctrlpipe(serial->dev, 0), 343 usb_sndctrlpipe(serial->dev, 0),
349 request, REQTYPE_HOST_TO_DEVICE, data[0], 344 request, REQTYPE_HOST_TO_INTERFACE, data[0],
350 port_priv->bInterfaceNumber, NULL, 0, 345 port_priv->bInterfaceNumber, NULL, 0,
351 USB_CTRL_SET_TIMEOUT); 346 USB_CTRL_SET_TIMEOUT);
352 } 347 }
@@ -422,8 +417,6 @@ static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *port)
422{ 417{
423 int result; 418 int result;
424 419
425 dbg("%s - port %d", __func__, port->number);
426
427 result = cp210x_set_config_single(port, CP210X_IFC_ENABLE, 420 result = cp210x_set_config_single(port, CP210X_IFC_ENABLE,
428 UART_ENABLE); 421 UART_ENABLE);
429 if (result) { 422 if (result) {
@@ -443,8 +436,6 @@ static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *port)
443 436
444static void cp210x_close(struct usb_serial_port *port) 437static void cp210x_close(struct usb_serial_port *port)
445{ 438{
446 dbg("%s - port %d", __func__, port->number);
447
448 usb_serial_generic_close(port); 439 usb_serial_generic_close(port);
449 440
450 mutex_lock(&port->serial->disc_mutex); 441 mutex_lock(&port->serial->disc_mutex);
@@ -488,8 +479,6 @@ static void cp210x_get_termios_port(struct usb_serial_port *port,
488 unsigned int baud; 479 unsigned int baud;
489 unsigned int bits; 480 unsigned int bits;
490 481
491 dbg("%s - port %d", __func__, port->number);
492
493 cp210x_get_config(port, CP210X_GET_BAUDRATE, &baud, 4); 482 cp210x_get_config(port, CP210X_GET_BAUDRATE, &baud, 4);
494 483
495 dbg("%s - baud rate = %d", __func__, baud); 484 dbg("%s - baud rate = %d", __func__, baud);
@@ -787,8 +776,6 @@ static int cp210x_tiocmset_port(struct usb_serial_port *port,
787{ 776{
788 unsigned int control = 0; 777 unsigned int control = 0;
789 778
790 dbg("%s - port %d", __func__, port->number);
791
792 if (set & TIOCM_RTS) { 779 if (set & TIOCM_RTS) {
793 control |= CONTROL_RTS; 780 control |= CONTROL_RTS;
794 control |= CONTROL_WRITE_RTS; 781 control |= CONTROL_WRITE_RTS;
@@ -825,8 +812,6 @@ static int cp210x_tiocmget (struct tty_struct *tty)
825 unsigned int control; 812 unsigned int control;
826 int result; 813 int result;
827 814
828 dbg("%s - port %d", __func__, port->number);
829
830 cp210x_get_config(port, CP210X_GET_MDMSTS, &control, 1); 815 cp210x_get_config(port, CP210X_GET_MDMSTS, &control, 1);
831 816
832 result = ((control & CONTROL_DTR) ? TIOCM_DTR : 0) 817 result = ((control & CONTROL_DTR) ? TIOCM_DTR : 0)
@@ -846,7 +831,6 @@ static void cp210x_break_ctl (struct tty_struct *tty, int break_state)
846 struct usb_serial_port *port = tty->driver_data; 831 struct usb_serial_port *port = tty->driver_data;
847 unsigned int state; 832 unsigned int state;
848 833
849 dbg("%s - port %d", __func__, port->number);
850 if (break_state == 0) 834 if (break_state == 0)
851 state = BREAK_OFF; 835 state = BREAK_OFF;
852 else 836 else
@@ -891,7 +875,7 @@ static void cp210x_release(struct usb_serial *serial)
891 } 875 }
892} 876}
893 877
894module_usb_serial_driver(cp210x_driver, serial_drivers); 878module_usb_serial_driver(serial_drivers, id_table);
895 879
896MODULE_DESCRIPTION(DRIVER_DESC); 880MODULE_DESCRIPTION(DRIVER_DESC);
897MODULE_VERSION(DRIVER_VERSION); 881MODULE_VERSION(DRIVER_VERSION);