cp210x.c (b979248d16d12b913501dacd61bddc7a36aac886) cp210x.c (d07082277f55cb395be00c813c62f3c956d1edb6)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Silicon Laboratories CP210x USB to RS232 serial adaptor driver
4 *
5 * Copyright (C) 2005 Craig Shelley (craig@microtron.org.uk)
6 * Copyright (C) 2010-2021 Johan Hovold (johan@kernel.org)
7 *
8 * Support to set flow control line levels using TIOCMGET and TIOCMSET

--- 1529 unchanged lines hidden (view full) ---

1538 return -ENOTSUPP;
1539}
1540
1541static int cp210x_gpio_init_valid_mask(struct gpio_chip *gc,
1542 unsigned long *valid_mask, unsigned int ngpios)
1543{
1544 struct usb_serial *serial = gpiochip_get_data(gc);
1545 struct cp210x_serial_private *priv = usb_get_serial_data(serial);
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Silicon Laboratories CP210x USB to RS232 serial adaptor driver
4 *
5 * Copyright (C) 2005 Craig Shelley (craig@microtron.org.uk)
6 * Copyright (C) 2010-2021 Johan Hovold (johan@kernel.org)
7 *
8 * Support to set flow control line levels using TIOCMGET and TIOCMSET

--- 1529 unchanged lines hidden (view full) ---

1538 return -ENOTSUPP;
1539}
1540
1541static int cp210x_gpio_init_valid_mask(struct gpio_chip *gc,
1542 unsigned long *valid_mask, unsigned int ngpios)
1543{
1544 struct usb_serial *serial = gpiochip_get_data(gc);
1545 struct cp210x_serial_private *priv = usb_get_serial_data(serial);
1546 struct device *dev = &serial->interface->dev;
1546 unsigned long altfunc_mask = priv->gpio_altfunc;
1547
1548 bitmap_complement(valid_mask, &altfunc_mask, ngpios);
1549
1547 unsigned long altfunc_mask = priv->gpio_altfunc;
1548
1549 bitmap_complement(valid_mask, &altfunc_mask, ngpios);
1550
1551 if (bitmap_empty(valid_mask, ngpios))
1552 dev_dbg(dev, "no pin configured for GPIO\n");
1553 else
1554 dev_dbg(dev, "GPIO.%*pbl configured for GPIO\n", ngpios,
1555 valid_mask);
1550 return 0;
1551}
1552
1553/*
1554 * This function is for configuring GPIO using shared pins, where other signals
1555 * are made unavailable by configuring the use of GPIO. This is believed to be
1556 * only applicable to the cp2105 at this point, the other devices supported by
1557 * this driver that provide GPIO do so in a way that does not impact other

--- 396 unchanged lines hidden ---
1556 return 0;
1557}
1558
1559/*
1560 * This function is for configuring GPIO using shared pins, where other signals
1561 * are made unavailable by configuring the use of GPIO. This is believed to be
1562 * only applicable to the cp2105 at this point, the other devices supported by
1563 * this driver that provide GPIO do so in a way that does not impact other

--- 396 unchanged lines hidden ---