Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

Johan writes:

USB serial updates for 6.17-rc1

Here are the USB serial updates for 6.17-rc1, including

- switch to new gpiolib interface that can return errors

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

* tag 'usb-serial-6.17-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial:
USB: serial: cp210x: use new GPIO line value setter callbacks
USB: serial: ftdi_sio: use new GPIO line value setter callbacks

+18 -10
+6 -4
drivers/usb/serial/cp210x.c
··· 1504 1504 return !!(mask & BIT(gpio)); 1505 1505 } 1506 1506 1507 - static void cp210x_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value) 1507 + static int cp210x_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value) 1508 1508 { 1509 1509 struct usb_serial *serial = gpiochip_get_data(gc); 1510 1510 struct cp210x_serial_private *priv = usb_get_serial_data(serial); ··· 1559 1559 if (result < 0) { 1560 1560 dev_err(&serial->interface->dev, "failed to set GPIO value: %d\n", 1561 1561 result); 1562 + return result; 1562 1563 } 1564 + 1565 + return 0; 1563 1566 } 1564 1567 1565 1568 static int cp210x_gpio_direction_get(struct gpio_chip *gc, unsigned int gpio) ··· 1602 1599 struct cp210x_serial_private *priv = usb_get_serial_data(serial); 1603 1600 1604 1601 priv->gpio_input &= ~BIT(gpio); 1605 - cp210x_gpio_set(gc, gpio, value); 1606 1602 1607 - return 0; 1603 + return cp210x_gpio_set(gc, gpio, value); 1608 1604 } 1609 1605 1610 1606 static int cp210x_gpio_set_config(struct gpio_chip *gc, unsigned int gpio, ··· 1962 1960 priv->gc.direction_input = cp210x_gpio_direction_input; 1963 1961 priv->gc.direction_output = cp210x_gpio_direction_output; 1964 1962 priv->gc.get = cp210x_gpio_get; 1965 - priv->gc.set = cp210x_gpio_set; 1963 + priv->gc.set_rv = cp210x_gpio_set; 1966 1964 priv->gc.set_config = cp210x_gpio_set_config; 1967 1965 priv->gc.init_valid_mask = cp210x_gpio_init_valid_mask; 1968 1966 priv->gc.owner = THIS_MODULE;
+12 -6
drivers/usb/serial/ftdi_sio.c
··· 1859 1859 return !!(result & BIT(gpio)); 1860 1860 } 1861 1861 1862 - static void ftdi_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value) 1862 + static int ftdi_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value) 1863 1863 { 1864 1864 struct usb_serial_port *port = gpiochip_get_data(gc); 1865 1865 struct ftdi_private *priv = usb_get_serial_port_data(port); 1866 + int result; 1866 1867 1867 1868 mutex_lock(&priv->gpio_lock); 1868 1869 ··· 1872 1871 else 1873 1872 priv->gpio_value &= ~BIT(gpio); 1874 1873 1875 - ftdi_set_cbus_pins(port); 1874 + result = ftdi_set_cbus_pins(port); 1876 1875 1877 1876 mutex_unlock(&priv->gpio_lock); 1877 + 1878 + return result; 1878 1879 } 1879 1880 1880 1881 static int ftdi_gpio_get_multiple(struct gpio_chip *gc, unsigned long *mask, ··· 1894 1891 return 0; 1895 1892 } 1896 1893 1897 - static void ftdi_gpio_set_multiple(struct gpio_chip *gc, unsigned long *mask, 1894 + static int ftdi_gpio_set_multiple(struct gpio_chip *gc, unsigned long *mask, 1898 1895 unsigned long *bits) 1899 1896 { 1900 1897 struct usb_serial_port *port = gpiochip_get_data(gc); 1901 1898 struct ftdi_private *priv = usb_get_serial_port_data(port); 1899 + int result; 1902 1900 1903 1901 mutex_lock(&priv->gpio_lock); 1904 1902 1905 1903 priv->gpio_value &= ~(*mask); 1906 1904 priv->gpio_value |= *bits & *mask; 1907 - ftdi_set_cbus_pins(port); 1905 + result = ftdi_set_cbus_pins(port); 1908 1906 1909 1907 mutex_unlock(&priv->gpio_lock); 1908 + 1909 + return result; 1910 1910 } 1911 1911 1912 1912 static int ftdi_gpio_direction_get(struct gpio_chip *gc, unsigned int gpio) ··· 2150 2144 priv->gc.direction_output = ftdi_gpio_direction_output; 2151 2145 priv->gc.init_valid_mask = ftdi_gpio_init_valid_mask; 2152 2146 priv->gc.get = ftdi_gpio_get; 2153 - priv->gc.set = ftdi_gpio_set; 2147 + priv->gc.set_rv = ftdi_gpio_set; 2154 2148 priv->gc.get_multiple = ftdi_gpio_get_multiple; 2155 - priv->gc.set_multiple = ftdi_gpio_set_multiple; 2149 + priv->gc.set_multiple_rv = ftdi_gpio_set_multiple; 2156 2150 priv->gc.owner = THIS_MODULE; 2157 2151 priv->gc.parent = &serial->interface->dev; 2158 2152 priv->gc.base = -1;