浏览代码

mxc: first set GPIO level, then switch direction to output

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>
Guennadi Liakhovetski 16 年之前
父节点
当前提交
999981d943
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      arch/arm/plat-mxc/gpio.c

+ 1 - 1
arch/arm/plat-mxc/gpio.c

@@ -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;
 }