diff mbox series

[2/3] dt-bindings: input: touchscreen: Add Hynitron cstxxx bindings

Message ID 20220928214806.13572-3-macroalpha82@gmail.com
State Superseded
Headers show
Series Add Hynitron cstxxx Touchscreen | expand

Commit Message

Chris Morgan Sept. 28, 2022, 9:48 p.m. UTC
From: Chris Morgan <macromorgan@hotmail.com>

Add documentation for the Hynitron cstxxx touchscreen bindings.
Hynitron makes a series of touchscreen controllers, however for
now this is expected to only be compatible with the cst3xx series.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
---
 .../input/touchscreen/hynitron,cstxxx.yaml    | 65 +++++++++++++++++++
 1 file changed, 65 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/hynitron,cstxxx.yaml

Comments

Krzysztof Kozlowski Sept. 30, 2022, 10:54 a.m. UTC | #1
On 28/09/2022 23:48, Chris Morgan wrote:
> From: Chris Morgan <macromorgan@hotmail.com>
> 
> Add documentation for the Hynitron cstxxx touchscreen bindings.
> Hynitron makes a series of touchscreen controllers, however for
> now this is expected to only be compatible with the cst3xx series.

Drop redundant (second) bindings from subject.

> 
> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> ---
>  .../input/touchscreen/hynitron,cstxxx.yaml    | 65 +++++++++++++++++++
>  1 file changed, 65 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/input/touchscreen/hynitron,cstxxx.yaml
> 
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/hynitron,cstxxx.yaml b/Documentation/devicetree/bindings/input/touchscreen/hynitron,cstxxx.yaml
> new file mode 100644
> index 000000000000..c98d14e9844a
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/touchscreen/hynitron,cstxxx.yaml
> @@ -0,0 +1,65 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/input/touchscreen/hynitron,cstxxx.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Hynitron cstxxx series touchscreen controller bindings

Drop "bindings"

> +
> +description: |
> +  Bindings for Hynitron cstxxx series multi-touch touchscreen
> +  controllers.
> +
> +maintainers:
> +  - Chris Morgan <macromorgan@hotmail.com>
> +
> +allOf:
> +  - $ref: touchscreen.yaml#
> +
> +properties:
> +  compatible:
> +    enum:
> +      - hynitron,cst3xx

Isn't the panel CST3240? No wildcards in compatibles.


> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  reset-gpios:
> +    maxItems: 1
> +

Best regards,
Krzysztof
Chris Morgan Sept. 30, 2022, 3:21 p.m. UTC | #2
On Fri, Sep 30, 2022 at 12:54:34PM +0200, Krzysztof Kozlowski wrote:
> On 28/09/2022 23:48, Chris Morgan wrote:
> > From: Chris Morgan <macromorgan@hotmail.com>
> > 
> > Add documentation for the Hynitron cstxxx touchscreen bindings.
> > Hynitron makes a series of touchscreen controllers, however for
> > now this is expected to only be compatible with the cst3xx series.
> 
> Drop redundant (second) bindings from subject.

Acknowledged.

> 
> > 
> > Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> > ---
> >  .../input/touchscreen/hynitron,cstxxx.yaml    | 65 +++++++++++++++++++
> >  1 file changed, 65 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/input/touchscreen/hynitron,cstxxx.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/input/touchscreen/hynitron,cstxxx.yaml b/Documentation/devicetree/bindings/input/touchscreen/hynitron,cstxxx.yaml
> > new file mode 100644
> > index 000000000000..c98d14e9844a
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/input/touchscreen/hynitron,cstxxx.yaml
> > @@ -0,0 +1,65 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevicetree.org%2Fschemas%2Finput%2Ftouchscreen%2Fhynitron%2Ccstxxx.yaml%23&amp;data=05%7C01%7C%7C15d98f57ab8a4668227508daa2d22a4f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638001320776366532%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=qn5TpFejnoa7B3eo6vM3FkKwoi8kAWo1IgxMlKWCkJM%3D&amp;reserved=0
> > +$schema: https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevicetree.org%2Fmeta-schemas%2Fcore.yaml%23&amp;data=05%7C01%7C%7C15d98f57ab8a4668227508daa2d22a4f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638001320776366532%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=zdV1diLy%2FujTHO6DB2%2BqMp47Eafi4Uz%2FK1kChij4CiQ%3D&amp;reserved=0
> > +
> > +title: Hynitron cstxxx series touchscreen controller bindings
> 
> Drop "bindings"
> 

