[coreboot-gerrit] Patch set updated for coreboot: 0f8b6d1 acpigen: Add and use acpigen_write_device.
Vladimir Serbinenko (phcoder@gmail.com)
gerrit at coreboot.org
Sat Nov 8 19:59:41 CET 2014
Vladimir Serbinenko (phcoder at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7348
-gerrit
commit 0f8b6d1b3c1e77d821e5325f340eb75afdcf5ab7
Author: Vladimir Serbinenko <phcoder at gmail.com>
Date: Wed Nov 5 21:29:45 2014 +0100
acpigen: Add and use acpigen_write_device.
Change-Id: I2c33fa403832eb1cfadfbf8d9adef5b63fb9cb24
Signed-off-by: Vladimir Serbinenko <phcoder at gmail.com>
---
src/arch/x86/boot/acpigen.c | 13 +++++++++++++
src/arch/x86/include/arch/acpigen.h | 1 +
src/drivers/lenovo/wacom.c | 12 ++----------
3 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/src/arch/x86/boot/acpigen.c b/src/arch/x86/boot/acpigen.c
index 0eee78a..f714d59 100644
--- a/src/arch/x86/boot/acpigen.c
+++ b/src/arch/x86/boot/acpigen.c
@@ -408,6 +408,19 @@ int acpigen_write_method(const char *name, int nargs)
return len;
}
+int acpigen_write_device(const char *name)
+{
+ int len;
+
+ /* method op */
+ len = acpigen_emit_byte(0x5b);
+ len += acpigen_emit_byte(0x82);
+ len += acpigen_write_len_f();
+ len += acpigen_emit_namestring(name);
+
+ return len;
+}
+
/*
* Generates a func with max supported P-states.
*/
diff --git a/src/arch/x86/include/arch/acpigen.h b/src/arch/x86/include/arch/acpigen.h
index babfb40..e07a0f5 100644
--- a/src/arch/x86/include/arch/acpigen.h
+++ b/src/arch/x86/include/arch/acpigen.h
@@ -44,6 +44,7 @@ int acpigen_write_name_qword(const char *name, uint64_t val);
int acpigen_write_name_byte(const char *name, uint8_t val);
int acpigen_write_scope(const char *name);
int acpigen_write_method(const char *name, int nargs);
+int acpigen_write_device(const char *name);
int acpigen_write_PPC(u8 nr);
int acpigen_write_PPC_NVS(void);
int acpigen_write_empty_PCT(void);
diff --git a/src/drivers/lenovo/wacom.c b/src/drivers/lenovo/wacom.c
index 2f73a6d..ce49535 100644
--- a/src/drivers/lenovo/wacom.c
+++ b/src/drivers/lenovo/wacom.c
@@ -98,11 +98,7 @@ drivers_lenovo_serial_ports_ssdt_generate(const char *scope,
acpigen_write_scope(scope);
if (drivers_lenovo_is_wacom_present()) {
- /* Device op. */
- acpigen_emit_byte(0x5b);
- acpigen_emit_byte(0x82);
- acpigen_write_len_f();
- acpigen_emit_namestring("DTR");
+ acpigen_write_device("DTR");
acpigen_write_name("_HID");
acpigen_emit_eisaid("WACF004");
@@ -125,11 +121,7 @@ drivers_lenovo_serial_ports_ssdt_generate(const char *scope,
}
if (have_dock_serial) {
- /* Device op. */
- acpigen_emit_byte(0x5b);
- acpigen_emit_byte(0x82);
- acpigen_write_len_f();
- acpigen_emit_namestring("COMA");
+ acpigen_write_device("COMA");
acpigen_write_name("_HID");
acpigen_emit_eisaid("PNP0501");
More information about the coreboot-gerrit
mailing list