mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-30 18:41:11 +00:00
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>
This commit is contained in:
committed by
chrome-internal-fetch
parent
1717d598b2
commit
27a0968703
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user