The code to get the status of the GPIO port is as follows:
gpio_request(172, “GPIO172”);
gpio_direction_input(172);
printf("gpio GPIO 172 status: %2d ", gpio_get_value(172));
Whether the GPIO port is pulled high or low, the printed status is displayed as 0,
Please help to check whether the method to get the GPIO port status is correct?
gpio_request() has deprecated, please use dm_gpio_request() to request a GPIO manually.
you may see-also the header file, u-boot/include/asm-generic/gpio.h. thanks