Commit 5eb56522 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Dmitry Torokhov

dt-bindings: input: gpio-keys: enforce node names to match all properties

The gpio-keys DT schema matches all properties with a wide pattern and
applies specific schema to children.  This has drawback - all regular
properties are also matched and are silently ignored, even if they are
not described in schema.  Basically this allows any non-object property
to be present.

Enforce specific naming pattern for children (keys) to narrow the
pattern thus do not match other properties.  This will require all
children to be properly prefixed or suffixed (button, event, switch or
key).

Removal of "if:" within patternProperties causes drop of one indentation
level, but there are no other changes in the affected block.
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: default avatarRob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220705120356.94876-2-krzysztof.kozlowski@linaro.orgSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 538c6406
...@@ -16,86 +16,83 @@ properties: ...@@ -16,86 +16,83 @@ properties:
- gpio-keys-polled - gpio-keys-polled
patternProperties: patternProperties:
".*": "^(button|event|key|switch|(button|event|key|switch)-[a-z0-9-]+|[a-z0-9-]+-(button|event|key|switch))$":
if: $ref: input.yaml#
type: object
then: properties:
$ref: input.yaml# gpios:
maxItems: 1
properties:
gpios: interrupts:
maxItems: 1 maxItems: 1
interrupts: label:
maxItems: 1 description: Descriptive name of the key.
label: linux,code:
description: Descriptive name of the key. description: Key / Axis code to emit.
linux,code: linux,input-type:
description: Key / Axis code to emit. default: 1 # EV_KEY
linux,input-type: linux,input-value:
default: 1 # EV_KEY description: |
If linux,input-type is EV_ABS or EV_REL then this
linux,input-value: value is sent for events this button generates when pressed.
description: | EV_ABS/EV_REL axis will generate an event with a value of 0
If linux,input-type is EV_ABS or EV_REL then this when all buttons with linux,input-type == type and
value is sent for events this button generates when pressed. linux,code == axis are released. This value is interpreted
EV_ABS/EV_REL axis will generate an event with a value of 0 as a signed 32 bit value, e.g. to make a button generate a
when all buttons with linux,input-type == type and value of -1 use:
linux,code == axis are released. This value is interpreted
as a signed 32 bit value, e.g. to make a button generate a linux,input-value = <0xffffffff>; /* -1 */
value of -1 use:
$ref: /schemas/types.yaml#/definitions/uint32
linux,input-value = <0xffffffff>; /* -1 */
debounce-interval:
$ref: /schemas/types.yaml#/definitions/uint32 description:
Debouncing interval time in milliseconds. If not specified defaults to 5.
debounce-interval: $ref: /schemas/types.yaml#/definitions/uint32
description:
Debouncing interval time in milliseconds. If not specified defaults to 5. default: 5
$ref: /schemas/types.yaml#/definitions/uint32
wakeup-source:
default: 5 description: Button can wake-up the system.
wakeup-source: wakeup-event-action:
description: Button can wake-up the system. description: |
Specifies whether the key should wake the system when asserted, when
wakeup-event-action: deasserted, or both. This property is only valid for keys that wake up the
description: | system (e.g., when the "wakeup-source" property is also provided).
Specifies whether the key should wake the system when asserted, when
deasserted, or both. This property is only valid for keys that wake up the Supported values are defined in linux-event-codes.h:
system (e.g., when the "wakeup-source" property is also provided).
EV_ACT_ANY - both asserted and deasserted
Supported values are defined in linux-event-codes.h: EV_ACT_ASSERTED - asserted
EV_ACT_DEASSERTED - deasserted
EV_ACT_ANY - both asserted and deasserted $ref: /schemas/types.yaml#/definitions/uint32
EV_ACT_ASSERTED - asserted enum: [0, 1, 2]
EV_ACT_DEASSERTED - deasserted
$ref: /schemas/types.yaml#/definitions/uint32 linux,can-disable:
enum: [0, 1, 2] description:
Indicates that button is connected to dedicated (not shared) interrupt
linux,can-disable: which can be disabled to suppress events from the button.
description: type: boolean
Indicates that button is connected to dedicated (not shared) interrupt
which can be disabled to suppress events from the button. required:
type: boolean - linux,code
required: anyOf:
- linux,code - required:
- interrupts
anyOf: - required:
- required: - gpios
- interrupts
- required: dependencies:
- gpios wakeup-event-action: [ wakeup-source ]
linux,input-value: [ gpios ]
dependencies:
wakeup-event-action: [ wakeup-source ] unevaluatedProperties: false
linux,input-value: [ gpios ]
unevaluatedProperties: false
if: if:
properties: properties:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment