USB: ftdio_sio: GPIO validity fixes
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 18 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | gpiolib: cdev: Flag invalid GPIOs as useddrivers/ | +1 | 3 replies | |
| 2/4 | USB: serial: ftdi_sio: Report the valid GPIO lines to gpiolibdrivers/ | +14 | 1 reply | |
| 3/4 | USB: serial: ftdi_sio: Log the CBUS GPIO validitydrivers/ | +9 | 6 replies | |
| 4/4 | USB: serial: ftdi_sio: Drop GPIO line checking dead codedrivers/ | +0 | 0 replies |
Reviews trailers per patch
1 of 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Andy Shevchenko | Linus Walleij |
|---|---|---|
| Series | R-b | |
| 1/4 | ||
| 2/4 | R-b | |
| 3/4 | ||
| 4/4 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/4] USB: ftdio_sio: GPIO validity fixes
Having recently tried to use the CBUS GPIOs that come thanks to the ftdio_sio driver, it occurred to me that the driver has a couple of usability issues:
- it advertises potential GPIOs that are reserved to other uses (LED control, or something else)
- it returns an odd error (-ENODEV), instead of the expected -EINVAL when a line is unavailable, leading to a difficult diagnostic
We address the issues in a number of ways:
- Stop reporting invalid GPIO lines as valid to userspace. It definitely seems odd to do so. Instead, report the line as being used, making the userspace interface a bit more consistent.
- Implement the init_valid_mask() callback in the ftdi_sio driver, allowing it to report which lines are actually valid.
- As suggested by Linus, give an indication to the user of why some of the GPIO lines are unavailable, and point them to a useful tool (once per boot). It is a bit sad that there next to no documentation on how to use these CBUS pins.
- Drop the error reporting code, which has become useless at this point.
Tested with a couple of FTDI devices (FT230X and FT231X) and various CBUS configurations.
Marc Zyngier (4):
gpiolib: cdev: Flag invalid GPIOs as used
USB: serial: ftdi_sio: Report the valid GPIO lines to gpiolib
USB: serial: ftdi_sio: Log the CBUS GPIO validity
USB: serial: ftdi_sio: Drop GPIO line checking dead code
drivers/gpio/gpiolib-cdev.c | 1 + drivers/usb/serial/ftdi_sio.c | 26 +++++++++++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-)
Signature · 1 line
2.28.0