dt-bindings: input: Common property clean-ups and adc-keys conversion
Subsystems (6)
Rob Herring
maintainerv2 cover dt-bindings: input: Common property clean-ups and adc-keys conversion
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/[email protected]/
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
Signature · 1 line
2.34.1
Rob Herring
maintainerPATCH v2 1/5 dt-bindings: input: Increase maximum keycode value to 0x2ff
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.
--- Documentation/devicetree/bindings/input/input.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/input/input.yaml +1 -1
@@ -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.
Signature · 1 line
2.34.1
Re: [PATCH v2 1/5] dt-bindings: input: Increase maximum keycode value to 0x2ff
Hi Rob,
Quoted 5 lines · Rob Herring
The maximum keycode value for Linux is
0x2ff, not0xff. There's already users and examples with values greater than0xff, but the schema is not yet applied in those cases.Signed-off-by Rob Herring <[email protected]>
As the creator of a few said examples:
Quoted 20 lines
--- Documentation/devicetree/bindings/input/input.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Documentation/devicetree/bindings/input/input.yaml +1
-1@@ -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.Signature · 1 line
2.34.1
Thank you for driving this series.
Kind regards,
Jeff LaBundy
Re: [PATCH v2 1/5] dt-bindings: input: Increase maximum keycode value to 0x2ff
In reply to Rob HerringQuoted 14 lines · Rob Herring
The maximum keycode value for Linux is
0x2ff, not0xff. There's already users and examples with values greater than0xff, but the schema is not yet applied in those cases.Signed-off-by Rob Herring <[email protected]>--- Documentation/devicetree/bindings/input/input.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Documentation/devicetree/bindings/input/input.yaml +0
-0
Documentation/devicetree/bindings/input/input.yaml properties: · line 24
Quoted 5 lines
Documentation/devicetree/bindings/input/input.yaml +1
-1@@ -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
Quoted 3 lines
Documentation/devicetree/bindings/input/input.yaml +0
-0poll-interval: description: Poll interval time in milliseconds.
Rob Herring
maintainerRe: [PATCH v2 1/5] dt-bindings: input: Increase maximum keycode value to 0x2ff
Quoted 10 lines · Heinrich Schuchardt
Quoted 9 lines · Rob Herring
The maximum keycode value for Linux is
0x2ff, not0xff. There's already users and examples with values greater than0xff, but the schema is not yet applied in those cases.Signed-off-by Rob Herring <[email protected]>--- Documentation/devicetree/bindings/input/input.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines
Documentation/devicetree/bindings/input/input.yaml properties: · line 24
Quoted 10 lines
Documentation/devicetree/bindings/input/input.yaml +1
-1@@ -21,7 +21,7 @@ properties: $ref: /schemas/types.yaml#/definitions/uint32-array items: minimum: 0 - maximum: 0xff + maximum: 0x2ffCan this value of
0x2ffbe make exportable such that we can use it as a reference indevicetree/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
maintainerPATCH v2 2/5 dt-bindings: input: Centralize 'linux,code' definition
In reply to Rob HerringMultiple bindings use 'linux,code', but there is not a central definition and type. Add 'linux,code' to input.yaml and update all the users to use it.
--- .../devicetree/bindings/input/adc-joystick.yaml | 2 +- .../input/allwinner,sun4i-a10-lradc-keys.yaml | 5 ++--- .../devicetree/bindings/input/azoteq,iqs7222.yaml | 7 ++----- .../devicetree/bindings/input/gpio-keys.yaml | 1 - .../devicetree/bindings/input/input.yaml | 8 ++++++++ .../devicetree/bindings/input/iqs269a.yaml | 15 ++++++--------- .../devicetree/bindings/input/iqs626a.yaml | 5 ++--- .../devicetree/bindings/input/iqs62x-keys.yaml | 5 ++--- .../devicetree/bindings/input/max77650-onkey.yaml | 8 ++++---- 9 files changed, 27 insertions(+), 29 deletions(-)
Documentation/devicetree/bindings/input/adc-joystick.yaml +1 -1
@@ -45,6 +45,7 @@ additionalProperties: false patternProperties: "^axis@[0-9a-f]+$": type: object + $ref: input.yaml# description: > Represents a joystick axis bound to the given ADC channel. For each entry in the io-channels list, one axis subnode with a matching
@@ -57,7 +58,6 @@ patternProperties: description: Index of an io-channels list entry bound to this axis. linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 description: EV_ABS specific event code generated by the axis. abs-range:
Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml +2 -3
@@ -44,14 +44,13 @@ properties: patternProperties: "^button-[0-9]+$": type: object + $ref: input.yaml# properties: label: $ref: /schemas/types.yaml#/definitions/string description: Descriptive name of the key - linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: Keycode to emit + linux,code: true channel: $ref: /schemas/types.yaml#/definitions/uint32
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +2 -5
@@ -421,6 +421,7 @@ patternProperties: patternProperties: "^event-(prox|touch)$": type: object + $ref: input.yaml# description: Represents a proximity or touch event reported by the channel.
@@ -467,11 +468,7 @@ patternProperties: The IQS7222B does not feature channel-specific timeouts; the time- out specified for any one channel applies to all channels. - linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: - Numeric key or switch code associated with the event. Specify - KEY_RESERVED (0) to opt out of event reporting. + linux,code: true linux,input-type: $ref: /schemas/types.yaml#/definitions/uint32
Documentation/devicetree/bindings/input/gpio-keys.yaml +0 -1
@@ -34,7 +34,6 @@ patternProperties: linux,code: description: Key / Axis code to emit. - $ref: /schemas/types.yaml#/definitions/uint32 linux,input-type: description:
Documentation/devicetree/bindings/input/input.yaml +8 -0
@@ -23,6 +23,14 @@ properties: minimum: 0 maximum: 0x2ff + linux,code: + description: + Specifies a single numeric keycode value to be used for reporting + button/switch events. Specify KEY_RESERVED (0) to opt out of event + reporting. + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 0x2ff + poll-interval: description: Poll interval time in milliseconds. $ref: /schemas/types.yaml#/definitions/uint32
Documentation/devicetree/bindings/input/iqs269a.yaml +6 -9
@@ -370,6 +370,7 @@ patternProperties: patternProperties: "^event-prox(-alt)?$": type: object + $ref: input.yaml# description: Represents a proximity event reported by the channel in response to a decrease in counts. Node names suffixed with '-alt' instead corre-
@@ -396,14 +397,13 @@ patternProperties: default: 10 description: Specifies the threshold for the event. - linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: Numeric key or switch code associated with the event. + linux,code: true additionalProperties: false "^event-touch(-alt)?$": type: object + $ref: input.yaml# description: Represents a touch event reported by the channel. properties:
@@ -421,14 +421,13 @@ patternProperties: default: 4 description: Specifies the hysteresis for the event. - linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: Numeric key or switch code associated with the event. + linux,code: true additionalProperties: false "^event-deep(-alt)?$": type: object + $ref: input.yaml# description: Represents a deep-touch event reported by the channel. properties:
@@ -446,9 +445,7 @@ patternProperties: default: 0 description: Specifies the hysteresis for the event. - linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: Numeric key or switch code associated with the event. + linux,code: true additionalProperties: false
Documentation/devicetree/bindings/input/iqs626a.yaml +2 -3
@@ -449,6 +449,7 @@ patternProperties: patternProperties: "^event-(prox|touch|deep)(-alt)?$": type: object + $ref: input.yaml# description: Represents a proximity, touch or deep-touch event reported by the channel in response to a decrease in counts. Node names suffixed with
@@ -487,9 +488,7 @@ patternProperties: Specifies the hysteresis for the event (touch and deep-touch events only). - linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: Numeric key or switch code associated with the event. + linux,code: true linux,input-type: $ref: /schemas/types.yaml#/definitions/uint32
Documentation/devicetree/bindings/input/iqs62x-keys.yaml +2 -3
@@ -89,15 +89,14 @@ properties: patternProperties: "^hall-switch-(north|south)$": type: object + $ref: input.yaml# description: Represents north/south-field Hall-effect sensor touch or proximity events. Note that north/south-field orientation is reversed on the IQS620AXzCSR device due to its flip-chip package. properties: - linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: Numeric switch code associated with the event. + linux,code: true azoteq,use-prox: $ref: /schemas/types.yaml#/definitions/flag
Documentation/devicetree/bindings/input/max77650-onkey.yaml +4 -4
@@ -16,15 +16,15 @@ description: | The onkey controller is represented as a sub-node of the PMIC node on the device tree. +allOf: + - $ref: input.yaml# + properties: compatible: const: maxim,max77650-onkey linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: - The key-code to be reported when the key is pressed. Defaults - to KEY_POWER. + default: 116 # KEY_POWER maxim,onkey-slide: $ref: /schemas/types.yaml#/definitions/flag
Signature · 1 line
2.34.1
Re: [PATCH v2 2/5] dt-bindings: input: Centralize 'linux,code' definition
Hi Rob,
Quoted 5 lines · Rob Herring
Multiple bindings use 'linux,code', but there is not a central definition and type. Add 'linux,code' to
input.yamland update all the users to use it.Signed-off-by Rob Herring <[email protected]>
For *iqs*.yaml:
Quoted 238 lines
--- .../devicetree/bindings/input/adc-joystick.yaml | 2 +- .../input/allwinner,sun4i-a10-lradc-keys.yaml | 5 ++--- .../devicetree/bindings/input/azoteq,iqs7222.yaml | 7 ++----- .../devicetree/bindings/input/gpio-keys.yaml | 1 - .../devicetree/bindings/input/input.yaml | 8 ++++++++ .../devicetree/bindings/input/iqs269a.yaml | 15 ++++++--------- .../devicetree/bindings/input/iqs626a.yaml | 5 ++--- .../devicetree/bindings/input/iqs62x-keys.yaml | 5 ++--- .../devicetree/bindings/input/max77650-onkey.yaml | 8 ++++---- 9 files changed, 27 insertions(+), 29 deletions(-)Documentation/devicetree/bindings/input/adc-joystick.yaml +1
-1@@ -45,6 +45,7 @@ additionalProperties: false patternProperties: "^axis@[0-9a-f]+$": type: object + $ref: input.yaml# description: > Represents a joystick axis bound to the given ADC channel. For each entry in the io-channels list, one axis subnode with a matching@@ -57,7 +58,6 @@ patternProperties: description: Index of an io-channels list entry bound to this axis. linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 description: EV_ABS specific event code generated by the axis. abs-range:Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml +2
-3@@ -44,14 +44,13 @@ properties: patternProperties: "^button-[0-9]+$": type: object + $ref: input.yaml# properties: label: $ref: /schemas/types.yaml#/definitions/string description: Descriptive name of the key - linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: Keycode to emit + linux,code: true channel: $ref: /schemas/types.yaml#/definitions/uint32Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +2
-5@@ -421,6 +421,7 @@ patternProperties: patternProperties: "^event-(prox|touch)$": type: object + $ref: input.yaml# description: Represents a proximity or touch event reported by the channel.@@ -467,11 +468,7 @@ patternProperties: The IQS7222B does not feature channel-specific timeouts; the time- out specified for any one channel applies to all channels. - linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: - Numeric key or switch code associated with the event. Specify - KEY_RESERVED (0) to opt out of event reporting. + linux,code: true linux,input-type: $ref: /schemas/types.yaml#/definitions/uint32Documentation/devicetree/bindings/input/gpio-keys.yaml +0
-1@@ -34,7 +34,6 @@ patternProperties: linux,code: description: Key / Axis code to emit. - $ref: /schemas/types.yaml#/definitions/uint32 linux,input-type: description:Documentation/devicetree/bindings/input/input.yaml +8
-0@@ -23,6 +23,14 @@ properties: minimum: 0 maximum: 0x2ff + linux,code: + description: + Specifies a single numeric keycode value to be used for reporting + button/switch events. Specify KEY_RESERVED (0) to opt out of event + reporting. + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 0x2ff + poll-interval: description: Poll interval time in milliseconds. $ref: /schemas/types.yaml#/definitions/uint32Documentation/devicetree/bindings/input/iqs269a.yaml +6
-9@@ -370,6 +370,7 @@ patternProperties: patternProperties: "^event-prox(-alt)?$": type: object + $ref: input.yaml# description: Represents a proximity event reported by the channel in response to a decrease in counts. Node names suffixed with '-alt' instead corre-@@ -396,14 +397,13 @@ patternProperties: default: 10 description: Specifies the threshold for the event. - linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: Numeric key or switch code associated with the event. + linux,code: true additionalProperties: false "^event-touch(-alt)?$": type: object + $ref: input.yaml# description: Represents a touch event reported by the channel. properties:@@ -421,14 +421,13 @@ patternProperties: default: 4 description: Specifies the hysteresis for the event. - linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: Numeric key or switch code associated with the event. + linux,code: true additionalProperties: false "^event-deep(-alt)?$": type: object + $ref: input.yaml# description: Represents a deep-touch event reported by the channel. properties:@@ -446,9 +445,7 @@ patternProperties: default: 0 description: Specifies the hysteresis for the event. - linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: Numeric key or switch code associated with the event. + linux,code: true additionalProperties: falseDocumentation/devicetree/bindings/input/iqs626a.yaml +2
-3@@ -449,6 +449,7 @@ patternProperties: patternProperties: "^event-(prox|touch|deep)(-alt)?$": type: object + $ref: input.yaml# description: Represents a proximity, touch or deep-touch event reported by the channel in response to a decrease in counts. Node names suffixed with@@ -487,9 +488,7 @@ patternProperties: Specifies the hysteresis for the event (touch and deep-touch events only). - linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: Numeric key or switch code associated with the event. + linux,code: true linux,input-type: $ref: /schemas/types.yaml#/definitions/uint32Documentation/devicetree/bindings/input/iqs62x-keys.yaml +2
-3@@ -89,15 +89,14 @@ properties: patternProperties: "^hall-switch-(north|south)$": type: object + $ref: input.yaml# description: Represents north/south-field Hall-effect sensor touch or proximity events. Note that north/south-field orientation is reversed on the IQS620AXzCSR device due to its flip-chip package. properties: - linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: Numeric switch code associated with the event. + linux,code: true azoteq,use-prox: $ref: /schemas/types.yaml#/definitions/flagDocumentation/devicetree/bindings/input/max77650-onkey.yaml +4
-4@@ -16,15 +16,15 @@ description: | The onkey controller is represented as a sub-node of the PMIC node on the device tree. +allOf: + - $ref: input.yaml# + properties: compatible: const: maxim,max77650-onkey linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: - The key-code to be reported when the key is pressed. Defaults - to KEY_POWER. + default: 116 # KEY_POWER maxim,onkey-slide: $ref: /schemas/types.yaml#/definitions/flagSignature · 1 line
2.34.1
Kind regards,
Jeff LaBundy
Re: [PATCH v2 2/5] dt-bindings: input: Centralize 'linux,code' definition
In reply to Rob HerringQuoted 5 lines · Rob Herring
Multiple bindings use 'linux,code', but there is not a central definition and type. Add 'linux,code' to
input.yamland update all the users to use it.Signed-off-by Rob Herring <[email protected]>
For adc-joystick.yaml:
Quoted 270 lines
--- .../devicetree/bindings/input/adc-joystick.yaml | 2 +- .../input/allwinner,sun4i-a10-lradc-keys.yaml | 5 ++--- .../devicetree/bindings/input/azoteq,iqs7222.yaml | 7 ++----- .../devicetree/bindings/input/gpio-keys.yaml | 1 - .../devicetree/bindings/input/input.yaml | 8 ++++++++ .../devicetree/bindings/input/iqs269a.yaml | 15 ++++++--------- .../devicetree/bindings/input/iqs626a.yaml | 5 ++--- .../devicetree/bindings/input/iqs62x-keys.yaml | 5 ++--- .../devicetree/bindings/input/max77650-onkey.yaml | 8 ++++---- 9 files changed, 27 insertions(+), 29 deletions(-)Documentation/devicetree/bindings/input/adc-joystick.yaml +1
-0@@ -45,6 +45,7 @@ additionalProperties: false patternProperties: "^axis@[0-9a-f]+$": type: object + $ref: input.yaml# description: > Represents a joystick axis bound to the given ADC channel. For each entry in the io-channels list, one axis subnode with amatching
Documentation/devicetree/bindings/input/adc-joystick.yaml +0
-0@@ -57,7 +58,6 @@ patternProperties: description: Index of an io-channels list entry bound to thisaxis.
linux,code:
- $ref: /schemas/types.yaml#/definitions/uint32
description:EV_ABSspecific event code generated by the axis.abs-range:
diff --gita/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yamlb/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yamlindex3399fc288afb..9700dc468b25100644
---a/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
+++b/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yamlDocumentation/devicetree/bindings/input/adc-joystick.yaml +2
-3@@ -44,14 +44,13 @@ properties: patternProperties: "^button-[0-9]+$": type: object + $ref: input.yaml# properties: label: $ref: /schemas/types.yaml#/definitions/string description: Descriptive name of the key - linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: Keycode to emit + linux,code: true channel: $ref: /schemas/types.yaml#/definitions/uint32diff --git
a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yamlb/Documentation/devicetree/bindings/input/azoteq,iqs7222.yamlindexa3a1e5a65306..5ea10fe7ffe9100644Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +1
-0@@ -421,6 +421,7 @@ patternProperties: patternProperties: "^event-(prox|touch)$": type: object + $ref: input.yaml# description: Represents a proximity or touch event reported by thechannel.
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +0
-0@@ -467,11 +468,7 @@ patternProperties: The IQS7222B does not feature channel-specifictimeouts; the time-
out specified for any one channel applies to all
channels.Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +0
-4- linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: - Numeric key or switch code associated with the event.Specify
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +1
-1- KEY_RESERVED (0) to opt out of event reporting. + linux,code: true linux,input-type: $ref: /schemas/types.yaml#/definitions/uint32Documentation/devicetree/bindings/input/gpio-keys.yaml +0
-1@@ -34,7 +34,6 @@ patternProperties: linux,code: description: Key / Axis code to emit. - $ref: /schemas/types.yaml#/definitions/uint32 linux,input-type: description:Documentation/devicetree/bindings/input/input.yaml +3
-0@@ -23,6 +23,14 @@ properties: minimum: 0 maximum: 0x2ff + linux,code: + description: + Specifies a single numeric keycode value to be used forreporting
+ button/switch events. SpecifyKEY_RESERVED(0) to opt out of
eventDocumentation/devicetree/bindings/input/input.yaml +4
-0+ reporting. + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 0x2ff + poll-interval: description: Poll interval time in milliseconds. $ref: /schemas/types.yaml#/definitions/uint32Documentation/devicetree/bindings/input/iqs269a.yaml +1
-0@@ -370,6 +370,7 @@ patternProperties: patternProperties: "^event-prox(-alt)?$": type: object + $ref: input.yaml# description: Represents a proximity event reported by the channel inresponse to
a decrease in counts. Node names suffixed with '-alt'
instead corre-Documentation/devicetree/bindings/input/iqs269a.yaml +0
-3@@ -396,14 +397,13 @@ patternProperties: default: 10 description: Specifies the threshold for the event. - linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: Numeric key or switch code associated withthe event.
Documentation/devicetree/bindings/input/iqs269a.yaml +2
-3+ linux,code: true additionalProperties: false "^event-touch(-alt)?$": type: object + $ref: input.yaml# description: Represents a touch event reported by the channel. properties:@@ -421,14 +421,13 @@ patternProperties: default: 4 description: Specifies the hysteresis for the event. - linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: Numeric key or switch code associated withthe event.
Documentation/devicetree/bindings/input/iqs269a.yaml +2
-0+ linux,code: true additionalProperties: false "^event-deep(-alt)?$": type: object + $ref: input.yaml# description: Represents a deep-touch event reported by thechannel.
properties:
Documentation/devicetree/bindings/input/iqs269a.yaml +0
-3@@ -446,9 +445,7 @@ patternProperties: default: 0 description: Specifies the hysteresis for the event. - linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: Numeric key or switch code associated withthe event.
Documentation/devicetree/bindings/input/iqs269a.yaml +1
-0+ linux,code: true additionalProperties: falseDocumentation/devicetree/bindings/input/iqs626a.yaml +1
-0@@ -449,6 +449,7 @@ patternProperties: patternProperties: "^event-(prox|touch|deep)(-alt)?$": type: object + $ref: input.yaml# description: Represents a proximity, touch or deep-touch event reportedby the
channel in response to a decrease in counts. Node names
suffixed withDocumentation/devicetree/bindings/input/iqs626a.yaml +0
-0@@ -487,9 +488,7 @@ patternProperties: Specifies the hysteresis for the event (touch anddeep-touch
events only).Documentation/devicetree/bindings/input/iqs626a.yaml +0
-3- linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: Numeric key or switch code associated withthe event.
Documentation/devicetree/bindings/input/iqs626a.yaml +1
-0+ linux,code: true linux,input-type: $ref: /schemas/types.yaml#/definitions/uint32Documentation/devicetree/bindings/input/iqs62x-keys.yaml +1
-0@@ -89,15 +89,14 @@ properties: patternProperties: "^hall-switch-(north|south)$": type: object + $ref: input.yaml# description: Represents north/south-field Hall-effect sensor touch orproximity
events. Note that north/south-field orientation is reversed on
the
IQS620AXzCSR device due to its flip-chip package.properties:
Documentation/devicetree/bindings/input/iqs62x-keys.yaml +1
-3- linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: Numeric switch code associated with the event. + linux,code: true azoteq,use-prox: $ref: /schemas/types.yaml#/definitions/flagdiff --git
a/Documentation/devicetree/bindings/input/max77650-onkey.yamlb/Documentation/devicetree/bindings/input/max77650-onkey.yamlindex3a2ad6ec64db..48edc0c8c1dd100644Documentation/devicetree/bindings/input/max77650-onkey.yaml +0
-0@@ -16,15 +16,15 @@ description: | The onkey controller is represented as a sub-node of the PMIC nodeon
the device tree.Documentation/devicetree/bindings/input/max77650-onkey.yaml +4
-4+allOf: + - $ref: input.yaml# + properties: compatible: const: maxim,max77650-onkey linux,code: - $ref: /schemas/types.yaml#/definitions/uint32 - description: - The key-code to be reported when the key is pressed. Defaults - to KEY_POWER. + default: 116 # KEY_POWER maxim,onkey-slide: $ref: /schemas/types.yaml#/definitions/flag
Re: [PATCH v2 2/5] dt-bindings: input: Centralize 'linux,code' definition
In reply to Rob HerringQuoted 8 lines · Rob Herring
Multiple bindings use 'linux,code', but there is not a central definition and type. Add 'linux,code' to
input.yamland update all the users to use it.Signed-off-by Rob Herring <[email protected]>--- .../devicetree/bindings/input/adc-joystick.yaml | 2 +- .../input/allwinner,sun4i-a10-lradc-keys.yaml | 5 ++---
For allwinner,sun4i-a10-lradc-keys.yaml:
Quoted 8 lines
.../devicetree/bindings/input/azoteq,iqs7222.yaml | 7 ++----- .../devicetree/bindings/input/gpio-keys.yaml | 1 - .../devicetree/bindings/input/input.yaml | 8 ++++++++ .../devicetree/bindings/input/iqs269a.yaml | 15 ++++++--------- .../devicetree/bindings/input/iqs626a.yaml | 5 ++--- .../devicetree/bindings/input/iqs62x-keys.yaml | 5 ++--- .../devicetree/bindings/input/max77650-onkey.yaml | 8 ++++---- 9 files changed, 27 insertions(+), 29 deletions(-)
Rob Herring
maintainerPATCH v2 3/5 dt-bindings: input: Use common 'linux,keycodes' definition
In reply to Rob HerringThe common input schema, input.yaml, already defines 'linux,keycodes' property. Update the users to use it.
--- Documentation/devicetree/bindings/input/iqs626a.yaml | 2 +- Documentation/devicetree/bindings/input/iqs62x-keys.yaml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/input/iqs626a.yaml +1 -1
@@ -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: |
Documentation/devicetree/bindings/input/iqs62x-keys.yaml +3 -1
@@ -9,6 +9,9 @@ title: Azoteq IQS620A/621/622/624/625 Keys and Switches maintainers: - Jeff LaBundy <[email protected]> +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: |
Signature · 1 line
2.34.1
Re: [PATCH v2 3/5] dt-bindings: input: Use common 'linux,keycodes' definition
Hi Rob,
Quoted 4 lines · Rob Herring
The common input schema,
input.yaml, already defines 'linux,keycodes' property. Update the users to use it.Signed-off-by Rob Herring <[email protected]>
Quoted 50 lines
--- Documentation/devicetree/bindings/input/iqs626a.yaml | 2 +- Documentation/devicetree/bindings/input/iqs62x-keys.yaml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-)Documentation/devicetree/bindings/input/iqs626a.yaml +1
-1@@ -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: |Documentation/devicetree/bindings/input/iqs62x-keys.yaml +3
-1@@ -9,6 +9,9 @@ title: Azoteq IQS620A/621/622/624/625 Keys and Switches maintainers: - Jeff LaBundy <[email protected]> +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: |Signature · 1 line
2.34.1
Kind regards,
Jeff LaBundy
Rob Herring
maintainerPATCH v2 4/5 dt-bindings: input: Centralize 'linux,input-type' definition
In reply to Rob HerringMultiple bindings use 'linux,input-type', but there is not a central definition and type. Add 'linux,input-type' to input.yaml and update all the users to use it.
--- .../devicetree/bindings/input/azoteq,iqs7222.yaml | 1 - .../devicetree/bindings/input/gpio-keys.yaml | 7 +------ Documentation/devicetree/bindings/input/input.yaml | 14 ++++++++++++++ .../devicetree/bindings/input/iqs626a.yaml | 4 ---- 4 files changed, 15 insertions(+), 11 deletions(-)
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +0 -1
@@ -471,7 +471,6 @@ patternProperties: linux,code: true linux,input-type: - $ref: /schemas/types.yaml#/definitions/uint32 enum: [1, 5] default: 1 description:
Documentation/devicetree/bindings/input/gpio-keys.yaml +1 -6
@@ -36,12 +36,7 @@ patternProperties: description: Key / Axis code to emit. linux,input-type: - description: - Specify event type this button/key generates. If not specified defaults to - <1> == EV_KEY. - $ref: /schemas/types.yaml#/definitions/uint32 - - default: 1 + default: 1 # EV_KEY linux,input-value: description: |
Documentation/devicetree/bindings/input/input.yaml +14 -0
@@ -31,6 +31,17 @@ properties: $ref: /schemas/types.yaml#/definitions/uint32 maximum: 0x2ff + linux,input-type: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: + - 1 # EV_KEY + - 2 # EV_REL + - 3 # EV_ABS + - 5 # EV_SW + description: + Specifies whether the event is to be interpreted as a key, relative, + absolute, or switch. + poll-interval: description: Poll interval time in milliseconds. $ref: /schemas/types.yaml#/definitions/uint32
@@ -47,4 +58,7 @@ properties: reset automatically. Device with key pressed reset feature can specify this property. +dependencies: + linux,input-type: [ "linux,code" ] + additionalProperties: true
Documentation/devicetree/bindings/input/iqs626a.yaml +0 -4
@@ -491,16 +491,12 @@ patternProperties: linux,code: true linux,input-type: - $ref: /schemas/types.yaml#/definitions/uint32 enum: [1, 5] description: Specifies whether the event is to be interpreted as a key (1) or a switch (5). By default, Hall-channel events are interpreted as switches and all others are interpreted as keys. - dependencies: - linux,input-type: ["linux,code"] - additionalProperties: false dependencies:
Signature · 1 line
2.34.1
Re: [PATCH v2 4/5] dt-bindings: input: Centralize 'linux,input-type' definition
Hi Rob,
Quoted 5 lines · Rob Herring
Multiple bindings use 'linux,input-type', but there is not a central definition and type. Add 'linux,input-type' to
input.yamland update all the users to use it.Signed-off-by Rob Herring <[email protected]>
For *iqs*.yaml:
Quoted 91 lines
--- .../devicetree/bindings/input/azoteq,iqs7222.yaml | 1 - .../devicetree/bindings/input/gpio-keys.yaml | 7 +------ Documentation/devicetree/bindings/input/input.yaml | 14 ++++++++++++++ .../devicetree/bindings/input/iqs626a.yaml | 4 ---- 4 files changed, 15 insertions(+), 11 deletions(-)Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +0
-1@@ -471,7 +471,6 @@ patternProperties: linux,code: true linux,input-type: - $ref: /schemas/types.yaml#/definitions/uint32 enum: [1, 5] default: 1 description:Documentation/devicetree/bindings/input/gpio-keys.yaml +1
-6@@ -36,12 +36,7 @@ patternProperties: description: Key / Axis code to emit. linux,input-type: - description: - Specify event type this button/key generates. If not specified defaults to - <1> == EV_KEY. - $ref: /schemas/types.yaml#/definitions/uint32 - - default: 1 + default: 1 # EV_KEY linux,input-value: description: |Documentation/devicetree/bindings/input/input.yaml +14
-0@@ -31,6 +31,17 @@ properties: $ref: /schemas/types.yaml#/definitions/uint32 maximum: 0x2ff + linux,input-type: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: + - 1 # EV_KEY + - 2 # EV_REL + - 3 # EV_ABS + - 5 # EV_SW + description: + Specifies whether the event is to be interpreted as a key, relative, + absolute, or switch. + poll-interval: description: Poll interval time in milliseconds. $ref: /schemas/types.yaml#/definitions/uint32@@ -47,4 +58,7 @@ properties: reset automatically. Device with key pressed reset feature can specify this property. +dependencies: + linux,input-type: [ "linux,code" ] + additionalProperties: trueDocumentation/devicetree/bindings/input/iqs626a.yaml +0
-4@@ -491,16 +491,12 @@ patternProperties: linux,code: true linux,input-type: - $ref: /schemas/types.yaml#/definitions/uint32 enum: [1, 5] description: Specifies whether the event is to be interpreted as a key (1) or a switch (5). By default, Hall-channel events are interpreted as switches and all others are interpreted as keys. - dependencies: - linux,input-type: ["linux,code"] - additionalProperties: false dependencies:Signature · 1 line
2.34.1
Kind regards,
Jeff LaBundy
Rob Herring
maintainerPATCH v2 5/5 dt-bindings: input: Convert adc-keys to DT schema
In reply to Rob HerringConvert the adc-keys binding to DT schema format.
The old binding has 'label' as required, but it should never be required given it's just a human readable description.
---
v2:
- Drop Heinrich as a maintainer
- Use common linux,code definition
- Drop label as required
--- .../devicetree/bindings/input/adc-keys.txt | 67 ------------ .../devicetree/bindings/input/adc-keys.yaml | 103 ++++++++++++++++++ 2 files changed, 103 insertions(+), 67 deletions(-) delete mode 100644 Documentation/devicetree/bindings/input/adc-keys.txt create mode 100644 Documentation/devicetree/bindings/input/adc-keys.yaml
Documentation/devicetree/bindings/input/adc-keys.txt deleted +0 -67
@@ -1,67 +0,0 @@ -ADC attached resistor ladder buttons ------------------------------------- - -Required properties: - - compatible: "adc-keys" - - io-channels: Phandle to an ADC channel - - io-channel-names = "buttons"; - - keyup-threshold-microvolt: Voltage above or equal to which all the keys are - considered up. - -Optional properties: - - poll-interval: Poll interval time in milliseconds - - autorepeat: Boolean, Enable auto repeat feature of Linux input - subsystem. - -Each button (key) is represented as a sub-node of "adc-keys": - -Required subnode-properties: - - label: Descriptive name of the key. - - linux,code: Keycode to emit. - - press-threshold-microvolt: voltage above or equal to which this key is - considered pressed. - -No two values of press-threshold-microvolt may be the same. -All values of press-threshold-microvolt must be less than -keyup-threshold-microvolt. - -Example: - -#include <dt-bindings/input/input.h> - - adc-keys { - compatible = "adc-keys"; - io-channels = <&lradc 0>; - io-channel-names = "buttons"; - keyup-threshold-microvolt = <2000000>; - - button-up { - label = "Volume Up"; - linux,code = <KEY_VOLUMEUP>; - press-threshold-microvolt = <1500000>; - }; - - button-down { - label = "Volume Down"; - linux,code = <KEY_VOLUMEDOWN>; - press-threshold-microvolt = <1000000>; - }; - - button-enter { - label = "Enter"; - linux,code = <KEY_ENTER>; - press-threshold-microvolt = <500000>; - }; - }; - -+--------------------------------+------------------------+ -| 2.000.000 <= value | no key pressed | -+--------------------------------+------------------------+ -| 1.500.000 <= value < 2.000.000 | KEY_VOLUMEUP pressed | -+--------------------------------+------------------------+ -| 1.000.000 <= value < 1.500.000 | KEY_VOLUMEDOWN pressed | -+--------------------------------+------------------------+ -| 500.000 <= value < 1.000.000 | KEY_ENTER pressed | -+--------------------------------+------------------------+ -| value < 500.000 | no key pressed | -+--------------------------------+------------------------+
Documentation/devicetree/bindings/input/adc-keys.yaml new file +103 -0
103 lines not on this page · raw message
Signature · 1 line
2.34.1
Re: [PATCH v2 5/5] dt-bindings: input: Convert adc-keys to DT schema
Quoted 130 lines · Rob Herring
Convert the adc-keys binding to DT schema format.
The old binding has 'label' as required, but it should never be required given it's just a human readable description.
Signed-off-by Rob Herring <[email protected]>---
v2:
- Drop Heinrich as a maintainer
- Use common linux,code definition
- Drop label as required--- .../devicetree/bindings/input/adc-keys.txt | 67 ------------ .../devicetree/bindings/input/adc-keys.yaml | 103 ++++++++++++++++++ 2 files changed, 103 insertions(+), 67 deletions(-)delete mode 100644
Documentation/devicetree/bindings/input/adc-keys.txtcreate mode 100644Documentation/devicetree/bindings/input/adc-keys.yamlDocumentation/devicetree/bindings/input/adc-keys.txt deleted +0
-67@@ -1,67 +0,0 @@ -ADC attached resistor ladder buttons ------------------------------------- - -Required properties: - - compatible: "adc-keys" - - io-channels: Phandle to an ADC channel - - io-channel-names = "buttons"; - - keyup-threshold-microvolt: Voltage above or equal to which all the keys are - considered up. - -Optional properties: - - poll-interval: Poll interval time in milliseconds - - autorepeat: Boolean, Enable auto repeat feature of Linux input - subsystem. - -Each button (key) is represented as a sub-node of "adc-keys": - -Required subnode-properties: - - label: Descriptive name of the key. - - linux,code: Keycode to emit. - - press-threshold-microvolt: voltage above or equal to which this key is - considered pressed. - -No two values of press-threshold-microvolt may be the same. -All values of press-threshold-microvolt must be less than -keyup-threshold-microvolt. - -Example: - -#include <dt-bindings/input/input.h> - - adc-keys { - compatible = "adc-keys"; - io-channels = <&lradc 0>; - io-channel-names = "buttons"; - keyup-threshold-microvolt = <2000000>; - - button-up { - label = "Volume Up"; - linux,code = <KEY_VOLUMEUP>; - press-threshold-microvolt = <1500000>; - }; - - button-down { - label = "Volume Down"; - linux,code = <KEY_VOLUMEDOWN>; - press-threshold-microvolt = <1000000>; - }; - - button-enter { - label = "Enter"; - linux,code = <KEY_ENTER>; - press-threshold-microvolt = <500000>; - }; - }; - -+--------------------------------+------------------------+ -| 2.000.000 <= value | no key pressed | -+--------------------------------+------------------------+ -| 1.500.000 <= value < 2.000.000 | KEY_VOLUMEUP pressed | -+--------------------------------+------------------------+ -| 1.000.000 <= value < 1.500.000 | KEY_VOLUMEDOWN pressed | -+--------------------------------+------------------------+ -| 500.000 <= value < 1.000.000 | KEY_ENTER pressed | -+--------------------------------+------------------------+ -| value < 500.000 | no key pressed | -+--------------------------------+------------------------+Documentation/devicetree/bindings/input/adc-keys.yaml new file +33
-0@@ -0,0 +1,103 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/adc-keys.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ADC attached resistor ladder buttons + +maintainers: + - Alexandre Belloni <[email protected]> + +allOf: + - $ref: input.yaml# + +properties: + compatible: + const: adc-keys + + io-channels: + maxItems: 1 + + io-channel-names: + const: buttons + + keyup-threshold-microvolt: + description: + Voltage above or equal to which all the keys are considered up. + + poll-interval: true + autorepeat: true + +patternProperties: + '^button-':
Documentation/devicetree/bindings/input/adc-keys.yaml line 43
Quoted 10 lines
Documentation/devicetree/bindings/input/adc-keys.yaml new file +10
-0+ type: object + $ref: input.yaml# + additionalProperties: false + description: + Each button (key) is represented as a sub-node. + + properties: + label: true + + linux,code: true
Can we provide a reference to a new type in Documentation/devicetree/bindings/input/input.yaml limiting the range to 0 - 0x2ff?
Best regards
Heinrich
Quoted 60 lines
Documentation/devicetree/bindings/input/adc-keys.yaml new file +60
-0+ + press-threshold-microvolt: + description: + Voltage above or equal to which this key is considered pressed. No + two values of press-threshold-microvolt may be the same. All values + of press-threshold-microvolt must be less than + keyup-threshold-microvolt. + + required: + - linux,code + - press-threshold-microvolt + +required: + - compatible + - io-channels + - io-channel-names + - keyup-threshold-microvolt + +additionalProperties: false + +examples: + - | + #include <dt-bindings/input/input.h> + // +--------------------------------+------------------------+ + // | 2.000.000 <= value | no key pressed | + // +--------------------------------+------------------------+ + // | 1.500.000 <= value < 2.000.000 | KEY_VOLUMEUP pressed | + // +--------------------------------+------------------------+ + // | 1.000.000 <= value < 1.500.000 | KEY_VOLUMEDOWN pressed | + // +--------------------------------+------------------------+ + // | 500.000 <= value < 1.000.000 | KEY_ENTER pressed | + // +--------------------------------+------------------------+ + // | value < 500.000 | no key pressed | + // +--------------------------------+------------------------+ + + adc-keys { + compatible = "adc-keys"; + io-channels = <&lradc 0>; + io-channel-names = "buttons"; + keyup-threshold-microvolt = <2000000>; + + button-up { + label = "Volume Up"; + linux,code = <KEY_VOLUMEUP>; + press-threshold-microvolt = <1500000>; + }; + + button-down { + label = "Volume Down"; + linux,code = <KEY_VOLUMEDOWN>; + press-threshold-microvolt = <1000000>; + }; + + button-enter { + label = "Enter"; + linux,code = <KEY_ENTER>; + press-threshold-microvolt = <500000>; + }; + }; +...
Rob Herring
maintainerQuoted 14 lines · Rob Herring
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
Quoted 6 lines
Rob Herring (5):
dt-bindings: input: Increase maximum keycode value to0x2ff
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
maintainerQuoted 15 lines · Rob Herring
Quoted 14 lines · Rob Herring
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
Quoted 8 lines
Quoted 6 lines
Rob Herring (5):
dt-bindings: input: Increase maximum keycode value to0x2ff
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 schemaDmitry, Any comments on this?
Sorry, applied the lot, thank you.
Signature · 1 line
Dmitry