[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201204164739.781812-4-maz@kernel.org>
Date: Fri, 4 Dec 2020 16:47:38 +0000
From: Marc Zyngier <maz@...nel.org>
To: linux-usb@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Johan Hovold <johan@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
kernel-team@...roid.com
Subject: [PATCH 3/4] 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.
Also, tell the user about the magic ftx-prog tool that can
make GPIOs appear: https://github.com/richardeoin/ftx-prog
Suggested-by: Linus Walleij <linus.walleij@...aro.org>
Signed-off-by: Marc Zyngier <maz@...nel.org>
---
drivers/usb/serial/ftdi_sio.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 13e575f16bcd..b9d3b33891fc 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -2012,6 +2012,15 @@ static int ftdi_gpio_init_valid_mask(struct gpio_chip *gc,
bitmap_complement(valid_mask, &map, ngpios);
+ if (bitmap_empty(valid_mask, ngpios))
+ dev_warn(&port->dev, "No usable GPIO\n");
+ else
+ dev_info(&port->dev, "Enabling CBUS%*pbl for GPIO\n",
+ ngpios, valid_mask);
+
+ if (!bitmap_full(valid_mask, ngpios))
+ dev_warn_once(&port->dev, "Consider using a tool such as ftx-prog to enable GPIOs if required\n");
+
return 0;
}
--
2.28.0
Powered by blists - more mailing lists