| 1 |
|
| 2 |
|
| 3 |
#include <types.h> |
| 4 |
#include <acpi/acpi.h> |
| 5 |
#include <cpu/x86/smm.h> |
| 6 |
#include <superio/ite/common/ite.h> |
| 7 |
#include <superio/ite/common/ite_gpio.h> |
| 8 |
#include <superio/ite/it8772f/it8772f.h> |
| 9 |
|
| 10 |
#define GPIO_DEV PNP_DEV(0x2e, IT8772F_GPIO) |
| 11 |
|
| 12 |
void mainboard_smi_sleep(u8 slp_typ) |
| 13 |
{ |
| 14 |
switch (slp_typ) { |
| 15 |
case ACPI_S3: |
| 16 |
ite_set_3vsbsw(GPIO_DEV, true); |
| 17 |
ite_delay_pwrgd3(GPIO_DEV); |
| 18 |
ite_reg_write(GPIO_DEV, ITE_GPIO_REG_SELECT(1), 0x02); |
| 19 |
ite_gpio_setup(GPIO_DEV, 22, ITE_GPIO_OUTPUT, ITE_GPIO_ALT_FN_MODE, |
| 20 |
ITE_GPIO_POL_INVERT | ITE_GPIO_PULLUP_ENABLE); |
| 21 |
ite_gpio_setup_led(GPIO_DEV, 22, ITE_GPIO_LED_1, ITE_LED_FREQ_1HZ, |
| 22 |
ITE_LED_CONTROL_DEFAULT); |
| 23 |
break; |
| 24 |
default: |
| 25 |
break; |
| 26 |
} |
| 27 |
} |