rotary-encoder.txt 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. Rotary encoder DT bindings
  2. Required properties:
  3. - gpios: a spec for two GPIOs to be used
  4. Optional properties:
  5. - linux,axis: the input subsystem axis to map to this rotary encoder.
  6. Defaults to 0 (ABS_X / REL_X)
  7. - rotary-encoder,steps: Number of steps in a full turnaround of the
  8. encoder. Only relevant for absolute axis. Defaults to 24 which is a
  9. typical value for such devices.
  10. - rotary-encoder,relative-axis: register a relative axis rather than an
  11. absolute one. Relative axis will only generate +1/-1 events on the input
  12. device, hence no steps need to be passed.
  13. - rotary-encoder,rollover: Automatic rollove when the rotary value becomes
  14. greater than the specified steps or smaller than 0. For absolute axis only.
  15. - rotary-encoder,half-period: Makes the driver work on half-period mode.
  16. See Documentation/input/rotary-encoder.txt for more information.
  17. Example:
  18. rotary@0 {
  19. compatible = "rotary-encoder";
  20. gpios = <&gpio 19 1>, <&gpio 20 0>; /* GPIO19 is inverted */
  21. linux,axis = <0>; /* REL_X */
  22. rotary-encoder,relative-axis;
  23. };
  24. rotary@1 {
  25. compatible = "rotary-encoder";
  26. gpios = <&gpio 21 0>, <&gpio 22 0>;
  27. linux,axis = <1>; /* ABS_Y */
  28. rotary-encoder,steps = <24>;
  29. rotary-encoder,rollover;
  30. };