diff options
author | Nico Huber <nico.h@gmx.de> | 2020-03-21 18:47:24 +0100 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-03-24 16:43:30 +0000 |
commit | 53c1717dc139e9256294c73b2e8a45dd8de08835 (patch) | |
tree | 0089313b92913e3455d5c708f497c4713aeff94c /src/drivers/intel/gma | |
parent | e98f6af77bbd2060f01833559034f28b8b88abfe (diff) | |
download | coreboot-53c1717dc139e9256294c73b2e8a45dd8de08835.tar.xz |
drivers/intel/gma/acpi: Refine some cosmetics
TEST=Booted ThinkPad X201s, backlight control still works.
Change-Id: Ie3b00daedc9de05abef0cae9cea99dc7acf1ff62
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/39727
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/drivers/intel/gma')
-rw-r--r-- | src/drivers/intel/gma/acpi.c | 26 |
1 files changed, 16 insertions, 10 deletions
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. */ } |