Path: blob/master/Documentation/devicetree/bindings/input/gpio-keys.yaml
26308 views
# SPDX-License-Identifier: GPL-2.0-only1%YAML 1.22---3$id: http://devicetree.org/schemas/input/gpio-keys.yaml#4$schema: http://devicetree.org/meta-schemas/core.yaml#56title: GPIO attached keys78maintainers:9- Rob Herring <robh@kernel.org>1011properties:12compatible:13enum:14- gpio-keys15- gpio-keys-polled1617autorepeat: true1819label:20description: Name of entire device2122poll-interval: true2324patternProperties:25"^(button|event|key|switch|(button|event|key|switch)-[a-z0-9-]+|[a-z0-9-]+-(button|event|key|switch))$":26$ref: input.yaml#2728properties:29gpios:30maxItems: 13132interrupts:33oneOf:34- items:35- description: Optional key interrupt or wakeup interrupt36- items:37- description: Key interrupt38- description: Wakeup interrupt3940interrupt-names:41description:42Optional interrupt names, can be used to specify a separate dedicated43wake-up interrupt in addition to the gpio irq44oneOf:45- items:46- enum: [ irq, wakeup ]47- items:48- const: irq49- const: wakeup5051label:52description: Descriptive name of the key.5354linux,code:55description: Key / Axis code to emit.5657linux,input-type:58default: 1 # EV_KEY5960linux,input-value:61description: |62If linux,input-type is EV_ABS or EV_REL then this63value is sent for events this button generates when pressed.64EV_ABS/EV_REL axis will generate an event with a value of 065when all buttons with linux,input-type == type and66linux,code == axis are released. This value is interpreted67as a signed 32 bit value, e.g. to make a button generate a68value of -1 use:6970linux,input-value = <0xffffffff>; /* -1 */7172$ref: /schemas/types.yaml#/definitions/uint327374debounce-interval:75description:76Debouncing interval time in milliseconds. If not specified defaults to 5.77$ref: /schemas/types.yaml#/definitions/uint327879default: 58081wakeup-source:82description: Button can wake-up the system.8384wakeup-event-action:85description: |86Specifies whether the key should wake the system when asserted, when87deasserted, or both. This property is only valid for keys that wake up the88system (e.g., when the "wakeup-source" property is also provided).8990Supported values are defined in linux-event-codes.h:9192EV_ACT_ANY - both asserted and deasserted93EV_ACT_ASSERTED - asserted94EV_ACT_DEASSERTED - deasserted95$ref: /schemas/types.yaml#/definitions/uint3296enum: [0, 1, 2]9798linux,can-disable:99description:100Indicates that button is connected to dedicated (not shared) interrupt101which can be disabled to suppress events from the button.102type: boolean103104required:105- linux,code106107anyOf:108- required:109- interrupts110- required:111- interrupts-extended112- required:113- gpios114115allOf:116- if:117properties:118interrupts:119minItems: 2120required:121- interrupts122then:123properties:124interrupt-names:125minItems: 2126required:127- interrupt-names128129dependencies:130wakeup-event-action: [ wakeup-source ]131linux,input-value: [ gpios ]132133unevaluatedProperties: false134135allOf:136- $ref: input.yaml#137- if:138properties:139compatible:140const: gpio-keys-polled141then:142required:143- poll-interval144else:145properties:146poll-interval: false147148additionalProperties: false149150examples:151- |152#include <dt-bindings/interrupt-controller/irq.h>153154gpio-keys {155compatible = "gpio-keys";156autorepeat;157158key-up {159label = "GPIO Key UP";160linux,code = <103>;161gpios = <&gpio1 0 1>;162};163164key-down {165label = "GPIO Key DOWN";166linux,code = <108>;167interrupts = <1 IRQ_TYPE_EDGE_FALLING>;168};169170key-wakeup {171label = "GPIO Key WAKEUP";172linux,code = <143>;173interrupts-extended = <&intc 2 IRQ_TYPE_EDGE_FALLING>,174<&intc_wakeup 0 IRQ_TYPE_LEVEL_HIGH>;175interrupt-names = "irq", "wakeup";176wakeup-source;177};178};179180...181182183