Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8041

Device Tree • Re: Raspberry Pi 5 - rotary-encoder overlay not working

$
0
0
Hello Phil,

I flashed my RPi5 with the latest Debian Bookworm, and you are absolutely right, rotary-encover overlay is working fine.

May I know if you have an idea, on how to change the behaviour of the overlay, to use gpiochip14 (via i²c expander PCA9535)?

Do I need to specify the PCA9535 implemention here also, or is there an easy way to just use gpiochip14 instead of gpiochip0?

I've made a .dts file from the original rotary-encoder.dtbo overlay:

Code:

/dts-v1/;/ {        compatible = "brcm,bcm2835";        fragment@0 {                target = <0xffffffff>;                __overlay__ {                        rotary_pins@4 {                                brcm,pins = <0x04 0x11>;                                brcm,function = <0x00 0x00>;                                brcm,pull = <0x02 0x02>;                                phandle = <0x01>;                        };                };        };        fragment@1 {                target-path = "/";                __overlay__ {                        rotary@4 {                                compatible = "rotary-encoder";                                status = "okay";                                pinctrl-names = "default";                                pinctrl-0 = <0x01>;                                gpios = <0xffffffff 0x04 0x00 0xffffffff 0x11 0x00>;                                linux,axis = <0x00>;                                rotary-encoder,encoding = "gray";                                rotary-encoder,steps = <0x18>;                                rotary-encoder,steps-per-period = <0x01>;                                phandle = <0x02>;                        };                };        };        __overrides__ {                pin_a = <0x02 0x6770696f 0x733a3400 0x01 0x6272636d 0x2c70696e 0x733a3000 0x02 0x7265673a 0x30000000 0x17265 0x673a3000>;                pin_b = [00 00 00 02 67 70 69 6f 73 3a 31 36 00 00 00 00 01 62 72 63 6d 2c 70 69 6e 73 3a 34 00];                relative_axis = [00 00 00 02 72 6f 74 61 72 79 2d 65 6e 63 6f 64 65 72 2c 72 65 6c 61 74 69 76 65 2d 61 78 69 73 3f 00];                linux_axis = [00 00 00 02 6c 69 6e 75 78 2c 61 78 69 73 3a 30 00];                rollover = [00 00 00 02 72 6f 74 61 72 79 2d 65 6e 63 6f 64 65 72 2c 72 6f 6c 6c 6f 76 65 72 3f 00];                steps-per-period = [00 00 00 02 72 6f 74 61 72 79 2d 65 6e 63 6f 64 65 72 2c 73 74 65 70 73 2d 70 65 72 2d 70 65 72 69 6f 64 3a 30 00];                steps = [00 00 00 02 72 6f 74 61 72 79 2d 65 6e 63 6f 64 65 72 2c 73 74 65 70 73 3a 30 00];                wakeup = [00 00 00 02 77 61 6b 65 75 70 2d 73 6f 75 72 63 65 3f 00];                encoding = <0x02 0x726f7461 0x72792d65 0x6e636f64 0x65722c65 0x6e636f64 0x696e6700>;                rotary0_pin_a = <0x02 0x6770696f 0x733a3400 0x01 0x6272636d 0x2c70696e 0x733a3000>;                rotary0_pin_b = [00 00 00 02 67 70 69 6f 73 3a 31 36 00 00 00 00 01 62 72 63 6d 2c 70 69 6e 73 3a 34 00];        };        __symbols__ {                rotary_pins = "/fragment@0/__overlay__/rotary_pins@4";                rotary = "/fragment@1/__overlay__/rotary@4";        };        __fixups__ {                gpio = "/fragment@0:target:0\0/fragment@1/__overlay__/rotary@4:gpios:0\0/fragment@1/__overlay__/rotary@4:gpios:12";        };        __local_fixups__ {                fragment@1 {                        __overlay__ {                                rotary@4 {                                        pinctrl-0 = <0x00>;                                };                        };                };                __overrides__ {                        pin_a = <0x00 0x0c 0x1c 0x26>;                        pin_b = <0x00 0x0d>;                        relative_axis = <0x00>;                        linux_axis = <0x00>;                        rollover = <0x00>;                        steps-per-period = <0x00>;                        steps = <0x00>;                        wakeup = <0x00>;                        encoding = <0x00>;                        rotary0_pin_a = <0x00 0x0c>;                        rotary0_pin_b = <0x00 0x0d>;                };        };};
Thanks!

Statistics: Posted by mani9876 — Sat Aug 30, 2025 4:46 pm



Viewing all articles
Browse latest Browse all 8041

Trending Articles