diff options
author | Marc Zyngier <maz@misterjones.org> | 2010-05-26 17:42:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-27 12:12:41 -0400 |
commit | a13c1868aa60ae7a2516b8d00ee8873dea587581 (patch) | |
tree | a90f714d48a3e076ef9093d5eb584e5655fbd5bd /drivers/gpio | |
parent | 5535cb681c38bda94af02ef4b043a25b52303e65 (diff) |
gpio: max732x: fix input configuration for open-drain pins
Fix a bug I noticed while hacking on the max732x driver for interrupt
support. According to the datasheets, open-drain pins have to be
configured as output-high (which in that case is actually high impedance)
to be used as input.
Signed-off-by: Marc Zyngier <maz@misterjones.org>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/max732x.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpio/max732x.c b/drivers/gpio/max732x.c index 26ff40110d9f..9cad60f9e962 100644 --- a/drivers/gpio/max732x.c +++ b/drivers/gpio/max732x.c | |||
@@ -232,6 +232,13 @@ static int max732x_gpio_direction_input(struct gpio_chip *gc, unsigned off) | |||
232 | return -EACCES; | 232 | return -EACCES; |
233 | } | 233 | } |
234 | 234 | ||
235 | /* | ||
236 | * Open-drain pins must be set to high impedance (which is | ||
237 | * equivalent to output-high) to be turned into an input. | ||
238 | */ | ||
239 | if ((mask & chip->dir_output)) | ||
240 | max732x_gpio_set_value(gc, off, 1); | ||
241 | |||
235 | return 0; | 242 | return 0; |
236 | } | 243 | } |
237 | 244 | ||