gpio-keys.txt 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. Device-Tree bindings for input/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. Each button (key) is represented as a sub-node of "gpio-keys":
  8. Subnode properties:
  9. - gpios: OF device-tree gpio specification.
  10. - interrupts: the interrupt line for that input.
  11. - label: Descriptive name of the key.
  12. - linux,code: Keycode to emit.
  13. Note that either "interrupts" or "gpios" properties can be omitted, but not
  14. both at the same time. Specifying both properties is allowed.
  15. Optional subnode-properties:
  16. - linux,input-type: Specify event type this button/key generates.
  17. If not specified defaults to <1> == EV_KEY.
  18. - debounce-interval: Debouncing interval time in milliseconds.
  19. If not specified defaults to 5.
  20. - wakeup-source: Boolean, button can wake-up the system.
  21. (Legacy property supported: "gpio-key,wakeup")
  22. - linux,can-disable: Boolean, indicates that button is connected
  23. to dedicated (not shared) interrupt which can be disabled to
  24. suppress events from the button.
  25. Example nodes:
  26. gpio_keys {
  27. compatible = "gpio-keys";
  28. #address-cells = <1>;
  29. #size-cells = <0>;
  30. autorepeat;
  31. button@21 {
  32. label = "GPIO Key UP";
  33. linux,code = <103>;
  34. gpios = <&gpio1 0 1>;
  35. };
  36. button@22 {
  37. label = "GPIO Key DOWN";
  38. linux,code = <108>;
  39. interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
  40. };
  41. ...