Skip to content

Commit

Permalink
Merge tag 'usb-serial-5.12-rc1' of https://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/kernel/git/johan/usb-serial into usb-next

Johan writes:

USB-serial updates for 5.12-rc1

Here are the USB-serial updates for 5.12-rc1, including:

 - a line-speed fix for newer pl2303 devices
 - a line-speed fix for FTDI FT-X devices
 - a new xr_serial driver for MaxLinear/Exar devices (non-ACM mode)
 - a cdc-acm blacklist entry for when the xr_serial driver is enabled
 - cp210x support for software flow control
 - various cp210x modem-control fixes
 - an updated ZTE P685M modem entry to stop claiming the QMI interface
 - an update to drop the port_remove() driver-callback return value

Included are also various clean ups.

All have been in linux-next with no reported issues.

* tag 'usb-serial-5.12-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: (41 commits)
  USB: serial: drop bogus to_usb_serial_port() checks
  USB: serial: make remove callback return void
  USB: serial: drop if with an always false condition
  USB: serial: option: update interface mapping for ZTE P685M
  USB: serial: ftdi_sio: restore divisor-encoding comments
  USB: serial: ftdi_sio: fix FTX sub-integer prescaler
  USB: serial: cp210x: clean up auto-RTS handling
  USB: serial: cp210x: fix RTS handling
  USB: serial: cp210x: clean up printk zero padding
  USB: serial: cp210x: clean up flow-control debug message
  USB: serial: cp210x: drop shift macros
  USB: serial: cp210x: fix modem-control handling
  USB: serial: cp210x: suppress modem-control errors
  USB: serial: mos7720: fix error code in mos7720_write()
  USB: serial: xr: fix B0 handling
  USB: serial: xr: fix pin configuration
  USB: serial: xr: fix gpio-mode handling
  USB: serial: xr: simplify line-speed logic
  USB: serial: xr: clean up line-settings handling
  USB: serial: xr: document vendor-request recipient
  ...
  • Loading branch information
gregkh committed Feb 10, 2021
2 parents 43861d2 + 1542d13 commit c85bfed
Show file tree
Hide file tree
Showing 44 changed files with 888 additions and 225 deletions.
6 changes: 6 additions & 0 deletions drivers/usb/class/cdc-acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1901,6 +1901,12 @@ static const struct usb_device_id acm_ids[] = {
},
#endif

#if IS_ENABLED(CONFIG_USB_SERIAL_XR)
{ USB_DEVICE(0x04e2, 0x1410), /* Ignore XR21V141X USB to Serial converter */
.driver_info = IGNORE_DEVICE,
},
#endif

/*Samsung phone in firmware update mode */
{ USB_DEVICE(0x04e8, 0x685d),
.driver_info = IGNORE_DEVICE,
Expand Down
9 changes: 9 additions & 0 deletions drivers/usb/serial/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,15 @@ config USB_SERIAL_UPD78F0730
To compile this driver as a module, choose M here: the
module will be called upd78f0730.

config USB_SERIAL_XR
tristate "USB MaxLinear/Exar USB to Serial driver"
help
Say Y here if you want to use MaxLinear/Exar USB to Serial converter
devices.

To compile this driver as a module, choose M here: the
module will be called xr_serial.

config USB_SERIAL_DEBUG
tristate "USB Debugging Device"
help
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/serial/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ obj-$(CONFIG_USB_SERIAL_UPD78F0730) += upd78f0730.o
obj-$(CONFIG_USB_SERIAL_VISOR) += visor.o
obj-$(CONFIG_USB_SERIAL_WISHBONE) += wishbone-serial.o
obj-$(CONFIG_USB_SERIAL_WHITEHEAT) += whiteheat.o
obj-$(CONFIG_USB_SERIAL_XR) += xr_serial.o
obj-$(CONFIG_USB_SERIAL_XSENS_MT) += xsens_mt.o
4 changes: 1 addition & 3 deletions drivers/usb/serial/ark3116.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,13 @@ static int ark3116_port_probe(struct usb_serial_port *port)
return 0;
}

