Skip to content

Commit 8826f8d

Browse files
shawajpopcornmix
authored andcommitted
add additional overrides to rotary-encoder overlay (#2334)
1 parent 057abf3 commit 8826f8d

File tree

2 files changed

+36
-5
lines changed

2 files changed

+36
-5
lines changed

arch/arm/boot/dts/overlays/README

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,6 +1331,29 @@ Params: rotary0_pin_a GPIO connected to rotary encoder channel A
13311331
(default 4).
13321332
rotary0_pin_b GPIO connected to rotary encoder channel B
13331333
(default 17).
1334+
relative_axis register a relative axis rather than an
1335+
absolute one. Relative axis will only
1336+
generate +1/-1 events on the input device,
1337+
hence no steps need to be passed.
1338+
linux_axis the input subsystem axis to map to this
1339+
rotary encoder. Defaults to 0 (ABS_X / REL_X)
1340+
rollover Automatic rollover when the rotary value
1341+
becomes greater than the specified steps or
1342+
smaller than 0. For absolute axis only.
1343+
steps-per-period Number of steps (stable states) per period.
1344+
The values have the following meaning:
1345+
1: Full-period mode (default)
1346+
2: Half-period mode
1347+
4: Quarter-period mode
1348+
steps Number of steps in a full turnaround of the
1349+
encoder. Only relevant for absolute axis.
1350+
Defaults to 24 which is a typical value for
1351+
such devices.
1352+
wakeup Boolean, rotary encoder can wake up the
1353+
system.
1354+
encoding String, the method used to encode steps.
1355+
Supported are "gray" (the default and more
1356+
common) and "binary".
13341357

13351358

13361359
Name: rpi-backlight

arch/arm/boot/dts/overlays/rotary-encoder-overlay.dts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,24 @@
2828
gpios = <&gpio 4 0>, <&gpio 17 0>;
2929
linux,axis = <0>; /* REL_X */
3030
rotary-encoder,encoding = "gray";
31-
rotary-encoder,relative-axis;
31+
rotary-encoder,steps = <24>; /* 24 default */
32+
rotary-encoder,steps-per-period = <1>; /* corresponds to full period mode. See README */
3233
};
3334
};
3435

3536
};
3637

3738
__overrides__ {
38-
rotary0_pin_a = <&rotary0>,"gpios:4",
39-
<&rotary0_pins>,"brcm,pins:0";
40-
rotary0_pin_b = <&rotary0>,"gpios:16",
41-
<&rotary0_pins>,"brcm,pins:4";
39+
rotary0_pin_a = <&rotary0>,"gpios:4",
40+
<&rotary0_pins>,"brcm,pins:0";
41+
rotary0_pin_b = <&rotary0>,"gpios:16",
42+
<&rotary0_pins>,"brcm,pins:4";
43+
relative_axis = <&rotary0>,"rotary-encoder,relative-axis?";
44+
linux_axis = <&rotary0>,"linux,axis:0";
45+
rollover = <&rotary0>,"rotary-encoder,rollover?";
46+
steps-per-period = <&rotary0>,"rotary-encoder,steps-per-period:0";
47+
steps = <&rotary0>,"rotary-encoder,steps:0";
48+
wakeup = <&rotary0>,"wakeup-source?";
49+
encoding = <&rotary0>,"rotary-encoder,encoding";
4250
};
4351
};

0 commit comments

Comments
 (0)