| GPIO hog (CONFIG_GPIO_HOG) |
| All the GPIO hog are initialized in gpio_hog_probe_all() function called in |
| board_r.c just before board_late_init() but you can also acces directly to |
| the gpio with gpio_hog_lookup_name(). |
| Example, for the device tree: |
| compatible = "ti,tca6416"; |
| gpios = <6 GPIO_ACTIVE_LOW>; |
| line-name = "foo-bar-gpio"; |
| gpios = <7 GPIO_ACTIVE_LOW>; |
| You can than access the gpio in your board code with: |
| ret = gpio_hog_lookup_name("boot_rescue", &desc); |
| if (dm_gpio_get_value(desc) == 1) |
| printf("\nBooting into Rescue System\n"); |
| else if (dm_gpio_get_value(desc) == 0) |
| printf("\nBoot normal\n"); |