soc/intel/alderlake: 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 system76/lemp11 and booting Windows.
Display settings has a brightness setting, and can change the brightness
level.

Change-Id: Ia29fb2adde1ec90ed8b0757a4d81e54240ee7575
Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
Tim Crawford
2022-11-01 11:42:28 -06:00
committed by Tim Crawford
parent a3b0137431
commit 3af06b307f
4 changed files with 26 additions and 0 deletions

View File

@@ -447,4 +447,16 @@ config BUILDING_WITH_DEBUG_FSP
help help
Set this option if debug build of FSP is used. Set this option if debug build of FSP is used.
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

@@ -31,6 +31,7 @@ ramstage-y += elog.c
ramstage-y += espi.c ramstage-y += espi.c
ramstage-y += finalize.c ramstage-y += finalize.c
ramstage-y += fsp_params.c ramstage-y += fsp_params.c
ramstage-y += graphics.c
ramstage-y += hsphy.c ramstage-y += hsphy.c
ramstage-y += lockdown.c ramstage-y += lockdown.c
ramstage-y += me.c ramstage-y += me.c

View File

@@ -4,6 +4,7 @@
#define _SOC_CHIP_H_ #define _SOC_CHIP_H_
#include <drivers/i2c/designware/dw_i2c.h> #include <drivers/i2c/designware/dw_i2c.h>
#include <drivers/intel/gma/gma.h>
#include <device/pci_ids.h> #include <device/pci_ids.h>
#include <intelblocks/cfg.h> #include <intelblocks/cfg.h>
#include <intelblocks/gpio.h> #include <intelblocks/gpio.h>
@@ -637,6 +638,9 @@ struct soc_intel_alderlake_config {
* Set this to 1 in order to disable Package C-state demotion. * Set this to 1 in order to disable Package C-state demotion.
*/ */
bool disable_package_c_state_demotion; bool disable_package_c_state_demotion;
/* i915 struct for GMA backlight control */
struct i915_gpu_controller_info gfx;
}; };
typedef struct soc_intel_alderlake_config config_t; typedef struct soc_intel_alderlake_config config_t;

View File

@@ -0,0 +1,9 @@
/* 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_alderlake_config *const chip = dev->chip_info;
return &chip->gfx;
}