About Kernel Documentation Linux Kernel Contact Linux Resources Linux Blog

Documentation / devicetree / bindings / input / rotary-encoder.txt




Custom Search

Based on kernel version 4.7.2. Page generated on 2016-08-22 22:41 EST.

1	Rotary encoder DT bindings
2	
3	Required properties:
4	- gpios: a spec for at least two GPIOs to be used, most significant first
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.
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
22	- wakeup-source: Boolean, rotary encoder can wake up the system.
23	
24	Deprecated properties:
25	- rotary-encoder,half-period: Makes the driver work on half-period mode.
26	  This property is deprecated. Instead, a 'steps-per-period ' value should
27	  be used, such as "rotary-encoder,steps-per-period = <2>".
28	
29	See Documentation/input/rotary-encoder.txt for more information.
30	
31	Example:
32	
33			rotary@0 {
34				compatible = "rotary-encoder";
35				gpios = <&gpio 19 1>, <&gpio 20 0>; /* GPIO19 is inverted */
36				linux,axis = <0>; /* REL_X */
37				rotary-encoder,relative-axis;
38			};
39	
40			rotary@1 {
41				compatible = "rotary-encoder";
42				gpios = <&gpio 21 0>, <&gpio 22 0>;
43				linux,axis = <1>; /* ABS_Y */
44				rotary-encoder,steps = <24>;
45				rotary-encoder,rollover;
46			};
Hide Line Numbers
About Kernel Documentation Linux Kernel Contact Linux Resources Linux Blog

Information is copyright its respective author. All material is available from the Linux Kernel Source distributed under a GPL License. This page is provided as a free service by mjmwired.net.