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

Source file repositories/reference/linux-study-clean/Documentation/devicetree/bindings/input/gpio-keys.yaml

File Facts

System
Linux kernel
Corpus path
Documentation/devicetree/bindings/input/gpio-keys.yaml
Extension
.yaml
Size
4606 bytes
Lines
182
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: configuration, schema, or hardware description
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

# SPDX-License-Identifier: GPL-2.0-only
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/gpio-keys.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: GPIO attached keys

maintainers:
  - Rob Herring <robh@kernel.org>

properties:
  compatible:
    enum:
      - gpio-keys
      - gpio-keys-polled

  autorepeat: true

  label:
    description: Name of entire device

  poll-interval: true

patternProperties:
  "^(button|event|key|switch|(button|event|key|switch)-[a-z0-9-]+|[a-z0-9-]+-(button|event|key|switch))$":
    $ref: input.yaml#

    properties:
      gpios:
        maxItems: 1

      interrupts:
        oneOf:
          - items:
              - description: Optional key interrupt or wakeup interrupt
          - items:
              - description: Key interrupt
              - description: Wakeup interrupt

      interrupt-names:
        description:
          Optional interrupt names, can be used to specify a separate dedicated
          wake-up interrupt in addition to the gpio irq
        oneOf:
          - items:
              - enum: [ irq, wakeup ]
          - items:
              - const: irq
              - const: wakeup

      label:
        description: Descriptive name of the key.

      linux,code:
        description: Key / Axis code to emit.

      linux,input-type:
        default: 1  # EV_KEY

      linux,input-value:
        description: |
          If linux,input-type is EV_ABS or EV_REL then this
          value is sent for events this button generates when pressed.
          EV_ABS/EV_REL axis will generate an event with a value of 0
          when all buttons with linux,input-type == type and
          linux,code == axis are released. This value is interpreted
          as a signed 32 bit value, e.g. to make a button generate a
          value of -1 use:

Annotation

Implementation Notes