summaryrefslogtreecommitdiff
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2020-12-04 16:47:38 +0000
committerJohan Hovold <johan@kernel.org>2020-12-09 18:07:03 +0100
commitfddd408ad448efc49c67f8dfdc4e86b31c683a0c (patch)
tree2a2bc7b387760ddfa8816605f88400a7f3a16264 /drivers/usb/serial
parent5d47c887cceed5261e82e2cc7e996b877d5381f8 (diff)
USB: serial: ftdi_sio: log the CBUS GPIO validity
The validity of the ftdi CBUS GPIO is pretty hidden so far, and finding out *why* some GPIOs don't work is sometimes hard to identify. So let's help the user by displaying the map of the CBUS pins that are valid for a GPIO. Suggested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20201204164739.781812-4-maz@kernel.org Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> [johan: demote to KERN_DEBUG, rephrase messages, drop ftx-prog warning] Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/ftdi_sio.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index a41ce9e60b96..94398f89e600 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -2009,6 +2009,12 @@ static int ftdi_gpio_init_valid_mask(struct gpio_chip *gc,
bitmap_complement(valid_mask, &map, ngpios);
+ if (bitmap_empty(valid_mask, ngpios))
+ dev_dbg(&port->dev, "no CBUS pin configured for GPIO\n");
+ else
+ dev_dbg(&port->dev, "CBUS%*pbl configured for GPIO\n", ngpios,
+ valid_mask);
+
return 0;
}