]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
mxc: first set GPIO level, then switch direction to output
authorGuennadi Liakhovetski <lg@denx.de>
Thu, 12 Feb 2009 13:27:22 +0000 (14:27 +0100)
committerSascha Hauer <s.hauer@pengutronix.de>
Fri, 13 Mar 2009 09:34:19 +0000 (10:34 +0100)
Make sure not to create spurious pulses on GPIOs, when configuring them as
output: first set required level, then switch direction.

Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
arch/arm/plat-mxc/gpio.c

index ccbd94adc668154ff58dbe19c90f8462d2ce6cca..c6483bad8a2652c3fbfc098ced8ba809e7d4ccba 100644 (file)
@@ -200,8 +200,8 @@ static int mxc_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
 static int mxc_gpio_direction_output(struct gpio_chip *chip,
                                     unsigned offset, int value)
 {
-       _set_gpio_direction(chip, offset, 1);
        mxc_gpio_set(chip, offset, value);
+       _set_gpio_direction(chip, offset, 1);
        return 0;
 }