Commit | Line | Data |
---|---|---|
80c99bcd DM |
1 | Rotary encoder DT bindings |
2 | ||
3 | Required properties: | |
7dde4e74 | 4 | - gpios: a spec for at least two GPIOs to be used, most significant first |
80c99bcd DM |
5 | |
6 | Optional 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. | |
3a341a4c EG |
17 | - rotary-encoder,steps-per-period: Number of steps (stable states) per period. |
18 | The values have the following meaning: | |
19 | 1: Full-period mode (default) | |
20 | 2: Half-period mode | |
21 | 4: Quarter-period mode | |
47ec6e5a | 22 | - wakeup-source: Boolean, rotary encoder can wake up the system. |
d205a218 UKK |
23 | - rotary-encoder,encoding: String, the method used to encode steps. |
24 | Supported are "gray" (the default and more common) and "binary". | |
80c99bcd | 25 | |
3a341a4c EG |
26 | Deprecated properties: |
27 | - rotary-encoder,half-period: Makes the driver work on half-period mode. | |
28 | This property is deprecated. Instead, a 'steps-per-period ' value should | |
29 | be used, such as "rotary-encoder,steps-per-period = <2>". | |
30 | ||
80c99bcd DM |
31 | See Documentation/input/rotary-encoder.txt for more information. |
32 | ||
33 | Example: | |
34 | ||
35 | rotary@0 { | |
36 | compatible = "rotary-encoder"; | |
37 | gpios = <&gpio 19 1>, <&gpio 20 0>; /* GPIO19 is inverted */ | |
38 | linux,axis = <0>; /* REL_X */ | |
d205a218 | 39 | rotary-encoder,encoding = "gray"; |
80c99bcd DM |
40 | rotary-encoder,relative-axis; |
41 | }; | |
42 | ||
43 | rotary@1 { | |
44 | compatible = "rotary-encoder"; | |
45 | gpios = <&gpio 21 0>, <&gpio 22 0>; | |
46 | linux,axis = <1>; /* ABS_Y */ | |
47 | rotary-encoder,steps = <24>; | |
d205a218 | 48 | rotary-encoder,encoding = "binary"; |
80c99bcd DM |
49 | rotary-encoder,rollover; |
50 | }; |