003af7d932c5c5a7d60069a3e666336a5517e7de
[openwrt/staging/pepe2k.git] /
1 From 8cf805e57fa5cf4c872883968def037cd7c903cc Mon Sep 17 00:00:00 2001
2 From: Aaron Shaw <shawaj@gmail.com>
3 Date: Fri, 5 Jan 2018 15:08:37 +0000
4 Subject: [PATCH 158/454] add additional overrides to rotary-encoder overlay
5 (#2334)
6
7 ---
8 arch/arm/boot/dts/overlays/README | 23 +++++++++++++++++++
9 .../dts/overlays/rotary-encoder-overlay.dts | 18 +++++++++++----
10 2 files changed, 36 insertions(+), 5 deletions(-)
11
12 --- a/arch/arm/boot/dts/overlays/README
13 +++ b/arch/arm/boot/dts/overlays/README
14 @@ -1331,6 +1331,29 @@ Params: rotary0_pin_a GPIO con
15 (default 4).
16 rotary0_pin_b GPIO connected to rotary encoder channel B
17 (default 17).
18 + relative_axis register a relative axis rather than an
19 + absolute one. Relative axis will only
20 + generate +1/-1 events on the input device,
21 + hence no steps need to be passed.
22 + linux_axis the input subsystem axis to map to this
23 + rotary encoder. Defaults to 0 (ABS_X / REL_X)
24 + rollover Automatic rollover when the rotary value
25 + becomes greater than the specified steps or
26 + smaller than 0. For absolute axis only.
27 + steps-per-period Number of steps (stable states) per period.
28 + The values have the following meaning:
29 + 1: Full-period mode (default)
30 + 2: Half-period mode
31 + 4: Quarter-period mode
32 + steps Number of steps in a full turnaround of the
33 + encoder. Only relevant for absolute axis.
34 + Defaults to 24 which is a typical value for
35 + such devices.
36 + wakeup Boolean, rotary encoder can wake up the
37 + system.
38 + encoding String, the method used to encode steps.
39 + Supported are "gray" (the default and more
40 + common) and "binary".
41
42
43 Name: rpi-backlight
44 --- a/arch/arm/boot/dts/overlays/rotary-encoder-overlay.dts
45 +++ b/arch/arm/boot/dts/overlays/rotary-encoder-overlay.dts
46 @@ -28,16 +28,24 @@
47 gpios = <&gpio 4 0>, <&gpio 17 0>;
48 linux,axis = <0>; /* REL_X */
49 rotary-encoder,encoding = "gray";
50 - rotary-encoder,relative-axis;
51 + rotary-encoder,steps = <24>; /* 24 default */
52 + rotary-encoder,steps-per-period = <1>; /* corresponds to full period mode. See README */
53 };
54 };
55
56 };
57
58 __overrides__ {
59 - rotary0_pin_a = <&rotary0>,"gpios:4",
60 - <&rotary0_pins>,"brcm,pins:0";
61 - rotary0_pin_b = <&rotary0>,"gpios:16",
62 - <&rotary0_pins>,"brcm,pins:4";
63 + rotary0_pin_a = <&rotary0>,"gpios:4",
64 + <&rotary0_pins>,"brcm,pins:0";
65 + rotary0_pin_b = <&rotary0>,"gpios:16",
66 + <&rotary0_pins>,"brcm,pins:4";
67 + relative_axis = <&rotary0>,"rotary-encoder,relative-axis?";
68 + linux_axis = <&rotary0>,"linux,axis:0";
69 + rollover = <&rotary0>,"rotary-encoder,rollover?";
70 + steps-per-period = <&rotary0>,"rotary-encoder,steps-per-period:0";
71 + steps = <&rotary0>,"rotary-encoder,steps:0";
72 + wakeup = <&rotary0>,"wakeup-source?";
73 + encoding = <&rotary0>,"rotary-encoder,encoding";
74 };
75 };