summaryrefslogtreecommitdiff
path: root/chip/lm4/gpio.c
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2013-08-28 10:28:08 +0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-09-04 05:45:52 +0000
commit2270f2bb03c2031bad455ba5f8179a9d99cc3999 (patch)
tree496418ddfebf04e0b010c9916bb7b6f0c0036d5d /chip/lm4/gpio.c
parentb99f91310721c50ea30fd204aa127928af37a41f (diff)
downloadchrome-ec-2270f2bb03c2031bad455ba5f8179a9d99cc3999.tar.gz
Fix a bug that GPIO cannot be set as input on stm32l
GPIO_INPUT is defined as 0, and any GPIO flag cannot be examined against GPIO_INPUT. Change GPIO_INPUT to non-zero value to avoid this. BUG=chrome-os-partner:22275 TEST=On Kirby, set a GPIO to output and pull it low, and then set it back to input. Check it can be pull high externally. TEST=Build all boards. TEST=Boot link and spring. BRANCH=None (unless this bug hits some other boards.) Change-Id: I84b9936c24af538ac59c36129fda27ca879bf9d1 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/167190 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'chip/lm4/gpio.c')
-rw-r--r--chip/lm4/gpio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/chip/lm4/gpio.c b/chip/lm4/gpio.c
index d3a060904d..25945ddc28 100644
--- a/chip/lm4/gpio.c
+++ b/chip/lm4/gpio.c
@@ -120,17 +120,17 @@ void gpio_set_flags_by_mask(uint32_t port, uint32_t mask, uint32_t flags)
}
/* Set up interrupt type */
- if (flags & GPIO_INT_LEVEL)
+ if (flags & (GPIO_INT_F_LOW | GPIO_INT_F_HIGH))
LM4_GPIO_IS(port) |= mask;
else
LM4_GPIO_IS(port) &= ~mask;
- if (flags & (GPIO_INT_RISING | GPIO_INT_HIGH))
+ if (flags & (GPIO_INT_F_RISING | GPIO_INT_F_HIGH))
LM4_GPIO_IEV(port) |= mask;
else
LM4_GPIO_IEV(port) &= ~mask;
- if (flags & GPIO_INT_BOTH)
+ if (flags & GPIO_INT_F_BOTH)
LM4_GPIO_IBE(port) |= mask;
else
LM4_GPIO_IBE(port) &= ~mask;