diff mbox series

[2/6] dt-bindings: HID: i2c-hid: elan: add Elan eKTH5015M

Message ID 20240423134611.31979-3-johan+linaro@kernel.org
State Not Applicable
Headers show
Series HID/arm64: dts: qcom: sc8280xp-x13s: fix touchscreen power on | expand

Checks

Context Check Description
robh/checkpatch warning total: 0 errors, 1 warnings, 25 lines checked
robh/patch-applied success
robh/dtbs-check warning build log
robh/dt-meta-schema success

Commit Message

Johan Hovold April 23, 2024, 1:46 p.m. UTC
Add a compatible string for the Elan eKTH5015M touch controller.

Judging from the current binding and commit bd3cba00dcc6 ("HID: i2c-hid:
elan: Add support for Elan eKTH6915 i2c-hid touchscreens"), eKTH5015M
appears to be compatible with eKTH6915. Notably the power-on sequence is
the same.

While at it, drop a redundant label from the example.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
 .../devicetree/bindings/input/elan,ekth6915.yaml    | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

Comments

Krzysztof Kozlowski April 23, 2024, 4:24 p.m. UTC | #1
On 23/04/2024 15:46, Johan Hovold wrote:
> Add a compatible string for the Elan eKTH5015M touch controller.
> 
> Judging from the current binding and commit bd3cba00dcc6 ("HID: i2c-hid:
> elan: Add support for Elan eKTH6915 i2c-hid touchscreens"), eKTH5015M
> appears to be compatible with eKTH6915. Notably the power-on sequence is
> the same.
> 
> While at it, drop a redundant label from the example.
> 
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
> ---
>  .../devicetree/bindings/input/elan,ekth6915.yaml    | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/input/elan,ekth6915.yaml b/Documentation/devicetree/bindings/input/elan,ekth6915.yaml
> index 3e2d216c6432..c3a6f901ff45 100644
> --- a/Documentation/devicetree/bindings/input/elan,ekth6915.yaml
> +++ b/Documentation/devicetree/bindings/input/elan,ekth6915.yaml
> @@ -18,8 +18,13 @@ allOf:
>  
>  properties:
>    compatible:
> -    items:
> -      - const: elan,ekth6915
> +    oneOf:
> +      - items:
> +          - enum:
> +              - elan,ekth5015m
> +          - const: elan,ekth6915
> +      - items:

Don't re-add the items for this entry. Just const.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
Johan Hovold April 24, 2024, 7:03 a.m. UTC | #2
On Tue, Apr 23, 2024 at 06:24:39PM +0200, Krzysztof Kozlowski wrote:
> On 23/04/2024 15:46, Johan Hovold wrote:
 
> >  properties:
> >    compatible:
> > -    items:
> > -      - const: elan,ekth6915
> > +    oneOf:
> > +      - items:
> > +          - enum:
> > +              - elan,ekth5015m
> > +          - const: elan,ekth6915
> > +      - items:
> 
> Don't re-add the items for this entry. Just const.

Sure. But note that the example schema uses 'items' like this (e.g. for
'compatible' and 'clock-names'):

	https://docs.kernel.org/devicetree/bindings/writing-schema.html#annotated-example-schema

Johan
Krzysztof Kozlowski April 24, 2024, 8:32 a.m. UTC | #3
On 24/04/2024 09:03, Johan Hovold wrote:
> On Tue, Apr 23, 2024 at 06:24:39PM +0200, Krzysztof Kozlowski wrote:
>> On 23/04/2024 15:46, Johan Hovold wrote:
>  
>>>  properties:
>>>    compatible:
>>> -    items:
>>> -      - const: elan,ekth6915
>>> +    oneOf:
>>> +      - items:
>>> +          - enum:
>>> +              - elan,ekth5015m
>>> +          - const: elan,ekth6915
>>> +      - items:
>>
>> Don't re-add the items for this entry. Just const.
> 
> Sure. But note that the example schema uses 'items' like this (e.g. for
> 'compatible' and 'clock-names'):
> 
> 	https://docs.kernel.org/devicetree/bindings/writing-schema.html#annotated-example-schema
> 

Yes, that's the inconsistency we keep. The point is that clocks usually
have just one list, so one "items:". For compatible there can be many
and it leads to less readable code, e.g.:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml?h=v6.9-rc5#n15


Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/input/elan,ekth6915.yaml b/Documentation/devicetree/bindings/input/elan,ekth6915.yaml
index 3e2d216c6432..c3a6f901ff45 100644
--- a/Documentation/devicetree/bindings/input/elan,ekth6915.yaml
+++ b/Documentation/devicetree/bindings/input/elan,ekth6915.yaml
@@ -18,8 +18,13 @@  allOf:
 
 properties:
   compatible:
-    items:
-      - const: elan,ekth6915
+    oneOf:
+      - items:
+          - enum:
+              - elan,ekth5015m
+          - const: elan,ekth6915
+      - items:
+          - const: elan,ekth6915
 
   reg:
     const: 0x10
@@ -57,8 +62,8 @@  examples:
       #address-cells = <1>;
       #size-cells = <0>;
 
-      ap_ts: touchscreen@10 {
-        compatible = "elan,ekth6915";
+      touchscreen@10 {
+        compatible = "elan,ekth5015m", "elan,ekth6915";
         reg = <0x10>;
 
         interrupt-parent = <&tlmm>;