Acknowledged.

> > +
> > +description: |
> > +  Bindings for Hynitron cstxxx series multi-touch touchscreen
> > +  controllers.
> > +
> > +maintainers:
> > +  - Chris Morgan <macromorgan@hotmail.com>
> > +
> > +allOf:
> > +  - $ref: touchscreen.yaml#
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - hynitron,cst3xx
> 
> Isn't the panel CST3240? No wildcards in compatibles.
> 

The controller IC I'm using is CST348. This driver SHOULD
also work with a CST340 and a CST356 (untested though).

Should I just have 3 compatible strings then, one for each IC?
I could also just have cst340 as the compatible and note it
should work for the 3 ICs listed.

> 
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +
> > +  reset-gpios:
> > +    maxItems: 1
> > +
> 
> Best regards,
> Krzysztof
> 

Once again, thank you for your input.
Krzysztof Kozlowski Sept. 30, 2022, 4:32 p.m. UTC | #3
On 30/09/2022 17:21, Chris Morgan wrote:
>>> +maintainers:
>>> +  - Chris Morgan <macromorgan@hotmail.com>
>>> +
>>> +allOf:
>>> +  - $ref: touchscreen.yaml#
>>> +
>>> +properties:
>>> +  compatible:
>>> +    enum:
>>> +      - hynitron,cst3xx
>>
>> Isn't the panel CST3240? No wildcards in compatibles.
>>
> 
> The controller IC I'm using is CST348. This driver SHOULD
> also work with a CST340 and a CST356 (untested though).
> 

Whether drivers works or not is rather orthogonal question. What if
FreeBSD driver does not work with CST356? What if U-boot driver works
with all three and few more?

> Should I just have 3 compatible strings then, one for each IC?
> I could also just have cst340 as the compatible and note it
> should work for the 3 ICs listed.

Choose either:
1. The only the one compatible for which you have datasheet or hardware.
2. Choose all three separate compatibles which you believe should have
same hardware properties thus one binding fits them (based on
experience, datasheet, other drivers).


Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/input/touchscreen/hynitron,cstxxx.yaml b/Documentation/devicetree/bindings/input/touchscreen/hynitron,cstxxx.yaml
new file mode 100644
index 000000000000..c98d14e9844a
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/hynitron,cstxxx.yaml
@@ -0,0 +1,65 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/touchscreen/hynitron,cstxxx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Hynitron cstxxx series touchscreen controller bindings
+
+description: |
+  Bindings for Hynitron cstxxx series multi-touch touchscreen
+  controllers.
+
+maintainers:
+  - Chris Morgan <macromorgan@hotmail.com>
+
+allOf:
+  - $ref: touchscreen.yaml#
+
+properties:
+  compatible:
+    enum:
+      - hynitron,cst3xx
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  reset-gpios:
+    maxItems: 1
+
+  touchscreen-size-x: true
+  touchscreen-size-y: true
+  touchscreen-inverted-x: true
+  touchscreen-inverted-y: true
+  touchscreen-swapped-x-y: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - reset-gpios
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      touchscreen@1a {
+        compatible = "hynitron,cst3xx";
+        reg = <0x1a>;
+        interrupt-parent = <&gpio4>;
+        interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
+        reset-gpios = <&gpio4 6 GPIO_ACTIVE_LOW>;
+        touchscreen-size-x = <640>;
+        touchscreen-size-y = <480>;
+      };
+    };
+
+...