From 53c1717dc139e9256294c73b2e8a45dd8de08835 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Sat, 21 Mar 2020 18:47:24 +0100 Subject: drivers/intel/gma/acpi: Refine some cosmetics TEST=Booted ThinkPad X201s, backlight control still works. Change-Id: Ie3b00daedc9de05abef0cae9cea99dc7acf1ff62 Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/c/coreboot/+/39727 Reviewed-by: HAOUAS Elyes Reviewed-by: Patrick Georgi Reviewed-by: Matt DeVillier Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) --- src/drivers/intel/gma/acpi.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'src/drivers/intel/gma') diff --git a/src/drivers/intel/gma/acpi.c b/src/drivers/intel/gma/acpi.c index d3fb69dec8..ff4372f610 100644 --- a/src/drivers/intel/gma/acpi.c +++ b/src/drivers/intel/gma/acpi.c @@ -29,39 +29,45 @@ drivers_intel_gma_displays_ssdt_generate(const struct i915_gpu_controller_info * acpigen_write_scope("\\_SB.PCI0.GFX0"); /* - Method (_DOD, 0) - { + Method (_DOD, 0) + { Return (Package() { 0x5a5a5a5a, 0x5a5a5a5a, 0x5a5a5a5a }) - } + } */ acpigen_write_method("_DOD", 0); - acpigen_emit_byte(0xa4); /* ReturnOp. */ - acpigen_write_package(conf->ndid); + acpigen_emit_byte(RETURN_OP); + acpigen_write_package(conf->ndid); for (i = 0; i < conf->ndid; i++) { acpigen_write_dword (conf->did[i] | 0x80010000); } acpigen_pop_len(); /* End Package. */ + acpigen_pop_len(); /* End Method. */ for (i = 0; i < conf->ndid; i++) { char name[10]; char *ptr; int kind; + kind = (conf->did[i] >> 8) & 0xf; if (kind >= ARRAY_SIZE(names)) { kind = 0; } + strcpy(name, names[kind]); for (ptr = name; *ptr; ptr++); *ptr++ = counters[kind] + '0'; *ptr++ = '\0'; counters[kind]++; + + /* Device (LCD0) */ acpigen_write_device(name); + /* Name (_ADR, 0x0410) */ acpigen_write_name_dword("_ADR", conf->did[i] & 0xffff); @@ -74,7 +80,7 @@ drivers_intel_gma_displays_ssdt_generate(const struct i915_gpu_controller_info * } */ acpigen_write_method("_BCL", 0); - acpigen_emit_byte(0xa4); /* ReturnOp. */ + acpigen_emit_byte(RETURN_OP); acpigen_emit_namestring("^^XBCL"); acpigen_pop_len(); @@ -86,7 +92,7 @@ drivers_intel_gma_displays_ssdt_generate(const struct i915_gpu_controller_info * */ acpigen_write_method("_BCM", 1); acpigen_emit_namestring("^^XBCM"); - acpigen_emit_byte(0x68); /* Arg0Op. */ + acpigen_emit_byte(ARG0_OP); acpigen_pop_len(); /* @@ -96,7 +102,7 @@ drivers_intel_gma_displays_ssdt_generate(const struct i915_gpu_controller_info * } */ acpigen_write_method("_BQC", 0); - acpigen_emit_byte(0xa4); /* ReturnOp. */ + acpigen_emit_byte(RETURN_OP); acpigen_emit_namestring("^^XBQC"); acpigen_pop_len(); } @@ -136,8 +142,8 @@ drivers_intel_gma_displays_ssdt_generate(const struct i915_gpu_controller_info * acpigen_write_method("_DSS", 1); acpigen_pop_len(); - acpigen_pop_len(); + acpigen_pop_len(); /* End Device. */ } - acpigen_pop_len(); + acpigen_pop_len(); /* End Scope. */ } -- cgit v1.2.3