Commit 7e25c20d authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'usb-serial-5.13-rc1' of...

Merge tag 'usb-serial-5.13-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next

Johan writes:

USB-serial updates for 5.13-rc1

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

 - better type detection for pl2303
 - support for more line speeds for pl2303 (TA/TB)
 - fixed CSIZE handling for the new xr driver
 - core support for multi-interface functions
 - TIOCGSERIAL and TIOCSSERIAL fixes
 - generic TIOCSSERIAL support (e.g. for closing_wait)
 - fixed return value for unsupported ioctls
 - support for gpio valid masks in cp210x
 - drain-delay fixes and improvements
 - support for multi-port devices for xr
 - generalisation of the xr driver to support three new device classes
   (XR21B142X, XR21B1411 and XR2280X)

Included are also various clean ups.

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

* tag 'usb-serial-5.13-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: (72 commits)
  USB: cdc-acm: add more Maxlinear/Exar models to ignore list
  USB: serial: xr: add copyright notice
  USB: serial: xr: reset FIFOs on open
  USB: serial: xr: add support for XR22801, XR22802, XR22804
  USB: serial: xr: add support for XR21B1411
  USB: serial: xr: add support for XR21B1421, XR21B1422 and XR21B1424
  USB: serial: xr: add type abstraction
  USB: serial: xr: drop type prefix from shared defines
  USB: serial: xr: move pin configuration to probe
  USB: serial: xr: rename GPIO-pin defines
  USB: serial: xr: rename GPIO-mode defines
  USB: serial: xr: add support for XR21V1412 and XR21V1414
  USB: serial: ti_usb_3410_5052: clean up termios CSIZE handling
  USB: serial: ti_usb_3410_5052: use kernel types consistently
  USB: serial: ti_usb_3410_5052: add port-command helpers
  USB: serial: ti_usb_3410_5052: clean up vendor-request helpers
  USB: serial: ti_usb_3410_5052: drop unnecessary packed attributes
  USB: serial: io_ti: drop unnecessary packed attributes
  USB: serial: io_ti: use kernel types consistently
  USB: serial: io_ti: add read-port-command helper
  ...
parents 3232a3ce 039b81d5
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -1913,9 +1913,17 @@ 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,
	},
	{ USB_DEVICE(0x04e2, 0x1400), .driver_info = IGNORE_DEVICE },
	{ USB_DEVICE(0x04e2, 0x1401), .driver_info = IGNORE_DEVICE },
	{ USB_DEVICE(0x04e2, 0x1402), .driver_info = IGNORE_DEVICE },
	{ USB_DEVICE(0x04e2, 0x1403), .driver_info = IGNORE_DEVICE },
	{ USB_DEVICE(0x04e2, 0x1410), .driver_info = IGNORE_DEVICE },
	{ USB_DEVICE(0x04e2, 0x1411), .driver_info = IGNORE_DEVICE },
	{ USB_DEVICE(0x04e2, 0x1412), .driver_info = IGNORE_DEVICE },
	{ USB_DEVICE(0x04e2, 0x1414), .driver_info = IGNORE_DEVICE },
	{ USB_DEVICE(0x04e2, 0x1420), .driver_info = IGNORE_DEVICE },
	{ USB_DEVICE(0x04e2, 0x1422), .driver_info = IGNORE_DEVICE },
	{ USB_DEVICE(0x04e2, 0x1424), .driver_info = IGNORE_DEVICE },
#endif

	/*Samsung phone in firmware update mode */
+0 −13
Original line number Diff line number Diff line
@@ -385,18 +385,6 @@ static int ark3116_open(struct tty_struct *tty, struct usb_serial_port *port)
	return result;
}

static int ark3116_get_serial_info(struct tty_struct *tty,
			struct serial_struct *ss)
{
	struct usb_serial_port *port = tty->driver_data;

	ss->type = PORT_16654;
	ss->line = port->minor;
	ss->port = port->port_number;
	ss->baud_base = 460800;
	return 0;
}

