How to add a GPIO device to the DeviceTree and set it's default pinstate


#1

Hi,

I’m attempting to add a few GPIO devices to my device tree so that I can set the default pin output to initialize a few components that I’m using on boot.

I’m sure that I’m missing something here but I’m not sure what it is. The pins are to be configured as plain old gpio pins, that I want to set the pinstate on (e.g. boot with pin high/low) this example I want to boot it low so that the led does not illuminate on boot. Other examples I can post upon request, that so far don’t do a whole lot.

So far I haven’t seen much results from the following:
—msm8016-sbc.dtsi—
led_red {
pinctrl-names = “default”;`
pinctrl-0 = <&led_red>;
compatible = “qcom,msm8916-pinctrl”;
label = “led-red”;
gpios = <&msmgpio 21 GPIO_ACTIVE_HIGH>;
status = “okay”;
};

—msm8016-sbc-soc-pins.dtsi—
led_red: led_red {
pinmux {
function = “gpio”;
pins = “gpio21”;
};
pinconf {
pins = “gpio21”;
function = “gpio”;
output-low;
};
};