My DT describes GPIO as following:
my-gpio = <&gpio4 20 0>;
In Linux kernel v5.10 I use
gpionum = of_get_named_gpio(np, "my-gpio", 0);
of_get_named_gpio_flags(np, "my-gpio", 0, &flag)
gpio_set_value(gpionum, flag);
to set the GPIO according to the active high/low setting in DT.
The of_get_named_gpio_flags() has been removed in Linux kernel v6.6. Can anyone advice how to do it the same way in Linux kernel v6.6?
gpiod_get()and similar APIs. This all written in the LInux kernel documentation and there are tons of drivers (examples) and patches in the Git history of Linux kernel on how to achieve that.struct device_node *npto have the GPIO number. Thegpiod_get()requiresstruct device *devthat I don't know how to do it.