~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/devicetree/bindings/input/gpio-keys.yaml

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 # SPDX-License-Identifier: GPL-2.0-only
  2 %YAML 1.2
  3 ---
  4 $id: http://devicetree.org/schemas/input/gpio-keys.yaml#
  5 $schema: http://devicetree.org/meta-schemas/core.yaml#
  6 
  7 title: GPIO attached keys
  8 
  9 maintainers:
 10   - Rob Herring <robh@kernel.org>
 11 
 12 properties:
 13   compatible:
 14     enum:
 15       - gpio-keys
 16       - gpio-keys-polled
 17 
 18   autorepeat: true
 19 
 20   label:
 21     description: Name of entire device
 22 
 23   poll-interval: true
 24 
 25 patternProperties:
 26   "^(button|event|key|switch|(button|event|key|switch)-[a-z0-9-]+|[a-z0-9-]+-(button|event|key|switch))$":
 27     $ref: input.yaml#
 28 
 29     properties:
 30       gpios:
 31         maxItems: 1
 32 
 33       interrupts:
 34         oneOf:
 35           - items:
 36               - description: Optional key interrupt or wakeup interrupt
 37           - items:
 38               - description: Key interrupt
 39               - description: Wakeup interrupt
 40 
 41       interrupt-names:
 42         description:
 43           Optional interrupt names, can be used to specify a separate dedicated
 44           wake-up interrupt in addition to the gpio irq
 45         oneOf:
 46           - items:
 47               - enum: [ irq, wakeup ]
 48           - items:
 49               - const: irq
 50               - const: wakeup
 51 
 52       label:
 53         description: Descriptive name of the key.
 54 
 55       linux,code:
 56         description: Key / Axis code to emit.
 57 
 58       linux,input-type:
 59         default: 1  # EV_KEY
 60 
 61       linux,input-value:
 62         description: |
 63           If linux,input-type is EV_ABS or EV_REL then this
 64           value is sent for events this button generates when pressed.
 65           EV_ABS/EV_REL axis will generate an event with a value of 0
 66           when all buttons with linux,input-type == type and
 67           linux,code == axis are released. This value is interpreted
 68           as a signed 32 bit value, e.g. to make a button generate a
 69           value of -1 use:
 70 
 71           linux,input-value = <0xffffffff>; /* -1 */
 72 
 73         $ref: /schemas/types.yaml#/definitions/uint32
 74 
 75       debounce-interval:
 76         description:
 77           Debouncing interval time in milliseconds. If not specified defaults to 5.
 78         $ref: /schemas/types.yaml#/definitions/uint32
 79 
 80         default: 5
 81 
 82       wakeup-source:
 83         description: Button can wake-up the system.
 84 
 85       wakeup-event-action:
 86         description: |
 87           Specifies whether the key should wake the system when asserted, when
 88           deasserted, or both. This property is only valid for keys that wake up the
 89           system (e.g., when the "wakeup-source" property is also provided).
 90 
 91           Supported values are defined in linux-event-codes.h:
 92 
 93             EV_ACT_ANY        - both asserted and deasserted
 94             EV_ACT_ASSERTED   - asserted
 95             EV_ACT_DEASSERTED - deasserted
 96         $ref: /schemas/types.yaml#/definitions/uint32
 97         enum: [0, 1, 2]
 98 
 99       linux,can-disable:
100         description:
101           Indicates that button is connected to dedicated (not shared) interrupt
102           which can be disabled to suppress events from the button.
103         type: boolean
104 
105     required:
106       - linux,code
107 
108     anyOf:
109       - required:
110           - interrupts
111       - required:
112           - interrupts-extended
113       - required:
114           - gpios
115 
116     allOf:
117       - if:
118           properties:
119             interrupts:
120               minItems: 2
121           required:
122             - interrupts
123         then:
124           properties:
125             interrupt-names:
126               minItems: 2
127           required:
128             - interrupt-names
129 
130     dependencies:
131       wakeup-event-action: [ wakeup-source ]
132       linux,input-value: [ gpios ]
133 
134     unevaluatedProperties: false
135 
136 allOf:
137   - $ref: input.yaml#
138   - if:
139       properties:
140         compatible:
141           const: gpio-keys-polled
142     then:
143       required:
144         - poll-interval
145     else:
146       properties:
147         poll-interval: false
148 
149 additionalProperties: false
150 
151 examples:
152   - |
153     #include <dt-bindings/interrupt-controller/irq.h>
154 
155     gpio-keys {
156         compatible = "gpio-keys";
157         autorepeat;
158 
159         key-up {
160             label = "GPIO Key UP";
161             linux,code = <103>;
162             gpios = <&gpio1 0 1>;
163         };
164 
165         key-down {
166             label = "GPIO Key DOWN";
167             linux,code = <108>;
168             interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
169         };
170 
171         key-wakeup {
172             label = "GPIO Key WAKEUP";
173             linux,code = <143>;
174             interrupts-extended = <&intc 2 IRQ_TYPE_EDGE_FALLING>,
175                                   <&intc_wakeup 0 IRQ_TYPE_LEVEL_HIGH>;
176             interrupt-names = "irq", "wakeup";
177             wakeup-source;
178         };
179     };
180 
181 ...

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php