mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] Add Nsiway NS2009 touchscreen support
@ 2026-10-09 14:47 Miotsuki Mizuno
  2026-10-09 14:47 ` [PATCH 1/3] dt-bindings: vendor-prefixes: add Nsiway Miotsuki Mizuno
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Miotsuki Mizuno @ 2026-10-09 14:47 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Icenowy Zheng,
	linux-input, devicetree, linux-kernel

Add polling support for the Nsiway NS2009 I2C resistive touchscreen
controller, together with its vendor prefix and DT binding. Coordinates
are 12-bit ADC readings; raw Z1 is used only to detect contact. The driver
uses a 30 ms polling interval and the common touchscreen transforms.

The implementation derives from Icenowy Zheng's 2017 polling driver [1].
It uses the current input polling API and managed input allocation, with
no private copy of the input core's touch-key state. Failed, short or
malformed I2C reads release the current contact and discard coordinates;
a later valid sample can report a new contact. A transient read error can
therefore cause a pen-up rather than retain an indefinitely active contact.

The driver checks the zero padding in the second byte of a 12-bit response,
as specified by the read-command format. Responses with nonzero padding
are rejected before the decoded value is assigned.

The historical Z1 threshold of 80 remains the default. Boards can override
it with touchscreen-min-pressure; the tested UNIHIKER M10 V1.2 uses 150.
IRQ, wakeup and calibrated pressure reporting are outside this series.
Board DTS changes are also separate.

Validation:
- Latest mainline base: ARM64 driver-object build with W=1, and in-tree
  dt_binding_check for the unchanged NS2009 binding.
- UNIHIKER M10 V1.2, Linux 6.18: clicks, long presses, directed drags,
  axis orientation, release, and three held-contact inhibit/uninhibit
  cycles. A validation module changed only the driver registration name
  to replace the existing built-in driver; the read/poll/probe code is
  the same as this series. The boot Image and DTB were retained.
- Two malformed Z1 responses were rejected during the physical run;
  subsequent contacts were reported normally without stuck key state.
- Controlled read/poll/probe tests with ASan/UBSan cover all 4096 valid
  ADC values, every nonzero padding nibble on Z1/X/Y, threshold bounds,
  malformed properties, core key resets, short/failed reads and recovery.

Physical NACK/short-read fault injection and system suspend/resume were
not tested. This is a new three-patch series, not a continuation of the
board-specific BSP changes.

[1] https://lore.kernel.org/all/20170315155140.54518-4-icenowy@aosc.xyz/

Mizuno Miotsuki (3):
  dt-bindings: vendor-prefixes: add Nsiway
  dt-bindings: input: touchscreen: add Nsiway NS2009
  Input: add Nsiway NS2009 resistive touchscreen driver

 .../input/touchscreen/nsiway,ns2009.yaml      |  64 +++++++
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 MAINTAINERS                                   |   7 +
 drivers/input/touchscreen/Kconfig             |  10 +
 drivers/input/touchscreen/Makefile            |   1 +
 drivers/input/touchscreen/ns2009.c            | 175 ++++++++++++++++++
 6 files changed, 259 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/nsiway,ns2009.yaml
 create mode 100644 drivers/input/touchscreen/ns2009.c


base-commit: af32da41b0327b9c6a37856ba82b6760d6c8d10e

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-09 14:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-09 14:47 [PATCH 0/3] Add Nsiway NS2009 touchscreen support Miotsuki Mizuno
2026-10-09 14:47 ` [PATCH 1/3] dt-bindings: vendor-prefixes: add Nsiway Miotsuki Mizuno
2026-10-09 14:47 ` [PATCH 2/3] dt-bindings: input: touchscreen: add Nsiway NS2009 Miotsuki Mizuno
2026-10-09 14:47 ` [PATCH 3/3] Input: add Nsiway NS2009 resistive touchscreen driver Miotsuki Mizuno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®