nuttx/drivers/input
Jorge Guzman e884b6c3c8 input/gt9xx: fix register write and no-contact read
Two defects keep the driver from reporting touches on a board that
cannot use the interrupt line.

The register write built two messages joined by I2C_M_NOSTART.  That
puts the same bytes on the wire as a single three byte message, but
resuming a transfer without a start condition is optional, and a
controller that does not implement it fails the transfer.  On the
ESP32-P4 every write returned -ETIMEDOUT, so the buffer status clear
at 0x814E never reached the controller and gt9xx_read_touch_data()
returned an error for every read.  Send the register address and the
value as a single message.

read() returned a full struct touch_sample_s even when the controller
reported no contact, with npoints set to zero.  A caller that judges
the read by its return value takes that for valid data: the LVGL
touchscreen driver reads a second sample to decide whether to keep
reading, always gets one, so it sets continue_reading on every pass
and lv_indev_read() never returns.  The display then stops refreshing
after the first frame while the touch reads spin.  Return -EAGAIN when
there is no contact and the file was opened with O_NONBLOCK, which is
what the touchscreen upper half does in the same situation.  A
blocking reader keeps the previous behaviour.

While here, add the blank line after the declaration in gt9xx_poll() that
nxstyle asks for.  It predates this change, but the CI runs checkpatch over
every file a commit touches, so it has to go.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-08-31 16:16:21 +08:00
..
ads7843e.c
ads7843e.h
ajoystick.c
aw86225.c
aw86225_internal.h
aw86225_reg.h
button_lower.c
button_upper.c
CMakeLists.txt
cypress_mbr3108.c
djoystick.c
ff_dummy.c
ff_upper.c
ft5x06.c
ft5x06.h
goldfish_events.c
gt9xx.c
Kconfig
keyboard_upper.c
kmatrix.c
kmatrix_i2c.c
Make.defs
max11802.c
max11802.h
mouse_upper.c
mpr121.c
mpr121.h
mxt.c
mxt.h
nunchuck.c
sbutton.c
spq10kbd.c
st7123.c
stmpe811.h
stmpe811_adc.c
stmpe811_base.c
stmpe811_gpio.c
stmpe811_temp.c
stmpe811_tsc.c
touchscreen_upper.c
tsc2007.c
tsc2007.h
uinput.c
virtio_key_decode.c