summaryrefslogtreecommitdiff
path: root/drivers/usb/serial/cp210x.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2021-04-09 18:52:16 +0300
committerJohan Hovold <johan@kernel.org>2021-04-12 12:58:42 +0300
commitd07082277f55cb395be00c813c62f3c956d1edb6 (patch)
tree3189057a7eb7ae66ed1b8c6558e81227c794e441 /drivers/usb/serial/cp210x.c
parentb979248d16d12b913501dacd61bddc7a36aac886 (diff)
downloadlinux-d07082277f55cb395be00c813c62f3c956d1edb6.tar.xz
USB: serial: cp210x: add gpio-configuration debug printk
Add a debug printk to dump the GPIO configuration stored in EEPROM during probe. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial/cp210x.c')
-rw-r--r--drivers/usb/serial/cp210x.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index ceb3a656a075..ee595d1bea0a 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -1543,10 +1543,16 @@ static int cp210x_gpio_init_valid_mask(struct gpio_chip *gc,
{
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;
}