mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Miotsuki Mizuno <founder@crepuse.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: "robh@kernel.org" <robh@kernel.org>,
	"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	"icenowy@aosc.io" <icenowy@aosc.io>,
	"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH v2 2/3] dt-bindings: input: touchscreen: add Nsiway NS2009
Date: Sun, 11 Oct 2026 05:42:29 +0000	[thread overview]
Message-ID: <20261011054223.93396-3-founder@crepuse.com> (raw)
In-Reply-To: <20261011054223.93396-1-founder@crepuse.com>

Describe the Nsiway NS2009 four-wire resistive touchscreen controller,
including its optional active-low pen interrupt, power and external
reference supplies, and touch resistance measurement capabilities.

Allow the common X-plate resistance and pressure properties. Include
both an interrupt/supply example and a minimal example for a board with
an unconnected pen interrupt.

Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Mizuno Miotsuki <founder@crepuse.com>
---
 .../input/touchscreen/nsiway,ns2009.yaml      | 104 ++++++++++++++++++
 MAINTAINERS                                   |   6 +
 2 files changed, 110 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/nsiway,ns2009.yaml

diff --git a/Documentation/devicetree/bindings/input/touchscreen/nsiway,ns2009.yaml b/Documentation/devicetree/bindings/input/touchscreen/nsiway,ns2009.yaml
new file mode 100644
index 000000000000..43523f40dcb8
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/nsiway,ns2009.yaml
@@ -0,0 +1,104 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/touchscreen/nsiway,ns2009.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Nsiway NS2009 resistive touchscreen controller
+
+maintainers:
+  - Mizuno Miotsuki <founder@crepuse.com>
+
+description: |
+  The NS2009 is a four-wire resistive touchscreen controller connected over
+  I2C, with a 12-bit ADC, an active-low pen interrupt output, and support
+  for an external ADC reference voltage. Touch resistance can be calculated
+  from the X coordinate, Z1 and Z2 measurements, and the X-plate resistance.
+  Coordinates are 12-bit ADC readings, not display pixel coordinates.
+
+allOf:
+  - $ref: touchscreen.yaml#
+
+properties:
+  compatible:
+    const: nsiway,ns2009
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+    description:
+      Active-low pen interrupt output. Optional when the signal is not
+      connected.
+
+  wakeup-source: true
+
+  vdd-supply:
+    description: Main power supply.
+
+  vref-supply:
+    description: External ADC reference voltage supply.
+
+  touchscreen-x-plate-ohms: true
+  touchscreen-max-pressure: true
+  touchscreen-fuzz-pressure: true
+
+  touchscreen-min-pressure:
+    minimum: 1
+    maximum: 4095
+    default: 80
+    description:
+      Minimum raw Z1 reading considered a touch. This is a contact detection
+      threshold, not a calibrated pressure value. Boards may require a higher
+      empirically determined threshold than the historical driver default.
+
+  touchscreen-min-x: true
+  touchscreen-min-y: true
+  touchscreen-size-x: true
+  touchscreen-size-y: true
+  touchscreen-fuzz-x: true
+  touchscreen-fuzz-y: true
+  touchscreen-inverted-x: true
+  touchscreen-inverted-y: true
+  touchscreen-swapped-x-y: true
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        touchscreen@48 {
+            compatible = "nsiway,ns2009";
+            reg = <0x48>;
+            touchscreen-min-pressure = <150>;
+            touchscreen-inverted-y;
+        };
+    };
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        touchscreen@48 {
+            compatible = "nsiway,ns2009";
+            reg = <0x48>;
+            interrupt-parent = <&gpio1>;
+            interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
+            wakeup-source;
+            vdd-supply = <&vdd>;
+            vref-supply = <&vref>;
+            touchscreen-x-plate-ohms = <400>;
+            touchscreen-max-pressure = <4095>;
+            touchscreen-fuzz-pressure = <16>;
+        };
+    };
diff --git a/MAINTAINERS b/MAINTAINERS
index f53047aa8d3c..696f2badc49c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -19467,6 +19467,12 @@ S:	Maintained
 F:	Documentation/core-api/symbol-namespaces.rst
 F:	scripts/nsdeps
 
+NSIWAY NS2009 TOUCHSCREEN CONTROLLER
+M:	Mizuno Miotsuki <founder@crepuse.com>
+L:	linux-input@vger.kernel.org
+S:	Maintained
+F:	Documentation/devicetree/bindings/input/touchscreen/nsiway,ns2009.yaml
+
 NTB AMD DRIVER
 M:	Basavaraj Natikar <Basavaraj.Natikar@amd.com>
 M:	Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
-- 
2.56.0


  parent reply	other threads:[~2026-10-11  5:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-11  5:13   ` Dmitry Torokhov
2026-10-09 14:47 ` [PATCH 3/3] Input: add Nsiway NS2009 resistive touchscreen driver Miotsuki Mizuno
2026-10-11  5:42 ` [PATCH v2 0/3] Add Nsiway NS2009 touchscreen support Miotsuki Mizuno
2026-10-11  5:42   ` [PATCH v2 1/3] dt-bindings: vendor-prefixes: add Nsiway Miotsuki Mizuno
2026-10-11  5:42   ` Miotsuki Mizuno [this message]
2026-10-11  5:42   ` [PATCH v2 3/3] Input: add Nsiway NS2009 resistive touchscreen driver Miotsuki Mizuno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261011054223.93396-3-founder@crepuse.com \
    --to=founder@crepuse.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=icenowy@aosc.io \
    --cc=krzk+dt@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®