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

Advanced users • Re: Setting gpio pullup in kernel module that is using the GPIO API

$
0
0
As you can see, there is no pinctrl declaration here, so you can extend your own overlay to add one:

Code:

fragment@1 {target = <&leds>;__overlay__ {pinctrl-0 = <&joystick_pins>;pinctrl-names = "default";};};
Does that help?
Thanks again PhilE. I have tried adding the fragment@1 section to my overlay and that works for me. Very small steps at the moment, but in the right direction.

The dts file now:

Code:

/dts-v1/;/plugin/;/{compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";fragment@0 {target = <&gpio>;__overlay__ {joystick_pins: joystick_pins {brcm,pins = <4 5 6 12 13 16 17 20 21 23 26>;brcm,function = <0 0 0 0 0 0 0 0 0 0 0>;brcm,pull = <2 2 2 2 2 2 2 2 2 2 2>;};};};fragment@1 {target = <&leds>;__overlay__ {pinctrl-0 = <&joystick_pins>;pinctrl-names = "default";};};};
And the output of pinctrl for the GPIO pins specified.

Code:

% pinctrl get 4,5,6,12,13,16,17,20,21,23,26 4: ip    pu | hi // GPIO4 = input 5: ip    pu | hi // GPIO5 = input 6: ip    pu | hi // GPIO6 = input12: ip    pu | hi // GPIO12 = input13: ip    pu | hi // GPIO13 = input16: ip    pu | hi // GPIO16 = input17: ip    pu | hi // GPIO17 = input20: ip    pu | hi // GPIO20 = input21: ip    pu | hi // GPIO21 = input23: ip    pu | hi // GPIO23 = input26: ip    pu | hi // GPIO26 = input
Regards, Andy.

Statistics: Posted by AndyD — Tue Dec 24, 2024 1:03 am



Viewing all articles
Browse latest Browse all 4863

Trending Articles