mbox series

[v2,0/5] dt-bindings: input: Common property clean-ups and adc-keys conversion

Message ID 20220608211207.2058487-1-robh@kernel.org
Headers show
Series dt-bindings: input: Common property clean-ups and adc-keys conversion | expand

Message

Rob Herring June 8, 2022, 9:12 p.m. UTC
This series refactors the common 'linux,code', 'linux,keycodes', and
'linux,input-type' properties defined in various binding schemas. As the
properties are common, they should only have a single common schema type
definition. Note that 'linux,input-value' was not included here as it is
only used in 1 binding (gpio-keys).

The clean-ups are are result of the discussion on v1 of the adc-keys
binding conversion[1].

Rob

[1] https://lore.kernel.org/all/20220606184243.1057145-1-robh@kernel.org/


Rob Herring (5):
  dt-bindings: input: Increase maximum keycode value to 0x2ff
  dt-bindings: input: Centralize 'linux,code' definition
  dt-bindings: input: Use common 'linux,keycodes' definition
  dt-bindings: input: Centralize 'linux,input-type' definition
  dt-bindings: input: Convert adc-keys to DT schema

 .../bindings/input/adc-joystick.yaml          |   2 +-
 .../devicetree/bindings/input/adc-keys.txt    |  67 ------------
 .../devicetree/bindings/input/adc-keys.yaml   | 103 ++++++++++++++++++
 .../input/allwinner,sun4i-a10-lradc-keys.yaml |   5 +-
 .../bindings/input/azoteq,iqs7222.yaml        |   8 +-
 .../devicetree/bindings/input/gpio-keys.yaml  |   8 +-
 .../devicetree/bindings/input/input.yaml      |  24 +++-
 .../devicetree/bindings/input/iqs269a.yaml    |  15 +--
 .../devicetree/bindings/input/iqs626a.yaml    |  11 +-
 .../bindings/input/iqs62x-keys.yaml           |   9 +-
 .../bindings/input/max77650-onkey.yaml        |   8 +-
 11 files changed, 150 insertions(+), 110 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/input/adc-keys.txt
 create mode 100644 Documentation/devicetree/bindings/input/adc-keys.yaml

Comments

Jeff LaBundy June 9, 2022, 1:29 a.m. UTC | #1
Hi Rob,

On Wed, Jun 08, 2022 at 03:12:03PM -0600, Rob Herring wrote:
> The maximum keycode value for Linux is 0x2ff, not 0xff. There's already
> users and examples with values greater than 0xff, but the schema is not
> yet applied in those cases.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>

As the creator of a few said examples:

Reviewed-by: Jeff LaBundy <jeff@labundy.com>

> ---
>  Documentation/devicetree/bindings/input/input.yaml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/input/input.yaml b/Documentation/devicetree/bindings/input/input.yaml
> index d41d8743aad4..43d2f299c332 100644
> --- a/Documentation/devicetree/bindings/input/input.yaml
> +++ b/Documentation/devicetree/bindings/input/input.yaml
> @@ -21,7 +21,7 @@ properties:
>      $ref: /schemas/types.yaml#/definitions/uint32-array
>      items:
>        minimum: 0
> -      maximum: 0xff
> +      maximum: 0x2ff
>  
>    poll-interval:
>      description: Poll interval time in milliseconds.
> -- 
> 2.34.1
> 

Thank you for driving this series.

Kind regards,
Jeff LaBundy
Jeff LaBundy June 9, 2022, 1:34 a.m. UTC | #2
Hi Rob,

On Wed, Jun 08, 2022 at 03:12:05PM -0600, Rob Herring wrote:
> The common input schema, input.yaml, already defines 'linux,keycodes'
> property. Update the users to use it.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>

Acked-by: Jeff LaBundy <jeff@labundy.com>

> ---
>  Documentation/devicetree/bindings/input/iqs626a.yaml     | 2 +-
>  Documentation/devicetree/bindings/input/iqs62x-keys.yaml | 4 +++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/input/iqs626a.yaml b/Documentation/devicetree/bindings/input/iqs626a.yaml
> index e645521da8ba..008959f2d425 100644
> --- a/Documentation/devicetree/bindings/input/iqs626a.yaml
> +++ b/Documentation/devicetree/bindings/input/iqs626a.yaml
> @@ -510,6 +510,7 @@ patternProperties:
>  
>    "^trackpad-3x[2-3]$":
>      type: object
> +    $ref: input.yaml#
>      description:
>        Represents all channels associated with the trackpad. The channels are
>        collectively active if the trackpad is defined and inactive otherwise.
> @@ -678,7 +679,6 @@ patternProperties:
>            Specifies the raw count filter strength during low-power mode.
>  
>        linux,keycodes:
> -        $ref: /schemas/types.yaml#/definitions/uint32-array
>          minItems: 1
>          maxItems: 6
>          description: |
> diff --git a/Documentation/devicetree/bindings/input/iqs62x-keys.yaml b/Documentation/devicetree/bindings/input/iqs62x-keys.yaml
> index e677e31fe8fe..0aa951f0ab92 100644
> --- a/Documentation/devicetree/bindings/input/iqs62x-keys.yaml
> +++ b/Documentation/devicetree/bindings/input/iqs62x-keys.yaml
> @@ -9,6 +9,9 @@ title: Azoteq IQS620A/621/622/624/625 Keys and Switches
>  maintainers:
>    - Jeff LaBundy <jeff@labundy.com>
>  
> +allOf:
> +  - $ref: input.yaml#
> +
>  description: |
>    The Azoteq IQS620A, IQS621, IQS622, IQS624 and IQS625 multi-function sensors
>    feature a variety of self-capacitive, mutual-inductive and Hall-effect sens-
> @@ -30,7 +33,6 @@ properties:
>        - azoteq,iqs625-keys
>  
>    linux,keycodes:
> -    $ref: /schemas/types.yaml#/definitions/uint32-array
>      minItems: 1
>      maxItems: 16
>      description: |
> -- 
> 2.34.1
> 

