Add ACPI thermal interface
This commit is contained in:
parent
ee404071fb
commit
db6e85eb56
@ -118,9 +118,9 @@ void gpio_init() {
|
||||
// PWR_BTN#
|
||||
GPCRD5 = GPIO_OUT | GPIO_UP;
|
||||
// CPU_FANSEN
|
||||
GPCRD6 = GPIO_IN;
|
||||
GPCRD6 = GPIO_ALT;
|
||||
// VGA_FANSEN
|
||||
GPCRD7 = GPIO_IN;
|
||||
GPCRD7 = GPIO_ALT;
|
||||
// SMC_BAT_EC
|
||||
GPCRE0 = GPIO_ALT;
|
||||
// AC_PRESENT
|
||||
|
@ -1,10 +1,12 @@
|
||||
#include <board/acpi.h>
|
||||
#include <board/battery.h>
|
||||
#include <board/dgpu.h>
|
||||
#include <board/gpio.h>
|
||||
#include <board/kbled.h>
|
||||
#include <board/lid.h>
|
||||
#include <board/peci.h>
|
||||
#include <common/debug.h>
|
||||
#include <ec/pwm.h>
|
||||
|
||||
#ifndef HAVE_LED_AIRPLANE_N
|
||||
#define HAVE_LED_AIRPLANE_N 1
|
||||
@ -89,6 +91,8 @@ uint8_t acpi_read(uint8_t addr) {
|
||||
}
|
||||
break;
|
||||
|
||||
ACPI_8(0x07, peci_temp >> 6);
|
||||
|
||||
// Handle AC adapter and battery present
|
||||
case 0x10:
|
||||
if (!gpio_get(&ACIN_N)) {
|
||||
@ -122,6 +126,16 @@ uint8_t acpi_read(uint8_t addr) {
|
||||
|
||||
ACPI_8(0xCC, sci_extra);
|
||||
|
||||
ACPI_8(0xCE, DCR2);
|
||||
ACPI_8(0xD0, F1TMRR);
|
||||
ACPI_8(0xD1, F1TLRR);
|
||||
#if HAVE_DGPU
|
||||
ACPI_8(0xCD, dgpu_temp);
|
||||
ACPI_8(0xCF, DCR4);
|
||||
ACPI_8(0xD2, F2TMRR);
|
||||
ACPI_8(0xD3, F2TLRR);
|
||||
#endif // HAVE_DGPU
|
||||
|
||||
#if HAVE_LED_AIRPLANE_N
|
||||
// Airplane mode LED
|
||||
case 0xD9:
|
||||
|
@ -3,7 +3,6 @@
|
||||
#if HAVE_DGPU
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <board/gpio.h>
|
||||
#include <board/power.h>
|
||||
|
@ -1,10 +1,17 @@
|
||||
#ifndef _BOARD_DGPU_H
|
||||
#define _BOARD_DGPU_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef HAVE_DGPU
|
||||
#define HAVE_DGPU 0
|
||||
#endif
|
||||
|
||||
#if HAVE_DGPU
|
||||
extern int16_t dgpu_temp;
|
||||
extern uint8_t dgpu_duty;
|
||||
#endif // HAVE_DGPU
|
||||
|
||||
void dgpu_init(void);
|
||||
void dgpu_event(void);
|
||||
|
||||
|
@ -121,7 +121,7 @@ void gpio_init() {
|
||||
// PWR_BTN#
|
||||
GPCRD5 = GPIO_OUT;
|
||||
// CPU_FANSEN
|
||||
GPCRD6 = GPIO_IN;
|
||||
GPCRD6 = GPIO_ALT;
|
||||
// SUSWARN#
|
||||
GPCRD7 = GPIO_IN;
|
||||
// SWI#
|
||||
|
@ -121,7 +121,7 @@ void gpio_init() {
|
||||
// PWR_BTN#
|
||||
GPCRD5 = GPIO_OUT;
|
||||
// CPU_FANSEN
|
||||
GPCRD6 = GPIO_IN;
|
||||
GPCRD6 = GPIO_ALT;
|
||||
// SUSWARN#
|
||||
GPCRD7 = GPIO_IN;
|
||||
// SWI#
|
||||
|
@ -119,7 +119,7 @@ void gpio_init() {
|
||||
// PWR_BTN#
|
||||
GPCRD5 = GPIO_OUT;
|
||||
// CPU_FANSEN
|
||||
GPCRD6 = GPIO_IN;
|
||||
GPCRD6 = GPIO_ALT;
|
||||
// SUSWARN#
|
||||
GPCRD7 = GPIO_IN;
|
||||
// SMC_BAT
|
||||
|
Loading…
x
Reference in New Issue
Block a user