mirror of
https://github.com/torvalds/linux.git
synced 2026-05-22 14:12:07 +02:00
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. -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQQHbPq+cpGvN/peuzMLxc3C7H1lCAUCaIICfQAKCRALxc3C7H1l CHV4AQCvorLSquAZcYd//Ytx7p8p26TTG1fYHsxiLeyCdBqcLQD/YPMNoJrKTRBL in3L3/ldbBrGr6vI8cTvQYVmlWtJ/w4= =NGRU -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
acd4692a84
|
|
@ -1504,7 +1504,7 @@ static int cp210x_gpio_get(struct gpio_chip *gc, unsigned int gpio)
|
|||
return !!(mask & BIT(gpio));
|
||||
}
|
||||
|
||||
static void cp210x_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value)
|
||||
static int cp210x_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value)
|
||||
{
|
||||
struct usb_serial *serial = gpiochip_get_data(gc);
|
||||
struct cp210x_serial_private *priv = usb_get_serial_data(serial);
|
||||
|
|
@ -1559,7 +1559,10 @@ static void cp210x_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value)
|
|||
if (result < 0) {
|
||||
dev_err(&serial->interface->dev, "failed to set GPIO value: %d\n",
|
||||
result);
|
||||
return result;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cp210x_gpio_direction_get(struct gpio_chip *gc, unsigned int gpio)
|
||||
|
|
@ -1599,9 +1602,8 @@ static int cp210x_gpio_direction_output(struct gpio_chip *gc, unsigned int gpio,
|
|||
struct cp210x_serial_private *priv = usb_get_serial_data(serial);
|
||||
|
||||
priv->gpio_input &= ~BIT(gpio);
|
||||
cp210x_gpio_set(gc, gpio, value);
|
||||
|
||||
return 0;
|
||||
return cp210x_gpio_set(gc, gpio, value);
|
||||
}
|
||||
|
||||
static int cp210x_gpio_set_config(struct gpio_chip *gc, unsigned int gpio,
|
||||
|
|
@ -1960,7 +1962,7 @@ static int cp210x_gpio_init(struct usb_serial *serial)
|
|||
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_rv = 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;
|
||||
|
|
|
|||
|
|
@ -1859,10 +1859,11 @@ static int ftdi_gpio_get(struct gpio_chip *gc, unsigned int gpio)
|
|||
return !!(result & BIT(gpio));
|
||||
}
|
||||
|
||||
static void ftdi_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value)
|
||||
static int ftdi_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value)
|
||||
{
|
||||
struct usb_serial_port *port = gpiochip_get_data(gc);
|
||||
struct ftdi_private *priv = usb_get_serial_port_data(port);
|
||||
int result;
|
||||
|
||||
mutex_lock(&priv->gpio_lock);
|
||||
|
||||
|
|
@ -1871,9 +1872,11 @@ static void ftdi_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value)
|
|||
else
|
||||
priv->gpio_value &= ~BIT(gpio);
|
||||
|
||||
ftdi_set_cbus_pins(port);
|
||||
result = ftdi_set_cbus_pins(port);
|
||||
|
||||
mutex_unlock(&priv->gpio_lock);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static int ftdi_gpio_get_multiple(struct gpio_chip *gc, unsigned long *mask,
|
||||
|
|
@ -1891,19 +1894,22 @@ static int ftdi_gpio_get_multiple(struct gpio_chip *gc, unsigned long *mask,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void ftdi_gpio_set_multiple(struct gpio_chip *gc, unsigned long *mask,
|
||||
static int ftdi_gpio_set_multiple(struct gpio_chip *gc, unsigned long *mask,
|
||||
unsigned long *bits)
|
||||
{
|
||||
struct usb_serial_port *port = gpiochip_get_data(gc);
|
||||
struct ftdi_private *priv = usb_get_serial_port_data(port);
|
||||
int result;
|
||||
|
||||
mutex_lock(&priv->gpio_lock);
|
||||
|
||||
priv->gpio_value &= ~(*mask);
|
||||
priv->gpio_value |= *bits & *mask;
|
||||
ftdi_set_cbus_pins(port);
|
||||
result = ftdi_set_cbus_pins(port);
|
||||
|
||||
mutex_unlock(&priv->gpio_lock);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static int ftdi_gpio_direction_get(struct gpio_chip *gc, unsigned int gpio)
|
||||
|
|
@ -2144,9 +2150,9 @@ static int ftdi_gpio_init(struct usb_serial_port *port)
|
|||
priv->gc.direction_output = ftdi_gpio_direction_output;
|
||||
priv->gc.init_valid_mask = ftdi_gpio_init_valid_mask;
|
||||
priv->gc.get = ftdi_gpio_get;
|
||||
priv->gc.set = ftdi_gpio_set;
|
||||
priv->gc.set_rv = ftdi_gpio_set;
|
||||
priv->gc.get_multiple = ftdi_gpio_get_multiple;
|
||||
priv->gc.set_multiple = ftdi_gpio_set_multiple;
|
||||
priv->gc.set_multiple_rv = ftdi_gpio_set_multiple;
|
||||
priv->gc.owner = THIS_MODULE;
|
||||
priv->gc.parent = &serial->interface->dev;
|
||||
priv->gc.base = -1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user