I just tested the following DT on a i.MX6 and Buildroot/Busybox, kernel v4.19.169. Here is the DT snippet that makes it work, BUT you can't use the pin anymore in user space. Note, by the way, the tricky syntax of the gpios =
property. That one drove me nuts !
&gpio7 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpio_en>;
sysstat@11 {
gpio-hog;
gpios = <11 GPIO_ACTIVE_HIGH>;
output-low;
line-name = "SYS_STAT";
};
};
&iomuxc {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpios>;
pinctrl_gpio_en: gpiostatgrp {
fsl,pins = <
MX6QDL_PAD_GPIO_16__GPIO7_IO11 0x130b0
>;
};
};
0x130b0 means : hysteresis, 100K pull-down, PUE=1 (pull-up enable), PKE=1 (keeper enabled). This is enough to drive the pin low, even if the sysstat@11
is missing. But the pin is still configured as an input.
Check pin config (note the [used] string) :
# gpioinfo 6 | grep "line 11"
line 11: unnamed "SYS_STAT" output active-high [used]
An alternate way would be to delete the sysstat@11
node to just do the pin muxing and pin configuration. I'm not sure if it's very smart, though.
Yet another option, as the pin is configured as a GPIO by default, is to not alter the DT at all and use a /etc/init.d script instead, with the command gpioset 6 11=0
. It works too, but it's not as fast as the DT option.
I think I'll go for the last option.