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 <clchiou@chromium.org>

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 <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
This commit is contained in:
Che-Liang Chiou
2012-07-12 12:40:03 +08:00
committed by Gerrit
parent 7ec9f71717
commit ffb9233a90

View File

@@ -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: