diff options
author | Vic Yang <victoryang@chromium.org> | 2014-07-08 16:19:55 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-07-09 03:29:40 +0000 |
commit | 27a096870398748861537ff00bc4bdfd05685276 (patch) | |
tree | 4c6716f0b8fed1a8f6ffebadde5c66724318c09a /chip | |
parent | 1717d598b2e914af641b728365eecdf128150d9e (diff) | |
download | chrome-ec-27a096870398748861537ff00bc4bdfd05685276.tar.gz |
mec1322: reports actual GPIO level for output pins
For open-drain output pins, this would allow us to easily check pin
state without changing it to input.
BUG=chrome-os-partner:26483
TEST=Toggle output level and read it back.
BRANCH=None
Change-Id: Ia7ceb7a221a8f0cfec9b19a5c5baae4d5441150f
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/207060
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r-- | chip/mec1322/gpio.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/chip/mec1322/gpio.c b/chip/mec1322/gpio.c index 73b584a943..1be969e60c 100644 --- a/chip/mec1322/gpio.c +++ b/chip/mec1322/gpio.c @@ -54,10 +54,7 @@ test_mockable int gpio_get_level(enum gpio_signal signal) i = 31 - __builtin_clz(mask); val = MEC1322_GPIO_CTL(gpio_list[signal].port, i); - if (val & (1 << 9)) /* Output */ - return (val & (1 << 16)) ? 1 : 0; - else - return (val & (1 << 24)) ? 1 : 0; + return (val & (1 << 24)) ? 1 : 0; } void gpio_set_level(enum gpio_signal signal, int value) |