From ffb9233a90fe8f29bb80292a75aed04778b0cda5 Mon Sep 17 00:00:00 2001 From: Che-Liang Chiou Date: Thu, 12 Jul 2012 12:40:03 +0800 Subject: [PATCH] crossystem: Let kernel worry about active_low stuff As kernel has adjusted the value of /sys/class/gpio/gpio${PORT}/ with active_low stuff before returning it to user, crossystem should not do another adjustment. Signed-off-by: Che-Liang Chiou BUG=chrome-os-partner:11297 TEST=On Snow, run crossystem and see wpsw_boot equals to wpsw_cur. Then invert /sys/class/gpio/gpio${PORT}/active_low value, and see wpsw_boot does not equal to wpsw_cur. Change-Id: I09fec89788bc4393775d5cf9763b8cebeb645ad4 Reviewed-on: https://gerrit.chromium.org/gerrit/27252 Commit-Ready: Che-Liang Chiou Tested-by: Che-Liang Chiou Reviewed-by: Bill Richardson --- host/arch/arm/lib/crossystem_arch.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/host/arch/arm/lib/crossystem_arch.c b/host/arch/arm/lib/crossystem_arch.c index 1e5ecbadfe..76be15885c 100644 --- a/host/arch/arm/lib/crossystem_arch.c +++ b/host/arch/arm/lib/crossystem_arch.c @@ -217,7 +217,7 @@ static int VbGetGpioStatus(unsigned gpio_number) { } static int VbGetVarGpio(const char* name) { - int polarity, gpio_num; + int gpio_num; void *pp = NULL; int *prop; size_t proplen = 0; @@ -236,7 +236,6 @@ static int VbGetVarGpio(const char* name) { } prop = pp; gpio_num = ntohl(prop[1]); - polarity = ntohl(prop[2]); /* * TODO(chrome-os-partner:11296): Use gpio_num == 0 to denote non-exist @@ -245,7 +244,7 @@ static int VbGetVarGpio(const char* name) { * properly. */ if (gpio_num) - ret = VbGetGpioStatus(gpio_num) ^ polarity ^ 1; + ret = VbGetGpioStatus(gpio_num); else ret = -1; out: