nuttx/drivers
Alan Carvalho de Assis 8342c51d59 ioexpander/ch422g: add a driver for the WCH CH422G I/O
The CH422G offers eight bi-directional pins, IO0-IO7, and four open-drain
outputs, OC0-OC3.  It appears on boards that have run out of usable GPIOs
once a parallel RGB panel has taken its share, the Waveshare
ESP32-S3-Touch-LCD-7 among them, where it holds the panel and touch
controller in and out of reset and switches the backlight.

Two things about the device do not fit the shape a register-per-address
I2C driver usually takes, and both are handled here rather than pushed on
to board logic:

  - A register is selected by the I2C address the transfer is addressed
    to, not by a register address written ahead of the data.  Each access
    carries a single byte to one of four addresses.
  - None of the write-only registers can be read back, so the driver
    keeps a shadow copy of each and updates it in step with the device.

IO0-IO7 have no individual direction control; one bit of the system
parameter register drives the whole group.  The driver records the
direction asked of each pin and puts the group in output mode once at
least one of them is an output, which is what a board that drives some of
the pins would expect.  Reading a pin of a group held in output mode
reports the value last written, because the hardware cannot report the
level, and that is documented rather than hidden.

The four open-drain outputs are presented as pins 8-11 of the same
ioexpander_dev_s so that one instance covers the chip, which means
CONFIG_IOEXPANDER_NPINS must be at least 12.

Builds clean with no new warnings on esp32s3-touch-lcd7:usbnsh and passes
nxstyle.

Signed-off-by: Alan Carvalho de Assis <acassis@gmail.com>
Assisted-by: Claude Code
2026-08-24 09:39:58 +02:00
..
1wire drivers/efuse/efuse: Drivers Registered With World Write Permissions(Part 1) 2026-07-13 12:08:01 +02:00
aie drivers/efuse/efuse: Drivers Registered With World Write Permissions(Part 1) 2026-07-13 12:08:01 +02:00
analog drivers/analog: add MCP445X potentiometer support 2026-08-08 18:37:08 +08:00
audio drivers/efuse/efuse: Drivers Registered With World Write Permissions(Part 1) 2026-07-13 12:08:01 +02:00
bch drivers/efuse/efuse: Drivers Registered With World Write Permissions(Part 1) 2026-07-13 12:08:01 +02:00
can drivers/efuse/efuse: Drivers Registered With World Write Permissions(Part 1) 2026-07-13 12:08:01 +02:00
clk !include/fcntl.h: align open flags with Linux values 2026-06-30 13:43:44 +08:00
contactless drivers/contactless: fix uninitialized uid leak in mfrc522_read 2026-07-13 19:50:57 +08:00
coresight drivers/: Multiple Drivers Are Registered With World Writable - Part 2 2026-07-15 15:27:28 +08:00
crypto drivers/efuse/efuse: Drivers Registered With World Write Permissions(Part 1) 2026-07-13 12:08:01 +02:00
devfreq drivers/devfreq: add ondemand governor build support 2026-08-08 15:23:54 -03:00
devicetree include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
dma drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
dummy drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
eeprom drivers/eeprom: add 24CW160 support 2026-08-06 12:39:36 +02:00
efuse drivers/efuse/efuse: Drivers Registered With World Write Permissions(Part 1) 2026-07-13 12:08:01 +02:00
i2c drivers/efuse/efuse: Drivers Registered With World Write Permissions(Part 1) 2026-07-13 12:08:01 +02:00
i2s drivers/efuse/efuse: Drivers Registered With World Write Permissions(Part 1) 2026-07-13 12:08:01 +02:00
i3c nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-08-24 13:20:45 +08:00
input drivers/input: support ST7123 touchscreen controller 2026-08-06 12:42:15 +02:00
ioexpander ioexpander/ch422g: add a driver for the WCH CH422G I/O 2026-08-24 09:39:58 +02:00
ipcc drivers/: Multiple Drivers Are Registered With World Writable - Part 2 2026-07-15 15:27:28 +08:00
lcd drivers/lcd: honour the LCD_APA102_* settings in the apa102 LCD driver 2026-08-13 09:54:26 -03:00
leds drivers/: Multiple Drivers Are Registered With World Writable - Part 2 2026-07-15 15:27:28 +08:00
loop drivers/: Multiple Drivers Are Registered With World Writable - Part 2 2026-07-15 15:27:28 +08:00
math drivers/: Multiple Drivers Are Registered With World Writable - Part 2 2026-07-15 15:27:28 +08:00
misc libs/libc: Fix divide-by-zero in stat() with large filesystem block sizes 2026-07-16 23:37:22 +08:00
mmcsd drivers/mmcsd: Switch SD cards into high speed. 2026-08-18 09:38:45 +08:00
modem drivers/: Multiple Drivers Are Registered With World Writable - Part 2 2026-07-15 15:27:28 +08:00
motor drivers/: Multiple Drivers Are Registered With World Writable - Part 2 2026-07-15 15:27:28 +08:00
mtd drivers/mtd: add MX25UW25645G support 2026-08-19 19:16:00 +02:00
net nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-08-24 13:20:45 +08:00
note nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-08-24 13:20:45 +08:00
pci drivers/: Multiple Drivers Are Registered With World Writable - Part 2 2026-07-15 15:27:28 +08:00
pinctrl drivers/pinctrl: Add pad read-back and a procfs entry. 2026-08-21 20:04:59 +08:00
pipes drivers/: Multiple Drivers Are Registered With World Writable Part 3 2026-07-16 09:49:07 -03:00
power drivers/power: Describe the regulators through procfs. 2026-08-18 17:28:02 +08:00
rc drivers/: Multiple Drivers Are Registered With World Writable - Part 2 2026-07-15 15:27:28 +08:00
regmap include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
reset nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-08-24 13:20:45 +08:00
rf drivers/: Multiple Drivers Are Registered With World Writable - Part 2 2026-07-15 15:27:28 +08:00
rpmsg nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-08-24 13:20:45 +08:00
rptun drivers/: Multiple Drivers Are Registered With World Writable - Part 2 2026-07-15 15:27:28 +08:00
segger cmake: Use NUTTX(_DIR/_BIN_DIR) instead CMAKE(_SRC_DIR/_BIN_DIR) 2026-08-09 11:13:08 -03:00
sensors sensors/tmp112: Add a uORB interface. 2026-08-18 10:35:28 -03:00
serial nuttx: use unified interface in <nuttx/atomic.h> 2026-08-24 13:20:45 +08:00
spi drivers/spi/ice40: fix operator precedence in final clock cycle count 2026-07-20 17:05:01 +08:00
syslog syslog/ramlog: Survive writes made before the OS is ready. 2026-08-08 15:20:54 -03:00
thermal drivers/thermal: Cool a devfreq device instead of a cpufreq policy. 2026-08-18 09:46:47 -03:00
timers drivers/timers: Add a PCF8563 RTC driver. 2026-08-18 09:29:16 -03:00
usbdev drivers/usbdev/cdcacm: serialize the TX ring drain with the class spinlock 2026-08-09 02:04:26 +08:00
usbhost drivers/usbhost: Separate the xHCI driver from the PCI bus. 2026-08-18 09:35:23 -03:00
usbmisc drivers/: Multiple Drivers Are Registered With World Writable - Part 2 2026-07-15 15:27:28 +08:00
usbmonitor include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
usrsock drivers/: Multiple Drivers Are Registered With World Writable - Part 2 2026-07-15 15:27:28 +08:00
vhost include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
video drivers/video: zero message on MIPI DSI driver 2026-07-24 20:57:57 -03:00
virtio drivers/input: partial fix of indistinguishable ASCII and special keycodes 2026-07-29 22:51:15 -03:00
wireless nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-08-24 13:20:45 +08:00
.gitignore
CMakeLists.txt drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
drivers_initialize.c driver/devfreq: add procfs for devfreq 2026-08-08 15:23:54 -03:00
Kconfig driver/devfreq: DVFS framework for devices 2026-08-08 15:23:54 -03:00
Makefile driver/devfreq: DVFS framework for devices 2026-08-08 15:23:54 -03:00