linux/Documentation/devicetree/bindings/input/gpio-keys.txt
<<
>>
Prefs
   1Device-Tree bindings for input/keyboard/gpio_keys.c keyboard driver
   2
   3Required properties:
   4        - compatible = "gpio-keys";
   5
   6Optional properties:
   7        - autorepeat: Boolean, Enable auto repeat feature of Linux input
   8          subsystem.
   9        - label: String, name of the input device.
  10
  11Each button (key) is represented as a sub-node of "gpio-keys":
  12Subnode properties:
  13
  14        - gpios: OF device-tree gpio specification.
  15        - interrupts: the interrupt line for that input.
  16        - label: Descriptive name of the key.
  17        - linux,code: Keycode to emit.
  18
  19Note that either "interrupts" or "gpios" properties can be omitted, but not
  20both at the same time. Specifying both properties is allowed.
  21
  22Optional subnode-properties:
  23        - linux,input-type: Specify event type this button/key generates.
  24          If not specified defaults to <1> == EV_KEY.
  25        - debounce-interval: Debouncing interval time in milliseconds.
  26          If not specified defaults to 5.
  27        - wakeup-source: Boolean, button can wake-up the system.
  28                         (Legacy property supported: "gpio-key,wakeup")
  29        - wakeup-event-action: Specifies whether the key should wake the
  30          system when asserted, when deasserted, or both. This property is
  31          only valid for keys that wake up the system (e.g., when the
  32          "wakeup-source" property is also provided).
  33          Supported values are defined in linux-event-codes.h:
  34                EV_ACT_ASSERTED         - asserted
  35                EV_ACT_DEASSERTED       - deasserted
  36                EV_ACT_ANY              - both asserted and deasserted
  37        - linux,can-disable: Boolean, indicates that button is connected
  38          to dedicated (not shared) interrupt which can be disabled to
  39          suppress events from the button.
  40
  41Example nodes:
  42
  43        gpio-keys {
  44                        compatible = "gpio-keys";
  45                        autorepeat;
  46
  47                        up {
  48                                label = "GPIO Key UP";
  49                                linux,code = <103>;
  50                                gpios = <&gpio1 0 1>;
  51                        };
  52
  53                        down {
  54                                label = "GPIO Key DOWN";
  55                                linux,code = <108>;
  56                                interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
  57                        };
  58                        ...
  59