[coreboot-gerrit] Change in ...coreboot[master]: vendorcode/google/chromeos: Get ACPI pin from GPIO library

Duncan Laurie (Code Review) gerrit at coreboot.org
Mon Dec 10 20:35:04 CET 2018


Duncan Laurie has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30132


Change subject: vendorcode/google/chromeos: Get ACPI pin from GPIO library
......................................................................

vendorcode/google/chromeos: Get ACPI pin from GPIO library

If the generic GPIO library is enabled the code that generates the
GPIO table in ACPI should attempt to get the GPIO pin value from
the gpio_acpi_pin() function.

BUG=b:120686247
TEST=Tested on Sarien board to ensure that GPIO pin exported by
Chrome OS for the Write Protect signal is correct.

Change-Id: I267694b576009f79bacac6eda5f32bbf51742d78
Signed-off-by: Duncan Laurie <dlaurie at google.com>
---
M src/vendorcode/google/chromeos/acpi.c
1 file changed, 6 insertions(+), 1 deletion(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/32/30132/1

diff --git a/src/vendorcode/google/chromeos/acpi.c b/src/vendorcode/google/chromeos/acpi.c
index 6605809..a1e0b6e 100644
--- a/src/vendorcode/google/chromeos/acpi.c
+++ b/src/vendorcode/google/chromeos/acpi.c
@@ -14,6 +14,7 @@
  */
 
 #include <arch/acpigen.h>
+#include <gpio.h>
 #include "chromeos.h"
 
 void chromeos_acpi_gpio_generate(const struct cros_gpio *gpios, size_t num)
@@ -28,7 +29,11 @@
 		acpigen_write_package(4);
 		acpigen_write_integer(gpios[i].type);
 		acpigen_write_integer(gpios[i].polarity);
-		acpigen_write_integer(gpios[i].gpio_num);
+		/* Get ACPI pin from GPIO library if available */
+		if (IS_ENABLED(CONFIG_GENERIC_GPIO_LIB))
+			acpigen_write_integer(gpio_acpi_pin(gpios[i].gpio_num));
+		else
+			acpigen_write_integer(gpios[i].gpio_num);
 		acpigen_write_string(gpios[i].device);
 		acpigen_pop_len();
 	}

-- 
To view, visit https://review.coreboot.org/c/coreboot/+/30132
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I267694b576009f79bacac6eda5f32bbf51742d78
Gerrit-Change-Number: 30132
Gerrit-PatchSet: 1
Gerrit-Owner: Duncan Laurie <dlaurie at chromium.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181210/a20971af/attachment-0001.html>


More information about the coreboot-gerrit mailing list