]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
w1: w1-gpio: claim the gpio with correct initial flag
authorEugen Hristev <eugen.hristev@microchip.com>
Wed, 23 Jun 2021 13:11:58 +0000 (16:11 +0300)
committerEugen Hristev <eugen.hristev@microchip.com>
Tue, 6 Jul 2021 12:17:10 +0000 (15:17 +0300)
gpio_request_by_name should be called with proper flags.
The 0 value flag is invalid, and causes bad initialization of the gpio.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
drivers/w1/w1-gpio.c

index 3b0ead6f6dc15d6df2faafc8ecdd53c2d7850a1d..9346f810ce119402f5e872e77dce3d7f59971e60 100644 (file)
@@ -156,7 +156,7 @@ static int w1_gpio_of_to_plat(struct udevice *dev)
        struct w1_gpio_pdata *pdata = dev_get_plat(dev);
        int ret;
 
-       ret = gpio_request_by_name(dev, "gpios", 0, &pdata->gpio, 0);
+       ret = gpio_request_by_name(dev, "gpios", 0, &pdata->gpio, GPIOD_IS_IN);
        if (ret < 0)
                printf("Error claiming GPIO %d\n", ret);