linux/drivers/usb
Johan Hovold 83b67041f3 USB: serial: cp210x: fix CP2105 GPIO registration
When generalising GPIO support and adding support for CP2102N, the GPIO
registration for some CP2105 devices accidentally broke. Specifically,
when all the pins of a port are in "modem" mode, and thus unavailable
for GPIO use, the GPIO chip would now be registered without having
initialised the number of GPIO lines. This would in turn be rejected by
gpiolib and some errors messages would be printed (but importantly probe
would still succeed).

Fix this by initialising the number of GPIO lines before registering the
GPIO chip.

Note that as for the other device types, and as when all CP2105 pins are
muxed for LED function, the GPIO chip is registered also when no pins
are available for GPIO use.

Reported-by: Maarten Brock <m.brock@vanmierlo.com>
Link: https://lore.kernel.org/r/5eb560c81d2ea1a2b4602a92d9f48a89@vanmierlo.com
Fixes: c8acfe0aad ("USB: serial: cp210x: implement GPIO support for CP2102N")
Cc: stable@vger.kernel.org      # 4.19
Cc: Karoly Pados <pados@pados.hu>
Link: https://lore.kernel.org/r/20211126094348.31698-1-johan@kernel.org
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tested-by: Maarten Brock <m.brock@vanmierlo.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
2021-12-14 09:22:05 +01:00
..
atm usb: atm: Use struct_size() helper 2021-10-05 12:50:22 +02:00
c67x00
cdns3 Networking fixes for 5.16-rc5, including fixes from bpf, can and netfilter. 2021-12-09 11:26:44 -08:00
chipidea usb: chipidea: ci_hdrc_imx: fix potential error pointer dereference in probe 2021-11-17 15:05:18 +01:00
class Merge 5.15-rc5 into usb-next 2021-10-11 07:39:38 +02:00
common Partially revert "usb: Kconfig: using select for USB_COMMON dependency" 2021-10-05 13:45:16 +02:00
core usb: core: config: using bit mask instead of individual bits 2021-12-12 13:06:39 +01:00
dwc2 usb: dwc2: hcd_queue: Fix use of floating point literal 2021-11-17 15:03:34 +01:00
dwc3 Revert "usb: dwc3: dwc3-qcom: Enable tx-fifo-resize property by default" 2021-12-09 20:03:09 +01:00
early memblock: rename memblock_free to memblock_phys_free 2021-11-06 13:30:41 -07:00
gadget USB: gadget: zero allocate endpoint 0 buffers 2021-12-12 13:05:10 +01:00
host xhci: avoid race between disable slot command and host runtime suspend 2021-12-10 15:34:01 +01:00
image scsi: core: Remove the 'done' argument from SCSI queuecommand_lck functions 2021-10-16 21:32:16 -04:00
isp1760 usb: isp1760: otg control register access 2021-08-27 16:11:39 +02:00
misc USB: iowarrior: fix control-message timeouts 2021-10-26 19:12:28 +02:00
mon
mtu3 usb: mtu3: enable wake-up interrupt after runtime_suspend called 2021-10-27 20:49:32 +02:00
musb usb: musb: Balance list entry in musb_gadget_queue 2021-10-22 11:12:45 +02:00
phy USB: phy: tahvo:remove unnecessary debug log 2021-10-05 12:51:07 +02:00
renesas_usbhs usb: renesas_usbhs: Fix spelling mistake "faile" -> "failed" 2021-08-27 10:29:32 +02:00
roles usb: roles: add helper usb_role_string() 2021-05-27 09:17:18 +02:00
serial USB: serial: cp210x: fix CP2105 GPIO registration 2021-12-14 09:22:05 +01:00
storage SCSI misc on 20211105 2021-11-05 08:42:02 -07:00
typec usb: typec: tcpm: Wait in SNK_DEBOUNCED until disconnect 2021-12-03 13:57:10 +01:00
usbip usbip:vhci_hcd USB port can get stuck in the disabled state 2021-08-26 13:29:27 +02:00
Kconfig usb: remove reference to deleted config STB03xxx 2021-08-18 15:32:19 +02:00
Makefile usb: host: remove line for obsolete config USB_HWA_HCD 2021-08-18 15:32:19 +02:00
usb-skeleton.c usb: usb-skeleton: Update min() to min_t() 2021-10-05 12:56:48 +02:00