summaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-01 13:23:01 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-01 13:23:01 -0700
commitd9a807461fc8cc0d6ba589ea0730d139122af012 (patch)
tree9d8c7a044659d821748dd40718a22557c04e4299 /drivers/usb/serial
parent3498d13b8090c0b0ef911409fbc503a7c4cca6ef (diff)
parent70c048a238c780c226eb4b115ebaa908cb3b34ec (diff)
Merge tag 'usb-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB changes from Greg Kroah-Hartman: "Here is the big USB pull request for 3.7-rc1 There are lots of gadget driver changes (including copying a bunch of files into the drivers/staging/ccg/ directory so that the other gadget drivers can be fixed up properly without breaking that driver), and we remove the old obsolete ub.c driver from the tree. There are also the usual XHCI set of updates, and other various driver changes and updates. We also are trying hard to remove the old dbg() macro, but the final bits of that removal will be coming in through the networking tree before we can delete it for good. All of these patches have been in the linux-next tree. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" Fix up several annoying - but fairly mindless - conflicts due to the termios structure having moved into the tty device, and often clashing with dbg -> dev_dbg conversion. * tag 'usb-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (339 commits) USB: ezusb: move ezusb.c from drivers/usb/serial to drivers/usb/misc USB: uas: fix gcc warning USB: uas: fix locking USB: Fix race condition when removing host controllers USB: uas: add locking USB: uas: fix abort USB: uas: remove aborted field, replace with status bit. USB: uas: fix task management USB: uas: keep track of command urbs xhci: Intel Panther Point BEI quirk. powerpc/usb: remove checking PHY_CLK_VALID for UTMI PHY USB: ftdi_sio: add TIAO USB Multi-Protocol Adapter (TUMPA) support Revert "usb : Add sysfs files to control port power." USB: serial: remove vizzini driver usb: host: xhci: Fix Null pointer dereferencing with 71c731a for non-x86 systems Increase XHCI suspend timeout to 16ms USB: ohci-at91: fix null pointer in ohci_hcd_at91_overcurrent_irq USB: sierra_ms: don't keep unused variable fsl/usb: Add support for USB controller version 2.4 USB: qcaux: add Pantech vendor class match ...
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/Kconfig21
-rw-r--r--drivers/usb/serial/Makefile2
-rw-r--r--drivers/usb/serial/aircable.c5
-rw-r--r--drivers/usb/serial/ark3116.c7
-rw-r--r--drivers/usb/serial/belkin_sa.c8
-rw-r--r--drivers/usb/serial/ch341.c49
-rw-r--r--drivers/usb/serial/console.c23
-rw-r--r--drivers/usb/serial/cp210x.c141
-rw-r--r--drivers/usb/serial/cyberjack.c77
-rw-r--r--drivers/usb/serial/cypress_m8.c157
-rw-r--r--drivers/usb/serial/digi_acceleport.c50
-rw-r--r--drivers/usb/serial/empeg.c5
-rw-r--r--drivers/usb/serial/ezusb.c59
-rw-r--r--drivers/usb/serial/f81232.c8
-rw-r--r--drivers/usb/serial/ftdi_sio.c138
-rw-r--r--drivers/usb/serial/ftdi_sio_ids.h5
-rw-r--r--drivers/usb/serial/funsoft.c5
-rw-r--r--drivers/usb/serial/garmin_gps.c129
-rw-r--r--drivers/usb/serial/generic.c11
-rw-r--r--drivers/usb/serial/io_edgeport.c616
-rw-r--r--drivers/usb/serial/io_ti.c408
-rw-r--r--drivers/usb/serial/ipaq.c4
-rw-r--r--drivers/usb/serial/ipw.c66
-rw-r--r--drivers/usb/serial/ir-usb.c16
-rw-r--r--drivers/usb/serial/iuu_phoenix.c134
-rw-r--r--drivers/usb/serial/keyspan.c338
-rw-r--r--drivers/usb/serial/keyspan.h17
-rw-r--r--drivers/usb/serial/keyspan_pda.c73
-rw-r--r--drivers/usb/serial/kl5kusb105.c41
-rw-r--r--drivers/usb/serial/kobil_sct.c98
-rw-r--r--drivers/usb/serial/mct_u232.c104
-rw-r--r--drivers/usb/serial/metro-usb.c7
-rw-r--r--drivers/usb/serial/mos7720.c231
-rw-r--r--drivers/usb/serial/mos7840.c478
-rw-r--r--drivers/usb/serial/navman.c8
-rw-r--r--drivers/usb/serial/omninet.c43
-rw-r--r--drivers/usb/serial/opticon.c30
-rw-r--r--drivers/usb/serial/option.c23
-rw-r--r--drivers/usb/serial/oti6858.c77
-rw-r--r--drivers/usb/serial/pl2303.c8
-rw-r--r--drivers/usb/serial/qcaux.c10
-rw-r--r--drivers/usb/serial/qcserial.c5
-rw-r--r--drivers/usb/serial/quatech2.c7
-rw-r--r--drivers/usb/serial/safe_serial.c12
-rw-r--r--drivers/usb/serial/sierra.c11
-rw-r--r--drivers/usb/serial/spcp8x5.c5
-rw-r--r--drivers/usb/serial/ssu100.c37
-rw-r--r--drivers/usb/serial/symbolserial.c8
-rw-r--r--drivers/usb/serial/ti_usb_3410_5052.c150
-rw-r--r--drivers/usb/serial/usb-serial.c176
-rw-r--r--drivers/usb/serial/usb_wwan.c56
-rw-r--r--drivers/usb/serial/visor.c13
-rw-r--r--drivers/usb/serial/whiteheat.c135
-rw-r--r--drivers/usb/serial/zte_ev.c307
54 files changed, 2086 insertions, 2566 deletions
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig
index 325d2910f9f9..76f462241738 100644
--- a/drivers/usb/serial/Kconfig
+++ b/drivers/usb/serial/Kconfig
@@ -42,11 +42,6 @@ config USB_SERIAL_CONSOLE
If unsure, say N.
-config USB_EZUSB
- bool "Functions for loading firmware on EZUSB chips"
- help
- Say Y here if you need EZUSB device support.
-
config USB_SERIAL_GENERIC
bool "USB Generic Serial Driver"
help
@@ -94,7 +89,7 @@ config USB_SERIAL_CH341
config USB_SERIAL_WHITEHEAT
tristate "USB ConnectTech WhiteHEAT Serial Driver"
- select USB_EZUSB
+ select USB_EZUSB_FX2
help
Say Y here if you want to use a ConnectTech WhiteHEAT 4 port
USB to serial converter device.
@@ -281,7 +276,7 @@ config USB_SERIAL_IUU
config USB_SERIAL_KEYSPAN_PDA
tristate "USB Keyspan PDA Single Port Serial Driver"
- select USB_EZUSB
+ select USB_EZUSB_FX2
help
Say Y here if you want to use a Keyspan PDA single port USB to
serial converter device. This driver makes use of firmware
@@ -292,7 +287,7 @@ config USB_SERIAL_KEYSPAN_PDA
config USB_SERIAL_KEYSPAN
tristate "USB Keyspan USA-xxx Serial Driver"
- select USB_EZUSB
+ select USB_EZUSB_FX2
---help---
Say Y here if you want to use Keyspan USB to serial converter
devices. This driver makes use of Keyspan's official firmware
@@ -596,7 +591,7 @@ config USB_SERIAL_CYBERJACK
config USB_SERIAL_XIRCOM
tristate "USB Xircom / Entregra Single Port Serial Driver"
- select USB_EZUSB
+ select USB_EZUSB_FX2
help
Say Y here if you want to use a Xircom or Entregra single port USB to
serial converter device. This driver makes use of firmware
@@ -660,6 +655,14 @@ config USB_SERIAL_ZIO
To compile this driver as a module, choose M here: the
module will be called zio.
+config USB_SERIAL_ZTE
+ tristate "ZTE USB serial driver"
+ help
+ Say Y here if you want to use a ZTE USB to serial device.
+
+ To compile this driver as a module, choose M here: the
+ module will be called zte.
+
config USB_SERIAL_SSU100
tristate "USB Quatech SSU-100 Single Port Serial Driver"
help
diff --git a/drivers/usb/serial/Makefile b/drivers/usb/serial/Makefile
index 1dc483a8bfc7..3b3e7308d476 100644
--- a/drivers/usb/serial/Makefile
+++ b/drivers/usb/serial/Makefile
@@ -9,7 +9,6 @@ obj-$(CONFIG_USB_SERIAL) += usbserial.o
usbserial-y := usb-serial.o generic.o bus.o
usbserial-$(CONFIG_USB_SERIAL_CONSOLE) += console.o
-usbserial-$(CONFIG_USB_EZUSB) += ezusb.o
obj-$(CONFIG_USB_SERIAL_AIRCABLE) += aircable.o
obj-$(CONFIG_USB_SERIAL_ARK3116) += ark3116.o
@@ -63,3 +62,4 @@ obj-$(CONFIG_USB_SERIAL_WHITEHEAT) += whiteheat.o
obj-$(CONFIG_USB_SERIAL_XIRCOM) += keyspan_pda.o
obj-$(CONFIG_USB_SERIAL_VIVOPAY_SERIAL) += vivopay-serial.o
obj-$(CONFIG_USB_SERIAL_ZIO) += zio.o
+obj-$(CONFIG_USB_SERIAL_ZTE) += zte_ev.o
diff --git a/drivers/usb/serial/aircable.c b/drivers/usb/serial/aircable.c
index d634e6635632..54e1bb6372e7 100644
--- a/drivers/usb/serial/aircable.c
+++ b/drivers/usb/serial/aircable.c
@@ -52,8 +52,6 @@
#include <linux/usb.h>
#include <linux/usb/serial.h>
-static bool debug;
-
/* Vendor and Product ID */
#define AIRCABLE_VID 0x16CA
#define AIRCABLE_USB_PID 0x1502
@@ -196,6 +194,3 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_VERSION(DRIVER_VERSION);
MODULE_LICENSE("GPL");
-
-module_param(debug, bool, S_IRUGO | S_IWUSR);
-MODULE_PARM_DESC(debug, "Debug enabled or not");
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c
index 3b98fb733362..cf2522c397d3 100644
--- a/drivers/usb/serial/ark3116.c
+++ b/drivers/usb/serial/ark3116.c
@@ -37,7 +37,6 @@
#include <linux/mutex.h>
#include <linux/spinlock.h>
-static bool debug;
/*
* Version information
*/
@@ -650,8 +649,7 @@ static void ark3116_read_int_callback(struct urb *urb)
/*
* Not sure what this data meant...
*/
- usb_serial_debug_data(debug, &port->dev,
- __func__,
+ usb_serial_debug_data(&port->dev, __func__,
urb->actual_length,
urb->transfer_buffer);
break;
@@ -750,9 +748,6 @@ MODULE_LICENSE("GPL");
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
-module_param(debug, bool, S_IRUGO | S_IWUSR);
-MODULE_PARM_DESC(debug, "Enable debug");
-
/*
* The following describes what I learned from studying the old
* ark3116.c driver, disassembling the windows driver, and some lucky
diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c
index a46df73ee96e..99449424193f 100644
--- a/drivers/usb/serial/belkin_sa.c
+++ b/drivers/usb/serial/belkin_sa.c
@@ -37,8 +37,6 @@
#include <linux/usb/serial.h>
#include "belkin_sa.h"
-static bool debug;
-
/*
* Version Information
*/
@@ -206,8 +204,7 @@ static void belkin_sa_read_int_callback(struct urb *urb)
goto exit;
}
- usb_serial_debug_data(debug, &port->dev, __func__,
- urb->actual_length, data);
+ usb_serial_debug_data(&port->dev, __func__, urb->actual_length, data);
/* Handle known interrupt data */
/* ignore data[0] and data[1] */
@@ -515,6 +512,3 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_VERSION(DRIVER_VERSION);
MODULE_LICENSE("GPL");
-
-module_param(debug, bool, S_IRUGO | S_IWUSR);
-MODULE_PARM_DESC(debug, "Debug enabled or not");
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
index cabd1b15ddce..e9c7046ae355 100644
--- a/drivers/usb/serial/ch341.c
+++ b/drivers/usb/serial/ch341.c
@@ -70,8 +70,6 @@
#define CH341_NBREAK_BITS_REG2 0x40
-static bool debug;
-
static const struct usb_device_id id_table[] = {
{ USB_DEVICE(0x4348, 0x5523) },
{ USB_DEVICE(0x1a86, 0x7523) },
@@ -93,8 +91,9 @@ static int ch341_control_out(struct usb_device *dev, u8 request,
u16 value, u16 index)
{
int r;
- dbg("ch341_control_out(%02x,%02x,%04x,%04x)", USB_DIR_OUT|0x40,
- (int)request, (int)value, (int)index);
+
+ dev_dbg(&dev->dev, "ch341_control_out(%02x,%02x,%04x,%04x)\n",
+ USB_DIR_OUT|0x40, (int)request, (int)value, (int)index);
r = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), request,
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
@@ -108,8 +107,10 @@ static int ch341_control_in(struct usb_device *dev,
char *buf, unsigned bufsize)
{
int r;
- dbg("ch341_control_in(%02x,%02x,%04x,%04x,%p,%u)", USB_DIR_IN|0x40,
- (int)request, (int)value, (int)index, buf, (int)bufsize);
+
+ dev_dbg(&dev->dev, "ch341_control_in(%02x,%02x,%04x,%04x,%p,%u)\n",
+ USB_DIR_IN|0x40, (int)request, (int)value, (int)index, buf,
+ (int)bufsize);
r = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), request,
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
@@ -320,7 +321,7 @@ static int ch341_open(struct tty_struct *tty, struct usb_serial_port *port)
if (r)
goto out;
- dbg("%s - submitting interrupt urb", __func__);
+ dev_dbg(&port->dev, "%s - submitting interrupt urb", __func__);
r = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
if (r) {
dev_err(&port->dev, "%s - failed submitting interrupt urb,"
@@ -390,19 +391,19 @@ static void ch341_break_ctl(struct tty_struct *tty, int break_state)
__func__, r);
goto out;
}
- dbg("%s - initial ch341 break register contents - reg1: %x, reg2: %x",
- __func__, break_reg[0], break_reg[1]);
+ dev_dbg(&port->dev, "%s - initial ch341 break register contents - reg1: %x, reg2: %x\n",
+ __func__, break_reg[0], break_reg[1]);
if (break_state != 0) {
- dbg("%s - Enter break state requested", __func__);
+ dev_dbg(&port->dev, "%s - Enter break state requested\n", __func__);
break_reg[0] &= ~CH341_NBREAK_BITS_REG1;
break_reg[1] &= ~CH341_NBREAK_BITS_REG2;
} else {
- dbg("%s - Leave break state requested", __func__);
+ dev_dbg(&port->dev, "%s - Leave break state requested\n", __func__);
break_reg[0] |= CH341_NBREAK_BITS_REG1;
break_reg[1] |= CH341_NBREAK_BITS_REG2;
}
- dbg("%s - New ch341 break register contents - reg1: %x, reg2: %x",
- __func__, break_reg[0], break_reg[1]);
+ dev_dbg(&port->dev, "%s - New ch341 break register contents - reg1: %x, reg2: %x\n",
+ __func__, break_reg[0], break_reg[1]);
reg_contents = get_unaligned_le16(break_reg);
r = ch341_control_out(port->serial->dev, CH341_REQ_WRITE_REG,
ch341_break_reg, reg_contents);
@@ -451,16 +452,16 @@ static void ch341_read_int_callback(struct urb *urb)
case -ENOENT:
case -ESHUTDOWN:
/* this urb is terminated, clean up */
- dbg("%s - urb shutting down with status: %d", __func__,
- urb->status);
+ dev_dbg(&urb->dev->dev, "%s - urb shutting down with status: %d\n",
+ __func__, urb->status);
return;
default:
- dbg("%s - nonzero urb status received: %d", __func__,
- urb->status);
+ dev_dbg(&urb->dev->dev, "%s - nonzero urb status received: %d\n",
+ __func__, urb->status);
goto exit;
}
- usb_serial_debug_data(debug, &port->dev, __func__,
+ usb_serial_debug_data(&port->dev, __func__,
urb->actual_length, urb->transfer_buffer);
if (actual_length >= 4) {
@@ -536,15 +537,16 @@ static int ch341_ioctl(struct tty_struct *tty,
unsigned int cmd, unsigned long arg)
{
struct usb_serial_port *port = tty->driver_data;
- dbg("%s (%d) cmd = 0x%04x", __func__, port->number, cmd);
+
+ dev_dbg(&port->dev, "%s (%d) cmd = 0x%04x\n", __func__, port->number, cmd);
switch (cmd) {
case TIOCMIWAIT:
- dbg("%s (%d) TIOCMIWAIT", __func__, port->number);
+ dev_dbg(&port->dev, "%s (%d) TIOCMIWAIT\n", __func__, port->number);
return wait_modem_info(port, arg);
default:
- dbg("%s not supported = 0x%04x", __func__, cmd);
+ dev_dbg(&port->dev, "%s not supported = 0x%04x\n", __func__, cmd);
break;
}
@@ -572,7 +574,7 @@ static int ch341_tiocmget(struct tty_struct *tty)
| ((status & CH341_BIT_RI) ? TIOCM_RI : 0)
| ((status & CH341_BIT_DCD) ? TIOCM_CD : 0);
- dbg("%s - result = %x", __func__, result);
+ dev_dbg(&port->dev, "%s - result = %x\n", __func__, result);
return result;
}
@@ -617,6 +619,3 @@ static struct usb_serial_driver * const serial_drivers[] = {
module_usb_serial_driver(serial_drivers, id_table);
MODULE_LICENSE("GPL");
-
-module_param(debug, bool, S_IRUGO | S_IWUSR);
-MODULE_PARM_DESC(debug, "Debug enabled or not");
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
index 9a564286bfd7..5f3bcd31e204 100644
--- a/drivers/usb/serial/console.c
+++ b/drivers/usb/serial/console.c
@@ -11,6 +11,8 @@
*
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/slab.h>
@@ -20,8 +22,6 @@
#include <linux/usb.h>
#include <linux/usb/serial.h>
-static int debug;
-
struct usbcons_info {
int magic;
int break_flag;
@@ -68,8 +68,6 @@ static int usb_console_setup(struct console *co, char *options)
struct tty_struct *tty = NULL;
struct ktermios dummy;
- dbg("%s", __func__);
-
if (options) {
baud = simple_strtoul(options, NULL, 10);
s = options;
@@ -113,8 +111,7 @@ static int usb_console_setup(struct console *co, char *options)
serial = usb_serial_get_by_index(co->index);
if (serial == NULL) {
/* no device is connected yet, sorry :( */
- printk(KERN_ERR "No USB device connected to ttyUSB%i\n",
- co->index);
+ pr_err("No USB device connected to ttyUSB%i\n", co->index);
return -ENODEV;
}
@@ -213,10 +210,10 @@ static void usb_console_write(struct console *co,
if (count == 0)
return;
- dbg("%s - port %d, %d byte(s)", __func__, port->number, count);
+ pr_debug("%s - port %d, %d byte(s)\n", __func__, port->number, count);
if (!port->port.console) {
- dbg("%s - port not opened", __func__);
+ pr_debug("%s - port not opened\n", __func__);
return;
}
@@ -237,7 +234,7 @@ static void usb_console_write(struct console *co,
retval = serial->type->write(NULL, port, buf, i);
else
retval = usb_serial_generic_write(NULL, port, buf, i);
- dbg("%s - return value : %d", __func__, retval);
+ pr_debug("%s - return value : %d\n", __func__, retval);
if (lf) {
/* append CR after LF */
unsigned char cr = 13;
@@ -247,7 +244,7 @@ static void usb_console_write(struct console *co,
else
retval = usb_serial_generic_write(NULL,
port, &cr, 1);
- dbg("%s - return value : %d", __func__, retval);
+ pr_debug("%s - return value : %d\n", __func__, retval);
}
buf += i;
count -= i;
@@ -284,10 +281,8 @@ void usb_serial_console_disconnect(struct usb_serial *serial)
}
}
-void usb_serial_console_init(int serial_debug, int minor)
+void usb_serial_console_init(int minor)
{
- debug = serial_debug;
-
if (minor == 0) {
/*
* Call register_console() if this is the first device plugged
@@ -302,7 +297,7 @@ void usb_serial_console_init(int serial_debug, int minor)
* register_console). console_write() is called immediately
* from register_console iff CON_PRINTBUFFER is set in flags.
*/
- dbg("registering the USB serial console.");
+ pr_debug("registering the USB serial console.\n");
register_console(&usbcons);
}
}
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index ba5e07e188a0..28af5acc3360 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -52,8 +52,6 @@ static int cp210x_startup(struct usb_serial *);
static void cp210x_release(struct usb_serial *);
static void cp210x_dtr_rts(struct usb_serial_port *p, int on);
-static bool debug;
-
static const struct usb_device_id id_table[] = {
{ USB_DEVICE(0x045B, 0x0053) }, /* Renesas RX610 RX-Stick */
{ USB_DEVICE(0x0471, 0x066A) }, /* AKTAKOM ACE-1001 cable */
@@ -304,9 +302,8 @@ static int cp210x_get_config(struct usb_serial_port *port, u8 request,
kfree(buf);
if (result != size) {
- dbg("%s - Unable to send config request, "
- "request=0x%x size=%d result=%d",
- __func__, request, size, result);
+ dev_dbg(&port->dev, "%s - Unable to send config request, request=0x%x size=%d result=%d\n",
+ __func__, request, size, result);
if (result > 0)
result = -EPROTO;
@@ -361,9 +358,8 @@ static int cp210x_set_config(struct usb_serial_port *port, u8 request,
kfree(buf);
if ((size > 2 && result != size) || result < 0) {
- dbg("%s - Unable to send request, "
- "request=0x%x size=%d result=%d",
- __func__, request, size, result);
+ dev_dbg(&port->dev, "%s - Unable to send request, request=0x%x size=%d result=%d\n",
+ __func__, request, size, result);
if (result > 0)
result = -EPROTO;
@@ -487,13 +483,14 @@ static void cp210x_get_termios(struct tty_struct *tty,
static void cp210x_get_termios_port(struct usb_serial_port *port,
unsigned int *cflagp, unsigned int *baudp)
{
+ struct device *dev = &port->dev;
unsigned int cflag, modem_ctl[4];
unsigned int baud;
unsigned int bits;
cp210x_get_config(port, CP210X_GET_BAUDRATE, &baud, 4);
- dbg("%s - baud rate = %d", __func__, baud);
+ dev_dbg(dev, "%s - baud rate = %d\n", __func__, baud);
*baudp = baud;
cflag = *cflagp;
@@ -502,31 +499,30 @@ static void cp210x_get_termios_port(struct usb_serial_port *port,
cflag &= ~CSIZE;
switch (bits & BITS_DATA_MASK) {
case BITS_DATA_5:
- dbg("%s - data bits = 5", __func__);
+ dev_dbg(dev, "%s - data bits = 5\n", __func__);
cflag |= CS5;
break;
case BITS_DATA_6:
- dbg("%s - data bits = 6", __func__);
+ dev_dbg(dev, "%s - data bits = 6\n", __func__);
cflag |= CS6;
break;
case BITS_DATA_7:
- dbg("%s - data bits = 7", __func__);
+ dev_dbg(dev, "%s - data bits = 7\n", __func__);
cflag |= CS7;
break;
case BITS_DATA_8:
- dbg("%s - data bits = 8", __func__);
+ dev_dbg(dev, "%s - data bits = 8\n", __func__);
cflag |= CS8;
break;
case BITS_DATA_9:
- dbg("%s - data bits = 9 (not supported, using 8 data bits)",
- __func__);
+ dev_dbg(dev, "%s - data bits = 9 (not supported, using 8 data bits)\n", __func__);
cflag |= CS8;
bits &= ~BITS_DATA_MASK;
bits |= BITS_DATA_8;
cp210x_set_config(port, CP210X_SET_LINE_CTL, &bits, 2);
break;
default:
- dbg("%s - Unknown number of data bits, using 8", __func__);
+ dev_dbg(dev, "%s - Unknown number of data bits, using 8\n", __func__);
cflag |= CS8;
bits &= ~BITS_DATA_MASK;
bits |= BITS_DATA_8;
@@ -536,29 +532,29 @@ static void cp210x_get_termios_port(struct usb_serial_port *port,
switch (bits & BITS_PARITY_MASK) {
case BITS_PARITY_NONE:
- dbg("%s - parity = NONE", __func__);
+ dev_dbg(dev, "%s - parity = NONE\n", __func__);
cflag &= ~PARENB;
break;
case BITS_PARITY_ODD:
- dbg("%s - parity = ODD", __func__);
+ dev_dbg(dev, "%s - parity = ODD\n", __func__);
cflag |= (PARENB|PARODD);
break;
case BITS_PARITY_EVEN:
- dbg("%s - parity = EVEN", __func__);
+ dev_dbg(dev, "%s - parity = EVEN\n", __func__);
cflag &= ~PARODD;
cflag |= PARENB;
break;
case BITS_PARITY_MARK:
- dbg("%s - parity = MARK", __func__);
+ dev_dbg(dev, "%s - parity = MARK\n", __func__);
cflag |= (PARENB|PARODD|CMSPAR);
break;
case BITS_PARITY_SPACE:
- dbg("%s - parity = SPACE", __func__);
+ dev_dbg(dev, "%s - parity = SPACE\n", __func__);
cflag &= ~PARODD;
cflag |= (PARENB|CMSPAR);
break;
default:
- dbg("%s - Unknown parity mode, disabling parity", __func__);
+ dev_dbg(dev, "%s - Unknown parity mode, disabling parity\n", __func__);
cflag &= ~PARENB;
bits &= ~BITS_PARITY_MASK;
cp210x_set_config(port, CP210X_SET_LINE_CTL, &bits, 2);
@@ -568,21 +564,19 @@ static void cp210x_get_termios_port(struct usb_serial_port *port,
cflag &= ~CSTOPB;
switch (bits & BITS_STOP_MASK) {
case BITS_STOP_1:
- dbg("%s - stop bits = 1", __func__);
+ dev_dbg(dev, "%s - stop bits = 1\n", __func__);
break;
case BITS_STOP_1_5:
- dbg("%s - stop bits = 1.5 (not supported, using 1 stop bit)",
- __func__);
+ dev_dbg(dev, "%s - stop bits = 1.5 (not supported, using 1 stop bit)\n", __func__);
bits &= ~BITS_STOP_MASK;
cp210x_set_config(port, CP210X_SET_LINE_CTL, &bits, 2);
break;
case BITS_STOP_2:
- dbg("%s - stop bits = 2", __func__);
+ dev_dbg(dev, "%s - stop bits = 2\n", __func__);
cflag |= CSTOPB;
break;
default:
- dbg("%s - Unknown number of stop bits, using 1 stop bit",
- __func__);
+ dev_dbg(dev, "%s - Unknown number of stop bits, using 1 stop bit\n", __func__);
bits &= ~BITS_STOP_MASK;
cp210x_set_config(port, CP210X_SET_LINE_CTL, &bits, 2);
break;
@@ -590,10 +584,10 @@ static void cp210x_get_termios_port(struct usb_serial_port *port,
cp210x_get_config(port, CP210X_GET_FLOW, modem_ctl, 16);
if (modem_ctl[0] & 0x0008) {
- dbg("%s - flow control = CRTSCTS", __func__);
+ dev_dbg(dev, "%s - flow control = CRTSCTS\n", __func__);
cflag |= CRTSCTS;
} else {
- dbg("%s - flow control = NONE", __func__);
+ dev_dbg(dev, "%s - flow control = NONE\n", __func__);
cflag &= ~CRTSCTS;
}
@@ -640,7 +634,7 @@ static void cp210x_change_speed(struct tty_struct *tty,
*/
baud = cp210x_quantise_baudrate(baud);
- dbg("%s - setting baud rate to %u", __func__, baud);
+ dev_dbg(&port->dev, "%s - setting baud rate to %u\n", __func__, baud);
if (cp210x_set_config(port, CP210X_SET_BAUDRATE, &baud,
sizeof(baud))) {
dev_warn(&port->dev, "failed to set baud rate to %u\n", baud);
@@ -656,11 +650,12 @@ static void cp210x_change_speed(struct tty_struct *tty,
static void cp210x_set_termios(struct tty_struct *tty,
struct usb_serial_port *port, struct ktermios *old_termios)
{
+ struct device *dev = &port->dev;
unsigned int cflag, old_cflag;
unsigned int bits;
unsigned int modem_ctl[4];
- dbg("%s - port %d", __func__, port->number);
+ dev_dbg(dev, "%s - port %d\n", __func__, port->number);
if (!tty)
return;
@@ -678,34 +673,31 @@ static void cp210x_set_termios(struct tty_struct *tty,
switch (cflag & CSIZE) {
case CS5:
bits |= BITS_DATA_5;
- dbg("%s - data bits = 5", __func__);
+ dev_dbg(dev, "%s - data bits = 5\n", __func__);
break;