diff mbox series

[v5,4/8] dt-bindings: touchscreen: validate nodename

Message ID 20210521044525.7397-5-o.rempel@pengutronix.de (mailing list archive)
State Superseded
Headers show
Series add z1 and z2 channels support for resistive-adc-touch driver | expand

Commit Message

Oleksij Rempel May 21, 2021, 4:45 a.m. UTC
Validate touchscreen nodes. Make sure it is named touchscreen*.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 .../devicetree/bindings/input/touchscreen/touchscreen.yaml     | 3 +++
 1 file changed, 3 insertions(+)

Comments

Jonathan Cameron May 21, 2021, 4:27 p.m. UTC | #1
On Fri, 21 May 2021 06:45:21 +0200
Oleksij Rempel <o.rempel@pengutronix.de> wrote:

> Validate touchscreen nodes. Make sure it is named touchscreen*.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>

Feels like this should be two separate patch sets...
The node name one, and then the stuff for the resistive touch screen. 

> ---
>  .../devicetree/bindings/input/touchscreen/touchscreen.yaml     | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml b/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml
> index 046ace461cc9..057e1063759c 100644
> --- a/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml
> +++ b/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml
> @@ -10,6 +10,9 @@ maintainers:
>    - Dmitry Torokhov <dmitry.torokhov@gmail.com>
>  
>  properties:
> +  $nodename:
> +    pattern: "^touchscreen(@.*)?$"
> +
>    touchscreen-min-x:
>      description: minimum x coordinate reported
>      $ref: /schemas/types.yaml#/definitions/uint32
Rob Herring (Arm) May 21, 2021, 5:18 p.m. UTC | #2
On Fri, 21 May 2021 06:45:21 +0200, Oleksij Rempel wrote:
> Validate touchscreen nodes. Make sure it is named touchscreen*.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>  .../devicetree/bindings/input/touchscreen/touchscreen.yaml     | 3 +++
>  1 file changed, 3 insertions(+)
> 

Acked-by: Rob Herring <robh@kernel.org>
Dmitry Torokhov May 25, 2021, 3:46 a.m. UTC | #3
On Fri, May 21, 2021 at 12:18:23PM -0500, Rob Herring wrote:
> On Fri, 21 May 2021 06:45:21 +0200, Oleksij Rempel wrote:
> > Validate touchscreen nodes. Make sure it is named touchscreen*.
> > 
> > Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> > ---
> >  .../devicetree/bindings/input/touchscreen/touchscreen.yaml     | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> 
> Acked-by: Rob Herring <robh@kernel.org>

These bindings are used for devices other than touchscreens (touchpads
and other touch controllers that are not touchscreens), so forcing them
to be named "touchscreen*" is wrong. In fact, I'd like to allow using
"touch-*" property names as aliases for "touchscreen-*" properties.

Thanks.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml b/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml
index 046ace461cc9..057e1063759c 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml
+++ b/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml
@@ -10,6 +10,9 @@  maintainers:
   - Dmitry Torokhov <dmitry.torokhov@gmail.com>
 
 properties:
+  $nodename:
+    pattern: "^touchscreen(@.*)?$"
+
   touchscreen-min-x:
     description: minimum x coordinate reported
     $ref: /schemas/types.yaml#/definitions/uint32