mb/google/hatch/var/jinlon: Switch to using device pointers

This change replaces the device tree walks with device pointers by
adding alias for igpu (integrated graphics) device in the tree.

Change-Id: I6d159f6dc674f4a0b38ebb553c5141105405a883
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57745
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
This commit is contained in:
Furquan Shaikh 2021-09-16 20:54:21 -07:00
parent 56fd6419c3
commit ebf1482627
2 changed files with 4 additions and 9 deletions

View File

@ -4,7 +4,6 @@
#include <console/console.h>
#include <ec/google/chromeec/ec.h>
#include <device/device.h>
#include <drivers/gfx/generic/chip.h>
#include <variant/sku.h>
static bool eps_sku(uint32_t sku_id)
@ -21,23 +20,19 @@ static bool eps_sku(uint32_t sku_id)
static void check_for_eps(uint32_t sku_id)
{
struct device *gfx_dev;
struct device *gfx_dev = DEV_PTR(igpu);
if (eps_sku(sku_id)) {
printk(BIOS_INFO, "SKU ID %u has EPS\n", sku_id);
return;
}
gfx_dev = find_gfx_dev();
if (!gfx_dev) {
printk(BIOS_ERR,
"Error! No EPS dev, view-angle-management won't work\n");
printk(BIOS_ERR, "Error! No EPS dev, view-angle-management won't work\n");
return;
}
printk(BIOS_INFO,
"SKU ID %u doesn't have EPS, disabling...\n",
sku_id);
printk(BIOS_INFO, "SKU ID %u doesn't have EPS, disabling...\n", sku_id);
gfx_dev->enabled = 0;
}

View File

@ -69,7 +69,7 @@ chip soc/intel/cannonlake
register "ScsEmmcHs400Enabled" = "1"
device domain 0 on
device pci 02.0 on # Integrated Graphics Device
device pci 02.0 alias igpu on # Integrated Graphics Device
register "gfx" = "GMA_DEFAULT_PANEL(0)"
end
device pci 02.0 on