From e30d204d386f270b94bdeeb7797342031839c9c8 Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Mon, 23 Jan 2023 10:23:55 -0600 Subject: [PATCH] soc/intel/jasperlake: Hook up GMA ACPI brightness controls Add function needed to generate ACPI backlight control SSDT, along with Kconfig values for accessing the registers. Tested by adding gfx register on google/magpie. Backlight controls work on Windows 10 and Linux 6.1. Change-Id: Iaa9872cd590c3b1298667cc80354ed3efd91c6c8 Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/c/coreboot/+/74324 Tested-by: build bot (Jenkins) Reviewed-by: Sean Rhodes --- src/soc/intel/jasperlake/Kconfig | 12 ++++++++++++ src/soc/intel/jasperlake/Makefile.inc | 1 + src/soc/intel/jasperlake/chip.h | 4 ++++ src/soc/intel/jasperlake/graphics.c | 11 +++++++++++ 4 files changed, 28 insertions(+) create mode 100644 src/soc/intel/jasperlake/graphics.c diff --git a/src/soc/intel/jasperlake/Kconfig b/src/soc/intel/jasperlake/Kconfig index 338c46716c..660b24a79d 100644 --- a/src/soc/intel/jasperlake/Kconfig +++ b/src/soc/intel/jasperlake/Kconfig @@ -219,4 +219,16 @@ config SOC_INTEL_JASPERLAKE_DEBUG_CONSENT config PRERAM_CBMEM_CONSOLE_SIZE hex default 0x1400 + +config INTEL_GMA_BCLV_OFFSET + default 0xc8258 + +config INTEL_GMA_BCLV_WIDTH + default 32 + +config INTEL_GMA_BCLM_OFFSET + default 0xc8254 + +config INTEL_GMA_BCLM_WIDTH + default 32 endif diff --git a/src/soc/intel/jasperlake/Makefile.inc b/src/soc/intel/jasperlake/Makefile.inc index bd8dcd82d7..31ea8657ee 100644 --- a/src/soc/intel/jasperlake/Makefile.inc +++ b/src/soc/intel/jasperlake/Makefile.inc @@ -32,6 +32,7 @@ ramstage-y += espi.c ramstage-y += finalize.c ramstage-y += fsp_params.c ramstage-y += gpio.c +ramstage-y += graphics.c ramstage-y += lockdown.c ramstage-y += p2sb.c ramstage-y += pmc.c diff --git a/src/soc/intel/jasperlake/chip.h b/src/soc/intel/jasperlake/chip.h index 2839148764..3e47e00a63 100644 --- a/src/soc/intel/jasperlake/chip.h +++ b/src/soc/intel/jasperlake/chip.h @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -431,6 +432,9 @@ struct soc_intel_jasperlake_config { * false: Disabled (more wakes, higher power) */ bool cnvi_reduce_s0ix_pwr_usage; + + /* i915 struct for GMA backlight control */ + struct i915_gpu_controller_info gfx; }; typedef struct soc_intel_jasperlake_config config_t; diff --git a/src/soc/intel/jasperlake/graphics.c b/src/soc/intel/jasperlake/graphics.c new file mode 100644 index 0000000000..773f3c6de8 --- /dev/null +++ b/src/soc/intel/jasperlake/graphics.c @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include +#include + +const struct i915_gpu_controller_info * +intel_igd_get_controller_info(const struct device *const dev) +{ + const struct soc_intel_jasperlake_config *const chip = dev->chip_info; + return &chip->gfx; +}