Refactor DGPU support code into drivers/system76/dgpu
Change-Id: Id29d6ade82b7212a3a68f6f3c27769e17d3fdcdc
This commit is contained in:
23
src/drivers/system76/dgpu/bootblock.c
Normal file
23
src/drivers/system76/dgpu/bootblock.c
Normal file
@@ -0,0 +1,23 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
//TODO: do not require this to be included in mainboard bootblock.c
|
||||
|
||||
#include <console/console.h>
|
||||
#include <delay.h>
|
||||
#include <gpio.h>
|
||||
|
||||
static void dgpu_power_enable(int onoff) {
|
||||
printk(BIOS_DEBUG, "system76: DGPU power %d\n", onoff);
|
||||
if (onoff) {
|
||||
gpio_set(DGPU_RST_N, 0);
|
||||
mdelay(4);
|
||||
gpio_set(DGPU_PWR_EN, 1);
|
||||
mdelay(4);
|
||||
gpio_set(DGPU_RST_N, 1);
|
||||
} else {
|
||||
gpio_set(DGPU_RST_N, 0);
|
||||
mdelay(4);
|
||||
gpio_set(DGPU_PWR_EN, 0);
|
||||
}
|
||||
mdelay(50);
|
||||
}
|
Reference in New Issue
Block a user