Skip to content

Commit 8ac14d2

Browse files
robherringdtor
authored andcommitted
dt-bindings: input: Centralize 'linux,code' definition
Multiple 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. Signed-off-by: Rob Herring <[email protected]> Acked-by: Samuel Holland <[email protected]> Acked-by: Jeff LaBundy <[email protected]> Acked-by: Artur Rojek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 7d321ab commit 8ac14d2

File tree

9 files changed

+27
-29
lines changed

9 files changed

+27
-29
lines changed

Documentation/devicetree/bindings/input/adc-joystick.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ additionalProperties: false
4545
patternProperties:
4646
"^axis@[0-9a-f]+$":
4747
type: object
48+
$ref: input.yaml#
4849
description: >
4950
Represents a joystick axis bound to the given ADC channel.
5051
For each entry in the io-channels list, one axis subnode with a matching
@@ -57,7 +58,6 @@ patternProperties:
5758
description: Index of an io-channels list entry bound to this axis.
5859

5960
linux,code:
60-
$ref: /schemas/types.yaml#/definitions/uint32
6161
description: EV_ABS specific event code generated by the axis.
6262

6363
abs-range:

Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,13 @@ properties:
4444
patternProperties:
4545
"^button-[0-9]+$":
4646
type: object
47+
$ref: input.yaml#
4748
properties:
4849
label:
4950
$ref: /schemas/types.yaml#/definitions/string
5051
description: Descriptive name of the key
5152

52-
linux,code:
53-
$ref: /schemas/types.yaml#/definitions/uint32
54-
description: Keycode to emit
53+
linux,code: true
5554

5655
channel:
5756
$ref: /schemas/types.yaml#/definitions/uint32

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ patternProperties:
417417
patternProperties:
418418
"^event-(prox|touch)$":
419419
type: object
420+
$ref: input.yaml#
420421
description:
421422
Represents a proximity or touch event reported by the channel.
422423

@@ -463,11 +464,7 @@ patternProperties:
463464
The IQS7222B does not feature channel-specific timeouts; the time-
464465
out specified for any one channel applies to all channels.
465466

466-
linux,code:
467-
$ref: /schemas/types.yaml#/definitions/uint32
468-
description:
469-
Numeric key or switch code associated with the event. Specify
470-
KEY_RESERVED (0) to opt out of event reporting.
467+
linux,code: true
471468

472469
linux,input-type:
473470
$ref: /schemas/types.yaml#/definitions/uint32

Documentation/devicetree/bindings/input/gpio-keys.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ patternProperties:
3434

3535
linux,code:
3636
description: Key / Axis code to emit.
37-
$ref: /schemas/types.yaml#/definitions/uint32
3837

3938
linux,input-type:
4039
description:

Documentation/devicetree/bindings/input/input.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ properties:
2323
minimum: 0
2424
maximum: 0x2ff
2525

26+
linux,code:
27+
description:
28+
Specifies a single numeric keycode value to be used for reporting
29+
button/switch events. Specify KEY_RESERVED (0) to opt out of event
30+
reporting.
31+
$ref: /schemas/types.yaml#/definitions/uint32
32+
maximum: 0x2ff
33+
2634
poll-interval:
2735
description: Poll interval time in milliseconds.
2836
$ref: /schemas/types.yaml#/definitions/uint32

Documentation/devicetree/bindings/input/iqs269a.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ patternProperties:
370370
patternProperties:
371371
"^event-prox(-alt)?$":
372372
type: object
373+
$ref: input.yaml#
373374
description:
374375
Represents a proximity event reported by the channel in response to
375376
a decrease in counts. Node names suffixed with '-alt' instead corre-
@@ -396,14 +397,13 @@ patternProperties:
396397
default: 10
397398
description: Specifies the threshold for the event.
398399

399-
linux,code:
400-
$ref: /schemas/types.yaml#/definitions/uint32
401-
description: Numeric key or switch code associated with the event.
400+
linux,code: true
402401

403402
additionalProperties: false
404403

405404
"^event-touch(-alt)?$":
406405
type: object
406+
$ref: input.yaml#
407407
description: Represents a touch event reported by the channel.
408408

409409
properties:
@@ -421,14 +421,13 @@ patternProperties:
421421
default: 4
422422
description: Specifies the hysteresis for the event.
423423

424-
linux,code:
425-
$ref: /schemas/types.yaml#/definitions/uint32
426-
description: Numeric key or switch code associated with the event.
424+
linux,code: true
427425

428426
additionalProperties: false
429427

430428
"^event-deep(-alt)?$":
431429
type: object
430+
$ref: input.yaml#
432431
description: Represents a deep-touch event reported by the channel.
433432

434433
properties:
@@ -446,9 +445,7 @@ patternProperties:
446445
default: 0
447446
description: Specifies the hysteresis for the event.
448447

449-
linux,code:
450-
$ref: /schemas/types.yaml#/definitions/uint32
451-
description: Numeric key or switch code associated with the event.
448+
linux,code: true
452449

453450
additionalProperties: false
454451

Documentation/devicetree/bindings/input/iqs626a.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ patternProperties:
449449
patternProperties:
450450
"^event-(prox|touch|deep)(-alt)?$":
451451
type: object
452+
$ref: input.yaml#
452453
description:
453454
Represents a proximity, touch or deep-touch event reported by the
454455
channel in response to a decrease in counts. Node names suffixed with
@@ -487,9 +488,7 @@ patternProperties:
487488
Specifies the hysteresis for the event (touch and deep-touch
488489
events only).
489490

490-
linux,code:
491-
$ref: /schemas/types.yaml#/definitions/uint32
492-
description: Numeric key or switch code associated with the event.
491+
linux,code: true
493492

494493
linux,input-type:
495494
$ref: /schemas/types.yaml#/definitions/uint32

Documentation/devicetree/bindings/input/iqs62x-keys.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,14 @@ properties:
8989
patternProperties:
9090
"^hall-switch-(north|south)$":
9191
type: object
92+
$ref: input.yaml#
9293
description:
9394
Represents north/south-field Hall-effect sensor touch or proximity
9495
events. Note that north/south-field orientation is reversed on the
9596
IQS620AXzCSR device due to its flip-chip package.
9697

9798
properties:
98-
linux,code:
99-
$ref: /schemas/types.yaml#/definitions/uint32
100-
description: Numeric switch code associated with the event.
99+
linux,code: true
101100

102101
azoteq,use-prox:
103102
$ref: /schemas/types.yaml#/definitions/flag

Documentation/devicetree/bindings/input/max77650-onkey.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ description: |
1616
The onkey controller is represented as a sub-node of the PMIC node on
1717
the device tree.
1818
19+
allOf:
20+
- $ref: input.yaml#
21+
1922
properties:
2023
compatible:
2124
const: maxim,max77650-onkey
2225

2326
linux,code:
24-
$ref: /schemas/types.yaml#/definitions/uint32
25-
description:
26-
The key-code to be reported when the key is pressed. Defaults
27-
to KEY_POWER.
27+
default: 116 # KEY_POWER
2828

2929
maxim,onkey-slide:
3030
$ref: /schemas/types.yaml#/definitions/flag

0 commit comments

Comments
 (0)