static int ark3116_port_remove(struct usb_serial_port *port)
static void ark3116_port_remove(struct usb_serial_port *port)
{
struct ark3116_private *priv = usb_get_serial_port_data(port);

/* device is closed, so URBs and DMA should be down */
mutex_destroy(&priv->hw_lock);
kfree(priv);

return 0;
}

static void ark3116_set_termios(struct tty_struct *tty,
Expand Down
6 changes: 2 additions & 4 deletions drivers/usb/serial/belkin_sa.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

/* function prototypes for a Belkin USB Serial Adapter F5U103 */
static int belkin_sa_port_probe(struct usb_serial_port *port);
static int belkin_sa_port_remove(struct usb_serial_port *port);
static void belkin_sa_port_remove(struct usb_serial_port *port);
static int belkin_sa_open(struct tty_struct *tty,
struct usb_serial_port *port);
static void belkin_sa_close(struct usb_serial_port *port);
Expand Down Expand Up @@ -134,14 +134,12 @@ static int belkin_sa_port_probe(struct usb_serial_port *port)
return 0;
}

static int belkin_sa_port_remove(struct usb_serial_port *port)
static void belkin_sa_port_remove(struct usb_serial_port *port)
{
struct belkin_sa_private *priv;

priv = usb_get_serial_port_data(port);
kfree(priv);

return 0;
}

static int belkin_sa_open(struct tty_struct *tty,
Expand Down
27 changes: 6 additions & 21 deletions drivers/usb/serial/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,13 @@
static int usb_serial_device_match(struct device *dev,
struct device_driver *drv)
{
struct usb_serial_driver *driver;
const struct usb_serial_port *port;
const struct usb_serial_port *port = to_usb_serial_port(dev);
struct usb_serial_driver *driver = to_usb_serial_driver(drv);

/*
* drivers are already assigned to ports in serial_probe so it's
* a simple check here.
*/
port = to_usb_serial_port(dev);
if (!port)
return 0;

driver = to_usb_serial_driver(drv);

if (driver == port->serial->type)
return 1;

Expand All @@ -37,16 +31,12 @@ static int usb_serial_device_match(struct device *dev,

static int usb_serial_device_probe(struct device *dev)
{
struct usb_serial_port *port = to_usb_serial_port(dev);
struct usb_serial_driver *driver;
struct usb_serial_port *port;
struct device *tty_dev;
int retval = 0;
int minor;

port = to_usb_serial_port(dev);
if (!port)
return -ENODEV;

/* make sure suspend/resume doesn't race against port_probe */
retval = usb_autopm_get_interface(port->serial->interface);
if (retval)
Expand Down Expand Up @@ -86,16 +76,11 @@ static int usb_serial_device_probe(struct device *dev)

static int usb_serial_device_remove(struct device *dev)
{
struct usb_serial_port *port = to_usb_serial_port(dev);
struct usb_serial_driver *driver;
struct usb_serial_port *port;
int retval = 0;
int minor;
int autopm_err;

port = to_usb_serial_port(dev);
if (!port)
return -ENODEV;

/*
* Make sure suspend/resume doesn't race against port_remove.
*
Expand All @@ -109,15 +94,15 @@ static int usb_serial_device_remove(struct device *dev)

driver = port->serial->type;
if (driver->port_remove)
retval = driver->port_remove(port);
driver->port_remove(port);

dev_info(dev, "%s converter now disconnected from ttyUSB%d\n",
driver->description, minor);

if (!autopm_err)
usb_autopm_put_interface(port->serial->interface);

return retval;
return 0;
}

static ssize_t new_id_store(struct device_driver *driver,
Expand Down
4 changes: 1 addition & 3 deletions drivers/usb/serial/ch341.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,14 +419,12 @@ error: kfree(priv);
return r;
}

static int ch341_port_remove(struct usb_serial_port *port)
static void ch341_port_remove(struct usb_serial_port *port)
{
struct ch341_private *priv;

priv = usb_get_serial_port_data(port);
kfree(priv);

return 0;
}

static int ch341_carrier_raised(struct usb_serial_port *port)
Expand Down
Loading

0 comments on commit c85bfed

Please sign in to comment.