Refactor DGPU support code into drivers/system76/dgpu

Change-Id: Id29d6ade82b7212a3a68f6f3c27769e17d3fdcdc
This commit is contained in:
Jeremy Soller
2020-07-20 10:02:45 -06:00
parent 65600cdec6
commit 9e729e44a8
41 changed files with 200 additions and 1234 deletions

View 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);
}