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