[coreboot-gerrit] Patch set updated for coreboot: google/gale: Update fill_lb_gpios for new scheme
Stefan Reinauer (stefan.reinauer@coreboot.org)
gerrit at coreboot.org
Sat May 7 08:37:59 CEST 2016
Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14643
-gerrit
commit 100e7716fe344515b83a6b0976bef9271280b9a0
Author: David Hendricks <dhendrix at chromium.org>
Date: Tue Apr 12 19:04:26 2016 -0700
google/gale: Update fill_lb_gpios for new scheme
This updates fill_lb_gpios to follow the new scheme introduced
in CL:337176.
BUG=none
BRANCH=none
TEST=chromeos.c compiles successfully for gale
Change-Id: I395c64dfd6cc7e512b5a7d48d007057adbf5fc89
Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
Original-Commit-Id: 635d7fd71d91552bd7470faeb5637ba1a727f940
Original-Change-Id: I6f98325918b350645b9c19b71125bc12a54953ab
Original-Signed-off-by: David Hendricks <dhendrix at chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/338651
---
src/mainboard/google/gale/chromeos.c | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/src/mainboard/google/gale/chromeos.c b/src/mainboard/google/gale/chromeos.c
index 2640c6a..a379280 100644
--- a/src/mainboard/google/gale/chromeos.c
+++ b/src/mainboard/google/gale/chromeos.c
@@ -42,18 +42,14 @@ static int read_gpio(gpio_t gpio_num)
void fill_lb_gpios(struct lb_gpios *gpios)
{
- struct lb_gpio *gpio;
- const int GPIO_COUNT = 5;
-
- gpios->size = sizeof(*gpios) + (GPIO_COUNT * sizeof(struct lb_gpio));
- gpios->count = GPIO_COUNT;
-
- gpio = gpios->gpios;
- fill_lb_gpio(gpio++, DEV_SW, ACTIVE_LOW, "developer", read_gpio(DEV_SW));
- fill_lb_gpio(gpio++, REC_SW, ACTIVE_LOW, "recovery", read_gpio(REC_SW));
- fill_lb_gpio(gpio++, WP_SW, ACTIVE_LOW, "write protect", read_gpio(WP_SW));
- fill_lb_gpio(gpio++, -1, ACTIVE_LOW, "power", 1);
- fill_lb_gpio(gpio++, -1, ACTIVE_LOW, "lid", 0);
+ struct lb_gpio chromeos_gpios[] = {
+ {DEV_SW, ACTIVE_LOW, read_gpio(DEV_SW), "developer"},
+ {REC_SW, ACTIVE_LOW, read_gpio(REC_SW), "recovery"},
+ {WP_SW, ACTIVE_LOW, read_gpio(WP_SW), "write protect"},
+ {-1, ACTIVE_LOW, 1, "power"},
+ {-1, ACTIVE_LOW, 0, "lid"},
+ };
+ lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
}
int get_developer_mode_switch(void)
More information about the coreboot-gerrit
mailing list