Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[deliverable/linux.git] / Documentation / devicetree / bindings / input / rotary-encoder.txt
CommitLineData
80c99bcd
DM
1Rotary encoder DT bindings
2
3Required properties:
7dde4e74 4- gpios: a spec for at least two GPIOs to be used, most significant first
80c99bcd
DM
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.
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
26Deprecated 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
31See Documentation/input/rotary-encoder.txt for more information.
32
33Example:
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 };
This page took 0.059053 seconds and 5 git commands to generate.