summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMichael Heimpold <mhei@heimpold.de>2013-11-03 22:59:26 +0100
committerStefano Babic <sbabic@denx.de>2013-11-13 10:09:09 +0100
commitac135f66992f65959fcf8245f2ea8a9109a4a913 (patch)
tree9d85b07e28dd6e6936bd5094ba1cd9de5ec17fb1 /drivers
parent85164e0c54f4beaee592f9d25d3f1ed61995bf0f (diff)
downloadu-boot-imx-ac135f66992f65959fcf8245f2ea8a9109a4a913.zip
u-boot-imx-ac135f66992f65959fcf8245f2ea8a9109a4a913.tar.gz
u-boot-imx-ac135f66992f65959fcf8245f2ea8a9109a4a913.tar.bz2
mxs_gpio: fix the handling in gpio_direction_output()
Setting the direction and an output value should be done by 1) set the desired output value, 2) switch to output. If this is done in the inverse order, there can be a glitch on the GPIO line. This patch fixes this by using the order as described above. Signed-off-by: Michael Heimpold <mhei@heimpold.de> Acked-by: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpio/mxs_gpio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpio/mxs_gpio.c b/drivers/gpio/mxs_gpio.c
index d9a7a3a..da0199b 100644
--- a/drivers/gpio/mxs_gpio.c
+++ b/drivers/gpio/mxs_gpio.c
@@ -95,10 +95,10 @@ int gpio_direction_output(unsigned gpio, int value)
struct mxs_register_32 *reg =
(struct mxs_register_32 *)(MXS_PINCTRL_BASE + offset);
- writel(1 << PAD_PIN(gpio), &reg->reg_set);
-
gpio_set_value(gpio, value);
+ writel(1 << PAD_PIN(gpio), &reg->reg_set);
+
return 0;
}