mb/lenovo: Convert PNP device to generic device

Convert the hybrid graphics mux into a generic device and give it an
alias so that the driver can reference it by name.

Change-Id: Icbf6f298cab9e11acc9363daba68f9fbc613e79d
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/91440
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Patrick Rudolph 2026-02-26 14:44:39 +01:00 committed by Matt DeVillier
commit 7847a54eed
8 changed files with 10 additions and 13 deletions

View file

@ -3,10 +3,6 @@
#ifndef _LENOVO_HYBRID_GRAPHICS_CHIP_H_
#define _LENOVO_HYBRID_GRAPHICS_CHIP_H_
#define HYBRID_GRAPHICS_PORT 0xff
#define HYBRID_GRAPHICS_DEVICE 0xf
enum hybrid_graphics_req {
HYBRID_GRAPHICS_INTEGRATED = 0,
HYBRID_GRAPHICS_DISCRETE = 1,

View file

@ -5,11 +5,14 @@
#include <ec/lenovo/pmh7/pmh7.h>
#include <option.h>
#include <gpio.h>
#include <static.h>
#include <types.h>
#include "hybrid_graphics.h"
#include "chip.h"
WEAK_DEV_PTR(hg_mux);
/*
* Returns the hybrid graphics presence and user's card preferences.
*/
@ -19,9 +22,7 @@ void early_hybrid_graphics(bool *enable_igd, bool *enable_peg)
const struct device *dev;
enum hybrid_graphics_req mode;
/* TODO: Use generic device instead of dummy PNP device */
dev = dev_find_slot_pnp(HYBRID_GRAPHICS_PORT, HYBRID_GRAPHICS_DEVICE);
dev = DEV_PTR(hg_mux);
if (!dev || !dev->chip_info) {
printk(BIOS_ERR, "Hybrid graphics: ERROR\n");
*enable_igd = true;

View file

@ -4,7 +4,7 @@ chip northbridge/intel/gm45
device pci 1f.0 on # LPC bridge
subsystemid 0x17aa 0x20f5
chip drivers/lenovo/hybrid_graphics
device pnp ff.f on end # dummy
device generic 0 alias hg_mux on end # dummy
register "detect_gpio" = "21"

View file

@ -134,7 +134,7 @@ chip northbridge/intel/ironlake
register "evente_enable" = "0x2d"
end
chip drivers/lenovo/hybrid_graphics
device pnp ff.f on end # dummy
device generic 0 alias hg_mux on end # dummy
register "detect_gpio" = "21"

View file

@ -153,7 +153,7 @@ chip northbridge/intel/sandybridge
register "bdc_gpio_lvl" = "0"
end
chip drivers/lenovo/hybrid_graphics
device pnp ff.f on end # dummy
device generic 0 alias hg_mux on end # dummy
register "detect_gpio" = "21"

View file

@ -145,7 +145,7 @@ chip northbridge/intel/sandybridge
register "bdc_gpio_lvl" = "0"
end
chip drivers/lenovo/hybrid_graphics
device pnp ff.f on end # dummy
device generic 0 alias hg_mux on end # dummy
register "detect_gpio" = "21"

View file

@ -141,7 +141,7 @@ chip northbridge/intel/sandybridge
register "bdc_gpio_lvl" = "0"
end
chip drivers/lenovo/hybrid_graphics
device pnp ff.f on end # dummy
device generic 0 alias hg_mux on end # dummy
register "detect_gpio" = "21"

View file

@ -121,7 +121,7 @@ chip northbridge/intel/sandybridge
register "bdc_gpio_lvl" = "0"
end
chip drivers/lenovo/hybrid_graphics
device pnp ff.f on end # dummy
device generic 0 alias hg_mux on end # dummy
register "detect_gpio" = "21"