Kind regards,
Jeff LaBundy
Heinrich Schuchardt June 9, 2022, 5:46 a.m. UTC | #3
On 6/8/22 23:12, Rob Herring wrote:
> The maximum keycode value for Linux is 0x2ff, not 0xff. There's already
> users and examples with values greater than 0xff, but the schema is not
> yet applied in those cases.
>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>   Documentation/devicetree/bindings/input/input.yaml | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/input/input.yaml b/Documentation/devicetree/bindings/input/input.yaml
> index d41d8743aad4..43d2f299c332 100644
> --- a/Documentation/devicetree/bindings/input/input.yaml
> +++ b/Documentation/devicetree/bindings/input/input.yaml
> @@ -21,7 +21,7 @@ properties:
>       $ref: /schemas/types.yaml#/definitions/uint32-array
>       items:
>         minimum: 0
> -      maximum: 0xff
> +      maximum: 0x2ff

Can this value of 0x2ff be make exportable such that we can use it as a
reference in devicetree/bindings/input/adc-keys.yaml. E.g. define a type
that only take values in the 0-0x2ff range?

Best regards

Heinrich

>
>     poll-interval:
>       description: Poll interval time in milliseconds.
Rob Herring June 10, 2022, 1:23 p.m. UTC | #4
On Thu, Jun 09, 2022 at 07:46:51AM +0200, Heinrich Schuchardt wrote:
> On 6/8/22 23:12, Rob Herring wrote:
> > The maximum keycode value for Linux is 0x2ff, not 0xff. There's already
> > users and examples with values greater than 0xff, but the schema is not
> > yet applied in those cases.
> > 
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > ---
> >   Documentation/devicetree/bindings/input/input.yaml | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/input/input.yaml b/Documentation/devicetree/bindings/input/input.yaml
> > index d41d8743aad4..43d2f299c332 100644
> > --- a/Documentation/devicetree/bindings/input/input.yaml
> > +++ b/Documentation/devicetree/bindings/input/input.yaml
> > @@ -21,7 +21,7 @@ properties:
> >       $ref: /schemas/types.yaml#/definitions/uint32-array
> >       items:
> >         minimum: 0
> > -      maximum: 0xff
> > +      maximum: 0x2ff
> 
> Can this value of 0x2ff be make exportable such that we can use it as a
> reference in devicetree/bindings/input/adc-keys.yaml. E.g. define a type
> that only take values in the 0-0x2ff range?

There's no need. The $ref to input.yaml in does that effectively 
already. That's why 'linux,code' doesn't need any schema constraints 
unless it has additional constraints. max77650-onkey.yaml in patch 2 has 
an example of that. If you wanted to add a new, custom property with 
those constraints, then we could do something like this:

$defs:
  input-codes:
    minimum: 0
    maximum: 0x2ff
    ...

And then have: $ref: input.yaml#/$defs/input-codes

Rob
Rob Herring June 28, 2022, 5:51 p.m. UTC | #5
On Wed, Jun 08, 2022 at 03:12:02PM -0600, Rob Herring wrote:
> This series refactors the common 'linux,code', 'linux,keycodes', and
> 'linux,input-type' properties defined in various binding schemas. As the
> properties are common, they should only have a single common schema type
> definition. Note that 'linux,input-value' was not included here as it is
> only used in 1 binding (gpio-keys).
> 
> The clean-ups are are result of the discussion on v1 of the adc-keys
> binding conversion[1].
> 
> Rob
> 
> [1] https://lore.kernel.org/all/20220606184243.1057145-1-robh@kernel.org/
> 
> 
> Rob Herring (5):
>   dt-bindings: input: Increase maximum keycode value to 0x2ff
>   dt-bindings: input: Centralize 'linux,code' definition
>   dt-bindings: input: Use common 'linux,keycodes' definition
>   dt-bindings: input: Centralize 'linux,input-type' definition
>   dt-bindings: input: Convert adc-keys to DT schema

Dmitry, Any comments on this?

Rob
Dmitry Torokhov July 8, 2022, 10:20 p.m. UTC | #6
On Tue, Jun 28, 2022 at 11:51:37AM -0600, Rob Herring wrote:
> On Wed, Jun 08, 2022 at 03:12:02PM -0600, Rob Herring wrote:
> > This series refactors the common 'linux,code', 'linux,keycodes', and
> > 'linux,input-type' properties defined in various binding schemas. As the
> > properties are common, they should only have a single common schema type
> > definition. Note that 'linux,input-value' was not included here as it is
> > only used in 1 binding (gpio-keys).
> > 
> > The clean-ups are are result of the discussion on v1 of the adc-keys
> > binding conversion[1].
> > 
> > Rob
> > 
> > [1] https://lore.kernel.org/all/20220606184243.1057145-1-robh@kernel.org/
> > 
> > 
> > Rob Herring (5):
> >   dt-bindings: input: Increase maximum keycode value to 0x2ff
> >   dt-bindings: input: Centralize 'linux,code' definition
> >   dt-bindings: input: Use common 'linux,keycodes' definition
> >   dt-bindings: input: Centralize 'linux,input-type' definition
> >   dt-bindings: input: Convert adc-keys to DT schema
> 
> Dmitry, Any comments on this?

Sorry, applied the lot, thank you.