[PATCH 1/2] dt-bindings: touchscreen: Add Novatek NT519XX series bindings

Wei-Shih Lin posted 2 patches 2 years, 1 month ago
[PATCH 1/2] dt-bindings: touchscreen: Add Novatek NT519XX series bindings
Posted by Wei-Shih Lin 2 years, 1 month ago
This patch adds device tree bindings for Novatek NT519XX series
touchscreen devices.

Signed-off-by: Wei-Shih Lin <Weishih_Lin@novatek.com.tw>
---
 .../input/touchscreen/novatek,nt519xx.yaml    | 60 +++++++++++++++++++
 MAINTAINERS                                   |  9 +++
 2 files changed, 69 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/novatek,nt519xx.yaml

diff --git a/Documentation/devicetree/bindings/input/touchscreen/novatek,nt519xx.yaml b/Documentation/devicetree/bindings/input/touchscreen/novatek,nt519xx.yaml
new file mode 100644
index 000000000000..00912e265197
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/novatek,nt519xx.yaml
@@ -0,0 +1,60 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/touchscreen/novatek,nt519xx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Novatek nt519xx touchscreen controller bindings
+
+maintainers:
+  - Wei-Shih Lin <Weishih_Lin@novatek.com.tw>
+  - Leo LS Chang <Leo_LS_Chang@novatek.com.tw>
+
+allOf:
+  - $ref: touchscreen.yaml#
+
+properties:
+  compatible:
+    enum:
+      - novatek,NVT-ts
+
+  reg:
+    maxItems: 1
+
+  novatek,irq-gpio:
+    maxItems: 1
+
+  novatek,reset-gpio:
+    maxItems: 1
+
+  touchscreen-size-x: true
+  touchscreen-size-y: true
+
+required:
+  - compatible
+  - reg
+  - novatek,irq-gpio
+  - novatek,reset-gpio
+  - touchscreen-size-x
+  - touchscreen-size-y
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/gpio/gpio.h>
+    i2c {
+      novatek@62 {
+        compatible = "novatek,NVT-ts";
+        reg = <0x62>;
+
+        novatek,irq-gpio = <&gpio5 GPIO_C3 IRQ_TYPE_EDGE_RISING>;
+        novatek,reset-gpio = <&gpio7 GPIO_B1 GPIO_ACTIVE_LOW>;
+
+        touchscreen-size-x = <1920>;
+        touchscreen-size-y = <1080>;
+      };
+    };
+
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index 4cc6bf79fdd8..25c88bf7333e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -15009,6 +15009,15 @@ L:	linux-input@vger.kernel.org
 S:	Maintained
 F:	drivers/input/touchscreen/novatek-nvt-ts.c
 
+NOVATEK NT519XX I2C TOUCHSCREEN DRIVER
+M:	Wei-Shih Lin <Weishih_Lin@novatek.com.tw>
+L:	linux-input@vger.kernel.org
+S:	Maintained
+F:	Documentation/devicetree/bindings/input/touchscreen/novatek,nt519xx.yaml
+F:	drivers/input/touchscreen/nt519xx.c
+F:	drivers/input/touchscreen/nt519xx.h
+F:	drivers/input/touchscreen/nt519xx_mem_map.h
+
 NSDEPS
 M:	Matthias Maennich <maennich@google.com>
 S:	Maintained
-- 
2.26.1
Re: [PATCH 1/2] dt-bindings: touchscreen: Add Novatek NT519XX series bindings
Posted by Krzysztof Kozlowski 2 years, 1 month ago
On 25/10/2023 10:20, Wei-Shih Lin wrote:
> This patch adds device tree bindings for Novatek NT519XX series
> touchscreen devices.
> 
> Signed-off-by: Wei-Shih Lin <Weishih_Lin@novatek.com.tw>
> ---
>  .../input/touchscreen/novatek,nt519xx.yaml    | 60 +++++++++++++++++++
>  MAINTAINERS                                   |  9 +++
>  2 files changed, 69 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/input/touchscreen/novatek,nt519xx.yaml
> 
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/novatek,nt519xx.yaml b/Documentation/devicetree/bindings/input/touchscreen/novatek,nt519xx.yaml
> new file mode 100644
> index 000000000000..00912e265197
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/touchscreen/novatek,nt519xx.yaml
> @@ -0,0 +1,60 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/input/touchscreen/novatek,nt519xx.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Novatek nt519xx touchscreen controller bindings

Except that it was never tested...

> +
> +maintainers:
> +  - Wei-Shih Lin <Weishih_Lin@novatek.com.tw>
> +  - Leo LS Chang <Leo_LS_Chang@novatek.com.tw>
> +
> +allOf:
> +  - $ref: touchscreen.yaml#
> +
> +properties:
> +  compatible:
> +    enum:
> +      - novatek,NVT-ts

That's not a real compatible. Nope. Open existing code to find examples.

> +
> +  reg:
> +    maxItems: 1
> +
> +  novatek,irq-gpio:

No drop. Use interrupts

> +    maxItems: 1
> +
> +  novatek,reset-gpio:
> +    maxItems: 1

Really, please start from scratch from existing, recent bindings. This
must be generic reset-gpios.

> +
> +  touchscreen-size-x: true
> +  touchscreen-size-y: true
> +
> +required:
> +  - compatible
> +  - reg
> +  - novatek,irq-gpio
> +  - novatek,reset-gpio
> +  - touchscreen-size-x
> +  - touchscreen-size-y
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    #include <dt-bindings/gpio/gpio.h>
> +    i2c {
> +      novatek@62 {

Node names should be generic. See also an explanation and list of
examples (not exhaustive) in DT specification:
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation




Best regards,
Krzysztof
Re: [PATCH 1/2] dt-bindings: touchscreen: Add Novatek NT519XX series bindings
Posted by Rob Herring 2 years, 1 month ago
On Wed, 25 Oct 2023 16:20:53 +0800, Wei-Shih Lin wrote:
> This patch adds device tree bindings for Novatek NT519XX series
> touchscreen devices.
> 
> Signed-off-by: Wei-Shih Lin <Weishih_Lin@novatek.com.tw>
> ---
>  .../input/touchscreen/novatek,nt519xx.yaml    | 60 +++++++++++++++++++
>  MAINTAINERS                                   |  9 +++
>  2 files changed, 69 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/input/touchscreen/novatek,nt519xx.yaml
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/input/touchscreen/novatek,nt519xx.yaml: title: 'Novatek nt519xx touchscreen controller bindings' should not be valid under {'pattern': '([Bb]inding| [Ss]chema)'}
	hint: Everything is a binding/schema, no need to say it. Describe what hardware the binding is for.
	from schema $id: http://devicetree.org/meta-schemas/base.yaml#
Error: Documentation/devicetree/bindings/input/touchscreen/novatek,nt519xx.example.dts:25.40-41 syntax error
FATAL ERROR: Unable to parse input tree
make[2]: *** [scripts/Makefile.lib:419: Documentation/devicetree/bindings/input/touchscreen/novatek,nt519xx.example.dtb] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/builds/robherring/dt-review-ci/linux/Makefile:1427: dt_binding_check] Error 2
make: *** [Makefile:234: __sub-make] Error 2

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20231025082054.1190-2-Weishih_Lin@novatek.com.tw

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.