gpio-keys.txt 1.8 KB

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