static int ark3116_tiocmget(struct tty_struct *tty)
{
	struct usb_serial_port *port = tty->driver_data;
@@ -633,7 +621,6 @@ static struct usb_serial_driver ark3116_device = {
	.port_probe =		ark3116_port_probe,
	.port_remove =		ark3116_port_remove,
	.set_termios =		ark3116_set_termios,
	.get_serial =		ark3116_get_serial_info,
	.tiocmget =		ark3116_tiocmget,
	.tiocmset =		ark3116_tiocmset,
	.tiocmiwait =		usb_serial_generic_tiocmiwait,
+19 −12
Original line number Diff line number Diff line
@@ -1410,17 +1410,6 @@ static void cp210x_break_ctl(struct tty_struct *tty, int break_state)
}

#ifdef CONFIG_GPIOLIB
static int cp210x_gpio_request(struct gpio_chip *gc, unsigned int offset)
{
	struct usb_serial *serial = gpiochip_get_data(gc);
	struct cp210x_serial_private *priv = usb_get_serial_data(serial);

	if (priv->gpio_altfunc & BIT(offset))
		return -ENODEV;

	return 0;
}

static int cp210x_gpio_get(struct gpio_chip *gc, unsigned int gpio)
{
	struct usb_serial *serial = gpiochip_get_data(gc);
@@ -1549,6 +1538,24 @@ static int cp210x_gpio_set_config(struct gpio_chip *gc, unsigned int gpio,
	return -ENOTSUPP;
}

static int cp210x_gpio_init_valid_mask(struct gpio_chip *gc,
		unsigned long *valid_mask, unsigned int ngpios)
{
	struct usb_serial *serial = gpiochip_get_data(gc);
	struct cp210x_serial_private *priv = usb_get_serial_data(serial);
	struct device *dev = &serial->interface->dev;
	unsigned long altfunc_mask = priv->gpio_altfunc;

	bitmap_complement(valid_mask, &altfunc_mask, ngpios);

	if (bitmap_empty(valid_mask, ngpios))
		dev_dbg(dev, "no pin configured for GPIO\n");
	else
		dev_dbg(dev, "GPIO.%*pbl configured for GPIO\n", ngpios,
				valid_mask);
	return 0;
}

/*
 * This function is for configuring GPIO using shared pins, where other signals
 * are made unavailable by configuring the use of GPIO. This is believed to be
@@ -1786,13 +1793,13 @@ static int cp210x_gpio_init(struct usb_serial *serial)
		return result;

	priv->gc.label = "cp210x";
	priv->gc.request = cp210x_gpio_request;
	priv->gc.get_direction = cp210x_gpio_direction_get;
	priv->gc.direction_input = cp210x_gpio_direction_input;
	priv->gc.direction_output = cp210x_gpio_direction_output;
	priv->gc.get = cp210x_gpio_get;
	priv->gc.set = cp210x_gpio_set;
	priv->gc.set_config = cp210x_gpio_set_config;
	priv->gc.init_valid_mask = cp210x_gpio_init_valid_mask;
	priv->gc.owner = THIS_MODULE;
	priv->gc.parent = &serial->interface->dev;
	priv->gc.base = -1;
+3 −9
Original line number Diff line number Diff line
@@ -820,17 +820,12 @@ static int f81232_carrier_raised(struct usb_serial_port *port)
	return 0;
}

static int f81232_get_serial_info(struct tty_struct *tty,
		struct serial_struct *ss)
static void f81232_get_serial(struct tty_struct *tty, struct serial_struct *ss)
{
	struct usb_serial_port *port = tty->driver_data;
	struct f81232_private *priv = usb_get_serial_port_data(port);

	ss->type = PORT_16550A;
	ss->line = port->minor;
	ss->port = port->port_number;
	ss->baud_base = priv->baud_base;
	return 0;
}

static void  f81232_interrupt_work(struct work_struct *work)
@@ -953,7 +948,6 @@ static int f81232_port_probe(struct usb_serial_port *port)

	usb_set_serial_port_data(port, priv);

	port->port.drain_delay = 256;
	priv->port = port;

	return 0;
@@ -1021,7 +1015,7 @@ static struct usb_serial_driver f81232_device = {
	.close =		f81232_close,
	.dtr_rts =		f81232_dtr_rts,
	.carrier_raised =	f81232_carrier_raised,
	.get_serial =		f81232_get_serial_info,
	.get_serial =		f81232_get_serial,
	.break_ctl =		f81232_break_ctl,
	.set_termios =		f81232_set_termios,
	.tiocmget =		f81232_tiocmget,
@@ -1046,7 +1040,7 @@ static struct usb_serial_driver f81534a_device = {
	.close =		f81232_close,
	.dtr_rts =		f81232_dtr_rts,
	.carrier_raised =	f81232_carrier_raised,
	.get_serial =		f81232_get_serial_info,
	.get_serial =		f81232_get_serial,
	.break_ctl =		f81232_break_ctl,
	.set_termios =		f81232_set_termios,
	.tiocmget =		f81232_tiocmget,
+1 −6
Original line number Diff line number Diff line
@@ -1140,19 +1140,14 @@ static void f81534_close(struct usb_serial_port *port)
	mutex_unlock(&serial_priv->urb_mutex);
}

static int f81534_get_serial_info(struct tty_struct *tty,
				  struct serial_struct *ss)
static void f81534_get_serial_info(struct tty_struct *tty, struct serial_struct *ss)
{
	struct usb_serial_port *port = tty->driver_data;
	struct f81534_port_private *port_priv;

	port_priv = usb_get_serial_port_data(port);

	ss->type = PORT_16550A;
	ss->port = port->port_number;
	ss->line = port->minor;
	ss->baud_base = port_priv->baud_base;
	return 0;
}

static void f81534_process_per_serial_block(struct usb_serial_port *port,
Loading