]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
USB: serial: cp210x: add support for GPIOs on CP2108
authorPho Tran <pho.tran@silabs.com>
Thu, 10 Jun 2021 13:28:44 +0000 (15:28 +0200)
committerJohan Hovold <johan@kernel.org>
Wed, 16 Jun 2021 15:40:01 +0000 (17:40 +0200)
commit8051334e901f2f7ab9fa30a15b74cdc8e58dfde2
tree5161e885ec057792b2d41dc47a7d027589f00dd4
parent17cd3a106e9762cd97883cce884a8bfcf5a476ad
USB: serial: cp210x: add support for GPIOs on CP2108

Similar to some other CP210x device types, CP2108 has a number of GPIO
pins that can be exposed through gpiolib.

CP2108 has four serial interfaces but only one set of GPIO pins, which
is modelled as a single gpio chip and registered as a child of the first
interface.

CP2108 has 16 GPIOs so the width of the state variables needs to be
extended to 16 bits and this is also reflected in the control requests.

Like CP2104, CP2108 have GPIO pins with configurable alternate
functions and pins unavailable for GPIO use are determined and reported
to gpiolib at probe.

Signed-off-by: Pho Tran <pho.tran@silabs.com>
Co-developed-by: Tung Pham <tung.pham@silabs.com>
Signed-off-by: Tung Pham <tung.pham@silabs.com>
[ johan: rewrite gpio get() and set(); misc cleanups; amend commit
         message ]
Link: https://lore.kernel.org/r/20210610132844.25495-1-johan@kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/cp210x.c