]> git.baikalelectronics.ru Git - kernel.git/commit
gpio-sch: set output level after configuration of direction
authorDaniel Krueger <daniel.krueger@systec-electronic.com>
Mon, 7 Apr 2014 12:20:32 +0000 (14:20 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 28 Apr 2014 19:35:08 +0000 (12:35 -0700)
commitdf0ffbe3e57f735044b8c0e5f772f0192cbf6c54
tree6776551c46d61207f6ab6a4a5f10abf9bfabc3a4
parent6da76ecd3877cd3fcb27d79f4f82f29fe233420e
gpio-sch: set output level after configuration of direction

According to the datasheet, writing to the level register has no effect
when GPIO is programmed as input. Actually the the level register is
read-only when configured as input. Thus presetting the output level
before switching to output is _NOT_ possible. Any writes are lost!
Hence we set the level after configuring the GPIO as output.
But we cannot prevent a short low pulse if direction is set to high and
an external  pull-up is connected.

Signed-off-by: Daniel Krueger <daniel.krueger@systec-electronic.com>
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-sch.c