]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
gpio: mxc: prevent glitches when switching GPIO direction by setting the data registe...
authorLothar Waßmann <LW@KARO-electronics.de>
Thu, 22 Aug 2013 14:19:31 +0000 (16:19 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 22 Aug 2013 14:19:31 +0000 (16:19 +0200)
drivers/gpio/mxc_gpio.c

index 572f58595157e0b257b21feda6d573b304bd1456..65dc50df39442e83b24b6690458e3499acdf8ec5 100644 (file)
@@ -145,10 +145,10 @@ int gpio_direction_input(unsigned gpio)
 
 int gpio_direction_output(unsigned gpio, int value)
 {
-       int ret = mxc_gpio_direction(gpio, MXC_GPIO_DIRECTION_OUT);
+       int ret = gpio_set_value(gpio, value);
 
        if (ret < 0)
                return ret;
 
-       return gpio_set_value(gpio, value);
+       return mxc_gpio_direction(gpio, MXC_GPIO_DIRECTION_OUT);
 }