0001 Rotary encoder DT bindings
0002
0003 Required properties:
0004 - gpios: a spec for at least two GPIOs to be used, most significant first
0005
0006 Optional properties:
0007 - linux,axis: the input subsystem axis to map to this rotary encoder.
0008 Defaults to 0 (ABS_X / REL_X)
0009 - rotary-encoder,steps: Number of steps in a full turnaround of the
0010 encoder. Only relevant for absolute axis. Defaults to 24 which is a
0011 typical value for such devices.
0012 - rotary-encoder,relative-axis: register a relative axis rather than an
0013 absolute one. Relative axis will only generate +1/-1 events on the input
0014 device, hence no steps need to be passed.
0015 - rotary-encoder,rollover: Automatic rollover when the rotary value becomes
0016 greater than the specified steps or smaller than 0. For absolute axis only.
0017 - rotary-encoder,steps-per-period: Number of steps (stable states) per period.
0018 The values have the following meaning:
0019 1: Full-period mode (default)
0020 2: Half-period mode
0021 4: Quarter-period mode
0022 - wakeup-source: Boolean, rotary encoder can wake up the system.
0023 - rotary-encoder,encoding: String, the method used to encode steps.
0024 Supported are "gray" (the default and more common) and "binary".
0025
0026 Deprecated properties:
0027 - rotary-encoder,half-period: Makes the driver work on half-period mode.
0028 This property is deprecated. Instead, a 'steps-per-period ' value should
0029 be used, such as "rotary-encoder,steps-per-period = <2>".
0030
0031 See Documentation/input/devices/rotary-encoder.rst for more information.
0032
0033 Example:
0034
0035 rotary@0 {
0036 compatible = "rotary-encoder";
0037 gpios = <&gpio 19 1>, <&gpio 20 0>; /* GPIO19 is inverted */
0038 linux,axis = <0>; /* REL_X */
0039 rotary-encoder,encoding = "gray";
0040 rotary-encoder,relative-axis;
0041 };
0042
0043 rotary@1 {
0044 compatible = "rotary-encoder";
0045 gpios = <&gpio 21 0>, <&gpio 22 0>;
0046 linux,axis = <1>; /* ABS_Y */
0047 rotary-encoder,steps = <24>;
0048 rotary-encoder,encoding = "binary";
0049 rotary-encoder,rollover;
0050 };