From ebf14826279d814259e8daf31891bf58120a6623 Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Thu, 16 Sep 2021 20:54:21 -0700 Subject: [PATCH] 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/57745 Tested-by: build bot (Jenkins) Reviewed-by: Tim Wawrzynczak Reviewed-by: Karthik Ramasubramanian --- .../google/hatch/variants/jinlon/mainboard.c | 11 +++-------- .../google/hatch/variants/jinlon/overridetree.cb | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/mainboard/google/hatch/variants/jinlon/mainboard.c b/src/mainboard/google/hatch/variants/jinlon/mainboard.c index cf9344ee5a..d2e5b43bcd 100644 --- a/src/mainboard/google/hatch/variants/jinlon/mainboard.c +++ b/src/mainboard/google/hatch/variants/jinlon/mainboard.c @@ -4,7 +4,6 @@ #include #include #include -#include #include 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; } diff --git a/src/mainboard/google/hatch/variants/jinlon/overridetree.cb b/src/mainboard/google/hatch/variants/jinlon/overridetree.cb index 16402af784..b3887d4db1 100644 --- a/src/mainboard/google/hatch/variants/jinlon/overridetree.cb +++ b/src/mainboard/google/hatch/variants/jinlon/overridetree.cb @@ -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