GPIOs: pull-up, pull-down configuration in device tree

custom_board

#1

Hi,
We use a 3rd party 820 SOM with a base board we designed.
I looked at this post, and added the following code to msm8996-pins.dtsi:

 &msmgpio {
 	pinmux {
 		  function = "gpio";
 		  pins = "gpio21"; // gp21 is pull-down by default.
 	
 	pinconf {
		  pins = "gpio21";
 		  bias-pull-up; //bias-disable;
 	};
    ...

but it doesn’t seem to do anything. Is the code correct?
It could be a HW issue so I just would like to determine if it is our board, or the device tree is not correct.
Thanks,
tamo2


#2

AFAIK, your pinmux/conf should be part of a msmgpio subnode (e.g. blsp1_uart1_default [1]) and then selected by a device as a pinctrl (e.g. serial@78af000 selects blsp1_uart1_default as default pinctrl [2]).

Also, ideally, board specific config should not go into the SoC dtsi (msm8996.dtsi) but in a dedicated dts (e.g. myboard-msm8996.dts).

[1] https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/qcom/msm8916-pins.dtsi#L16
[2] https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi#L204


#3

Loic,
Thanks for the info!
I worked around my original issue by setting the gpio in the kernel init code, so I longer need to change the device tree, but I would like to try your instructions in the future.
Thanks,
tamo2