Hello there. I'm trying to set up GPIO pins PD15 and PD16 on my OrangePi 3 LTS to work as input pins using device tree overlays. The overlay I have created is the following (for PD15 only):
/dts-v1/;
/plugin/;
/ {
compatible = "allwinner,sun50i-h6";
fragment@0 {
target = <&pio>;
__overlay__ {
my_pins:my_pins {
pins = "PD15";
function = "gpio_in";
default-state = "on";
};
};
};
fragment@1 {
target-path = "/";
__overlay__ {
my@0 {
compatible = "my-gpio";
pinctrl-names = "default";
pinctrl-0 = <&my_pins>;
gpios = <&pio 3 15 0>;
status = "okay";
};
};
};
};
Probably it is incorrect, because when I check the GPIO state using "gpio readall" command, I still get OFF state for the PD15 pin. Of course, I could change the pin mode using the "gpio" command itself (it does work, like "gpio mode 9 in" does set the PD15 pin mode to input), but I would prefer the overlays method.