No problem at all. I wasn't expecting fast replies. It is a busy time of the year. I have a few days off over Christmas so I was doing some experiments. I am not in a hurry to complete this.Andy - sorry it's taken a while to get back to you.
I had an inkling that it may have been something like this. That I was describing the changes but not applying them. That makes sense.The reason your pinctrl declaration has no effect is that nothing is making any use of it - it's currently just a description of a possible configuration.
Thanks very much PhilE for spending the time to give such a detailed description.A DT node which is description of a hardware device along with a compatible string - let's call it a "device node" - can request that certain configuration changes have already happened before their probe() function is called. Replacing code with data is usually a good thing, and by moving setup code from each device driver into a common subsystem you save a lot of space. For pinctrl, the device node requires at least two properties - a series of "pinctrl-<n>" properties, each of which holds an array of references to pinctrl declarations such as yours, and an array of names for those configurations which is called "pinctrl-names". You usually find that there is only one configuration, named "default" and given the index of 0. Yours would look like this:Now you just need somewhere to stick it. Normally it would be the device node associated with your driver, but if you don't have one you may be able to enlist the help of another device node that doesn't require any pinctrl configuration of its own. A common donor/victims is the "leds" node, which on Pi 2 looks like this:Code:
pinctrl-0 = <&joystick_pins>;pinctrl-names = "default";
As you can see, there is no pinctrl declaration here, so you can extend your own overlay to add one:Code:
leds: leds {compatible = "gpio-leds";led_act: led-act {label = "ACT";default-state = "off";linux,default-trigger = "mmc0";gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;};led_pwr: led-pwr {label = "PWR";gpios = <&gpio 35 GPIO_ACTIVE_HIGH>;default-state = "off";linux,default-trigger = "input";};};
Does that help?Code:
fragment@1 {target = <&leds>;__overlay__ {pinctrl-0 = <&joystick_pins>;pinctrl-names = "default";};};
I will give that a try today. I have seen another overlay using the "leds" node, but had convinced myself that they where trying to change a led. It is all starting to make some sense now.
Thanks again for your help and have a Merry Christmas or Happy Holiday. I will let you know how I go.
Statistics: Posted by AndyD — Mon Dec 23, 2024 10:21 pm