diff mbox series

[RFC/RFT,1/3] dt-bindings: touchscreen: Add binding for Novatek NT36xxx series driver

Message ID 20241015-nt36xxx-v1-1-3919d0bffee6@gmail.com (mailing list archive)
State New
Headers show
Series Add support to Novatek's touch IC nt36xxx | expand

Commit Message

George Chan via B4 Relay Oct. 15, 2024, 12:53 p.m. UTC
From: George Chan <gchan9527@gmail.com>

Add binding for the Novatek NT36xxx series touchscreen driver.

Signed-off-by: AngeloGioacchino Del Regno <kholk11@gmail.com>
Signed-off-by: George Chan <gchan9527@gmail.com>
---
 .../bindings/input/touchscreen/nt36xxx.yaml        | 70 ++++++++++++++++++++++
 1 file changed, 70 insertions(+)

Comments

Krzysztof Kozlowski Oct. 15, 2024, 1:39 p.m. UTC | #1
On 15/10/2024 14:53, George Chan via B4 Relay wrote:
> From: George Chan <gchan9527@gmail.com>
> 
> Add binding for the Novatek NT36xxx series touchscreen driver.

Several issues here.
1. A nit, subject: drop second/last, redundant "bindings". The
"dt-bindings" prefix is already stating that these are bindings.
See also:
https://elixir.bootlin.com/linux/v6.7-rc8/source/Documentation/devicetree/bindings/submitting-patches.rst#L18

2. Commit msg: Bindings are about hardware, not driver.

> 
> Signed-off-by: AngeloGioacchino Del Regno <kholk11@gmail.com>

That's odd sequence.

> Signed-off-by: George Chan <gchan9527@gmail.com>
> ---
>  .../bindings/input/touchscreen/nt36xxx.yaml        | 70 ++++++++++++++++++++++
>  1 file changed, 70 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/nt36xxx.yaml b/Documentation/devicetree/bindings/input/touchscreen/nt36xxx.yaml
> new file mode 100644
> index 0000000000..3919f0d026
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/touchscreen/nt36xxx.yaml

Use compatible as filename.

> @@ -0,0 +1,70 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/input/touchscreen/nt36xxx.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Novatek NT36xxx series touchscreen controller Bindings

Not tested.


> +
> +maintainers:
> +  - AngeloGioacchino Del Regno <kholk11@gmail.com>
> +  - George Chan <gchan9527@gmail.com>
> +
> +allOf:
> +  - $ref: touchscreen.yaml#
> +
> +properties:
> +  compatible:
> +    enum:
> +        - novatek,nt36525-spi
> +        - novatek,nt36672a-spi
> +        - novatek,nt36675-spi
> +        - novatek,nt36676f-spi
> +        - novatek,nt36772-spi

This just does not work and was not tested... Limited review follows:

Drop spi and explain why this cannot be part of existing nt36672a.

I finished review here.

Best regards,
Krzysztof
Rob Herring (Arm) Oct. 15, 2024, 2:27 p.m. UTC | #2
On Tue, 15 Oct 2024 20:53:29 +0800, George Chan wrote:
> Add binding for the Novatek NT36xxx series touchscreen driver.
> 
> Signed-off-by: AngeloGioacchino Del Regno <kholk11@gmail.com>
> Signed-off-by: George Chan <gchan9527@gmail.com>
> ---
>  .../bindings/input/touchscreen/nt36xxx.yaml        | 70 ++++++++++++++++++++++
>  1 file changed, 70 insertions(+)
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:
./Documentation/devicetree/bindings/input/touchscreen/nt36xxx.yaml:19:9: [warning] wrong indentation: expected 6 but found 8 (indentation)

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/input/touchscreen/nt36xxx.yaml: title: 'Novatek NT36xxx series 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#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20241015-nt36xxx-v1-1-3919d0bffee6@gmail.com

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.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/input/touchscreen/nt36xxx.yaml b/Documentation/devicetree/bindings/input/touchscreen/nt36xxx.yaml
new file mode 100644
index 0000000000..3919f0d026
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/nt36xxx.yaml
@@ -0,0 +1,70 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/touchscreen/nt36xxx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Novatek NT36xxx series touchscreen controller Bindings
+
+maintainers:
+  - AngeloGioacchino Del Regno <kholk11@gmail.com>
+  - George Chan <gchan9527@gmail.com>
+
+allOf:
+  - $ref: touchscreen.yaml#
+
+properties:
+  compatible:
+    enum:
+        - novatek,nt36525-spi
+        - novatek,nt36672a-spi
+        - novatek,nt36675-spi
+        - novatek,nt36676f-spi
+        - novatek,nt36772-spi
+
+  reg:
+    maxItems: 1
+
+  irq-gpio:
+    maxItems: 1
+
+  vdd-supply:
+    description: Power supply regulator for VDD pin
+
+  vio-supply:
+    description: Power supply regulator on VDD-IO pin
+
+  firmware-name:
+    description: Firmware for device initialization, if unspecify, all
+                  other IC treat as no firmware needed. For nt36675, default
+                  to "novatek_ts_tianma_fw.bin".
+
+  spi-max-frequency:
+    description: Set max frequency to spi bus communication. This is optional.
+
+unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+  - irq-gpio
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/gpio/gpio.h>
+
+    spi {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      touchscreen@0 {
+        compatible = "novatek,nt36675-spi";
+        reg = <0>;
+        spi-max-frequency = <4000000>;
+        irq-gpio = <&tlmm 9 0x2001>;
+        firmware-name = "novatek_ts_tianma_fw.bin";
+      };
+    };
+
+...