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 <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74324
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Sean Rhodes <sean@starlabs.systems>
This commit is contained in:
Matt DeVillier 2023-01-23 10:23:55 -06:00 committed by Lean Sheng Tan
parent cd3545556e
commit e30d204d38
4 changed files with 28 additions and 0 deletions

View File

@ -219,4 +219,16 @@ config SOC_INTEL_JASPERLAKE_DEBUG_CONSENT
config PRERAM_CBMEM_CONSOLE_SIZE config PRERAM_CBMEM_CONSOLE_SIZE
hex hex
default 0x1400 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 endif

View File

@ -32,6 +32,7 @@ ramstage-y += espi.c
ramstage-y += finalize.c ramstage-y += finalize.c
ramstage-y += fsp_params.c ramstage-y += fsp_params.c
ramstage-y += gpio.c ramstage-y += gpio.c
ramstage-y += graphics.c
ramstage-y += lockdown.c ramstage-y += lockdown.c
ramstage-y += p2sb.c ramstage-y += p2sb.c
ramstage-y += pmc.c ramstage-y += pmc.c

View File

@ -5,6 +5,7 @@
#include <drivers/i2c/designware/dw_i2c.h> #include <drivers/i2c/designware/dw_i2c.h>
#include <gpio.h> #include <gpio.h>
#include <drivers/intel/gma/gma.h>
#include <intelblocks/cfg.h> #include <intelblocks/cfg.h>
#include <intelblocks/gspi.h> #include <intelblocks/gspi.h>
#include <intelblocks/pcie_rp.h> #include <intelblocks/pcie_rp.h>
@ -431,6 +432,9 @@ struct soc_intel_jasperlake_config {
* false: Disabled (more wakes, higher power) * false: Disabled (more wakes, higher power)
*/ */
bool cnvi_reduce_s0ix_pwr_usage; 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; typedef struct soc_intel_jasperlake_config config_t;

View File

@ -0,0 +1,11 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include <intelblocks/graphics.h>
#include <soc/ramstage.h>
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;
}