diff options
author | Michał Żygowski <michal.zygowski@3mdeb.com> | 2024-07-17 09:54:38 +0200 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2024-08-09 17:01:45 +0000 |
commit | 001f33cc03a724467138bb6a16aaa4496d3b4a44 (patch) | |
tree | dd81483f45af15e36eb55d74512b4f02ae69b781 /src/mainboard/dell | |
parent | ec049cb29dcc7fd9ba3f7e8fc21a7bf086a2891c (diff) |
superio/ite,mb: Switch to new ITE GPIO driver
Refactor mainboards' code to use the new GPIO driver.
TEST=Put Google Jecht to S3 sleep and check if the LED blinks.
Change-Id: I707ee090ee2551b4935847e12ade678d36ff9302
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Tested-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/83469
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'src/mainboard/dell')
-rw-r--r-- | src/mainboard/dell/xps_8300/smihandler.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/mainboard/dell/xps_8300/smihandler.c b/src/mainboard/dell/xps_8300/smihandler.c index f126468fa5..279295b822 100644 --- a/src/mainboard/dell/xps_8300/smihandler.c +++ b/src/mainboard/dell/xps_8300/smihandler.c @@ -4,6 +4,7 @@ #include <acpi/acpi.h> #include <cpu/x86/smm.h> #include <superio/ite/common/ite.h> +#include <superio/ite/common/ite_gpio.h> #include <superio/ite/it8772f/it8772f.h> #define GPIO_DEV PNP_DEV(0x2e, IT8772F_GPIO) @@ -14,16 +15,11 @@ void mainboard_smi_sleep(u8 slp_typ) case ACPI_S3: ite_set_3vsbsw(GPIO_DEV, true); ite_delay_pwrgd3(GPIO_DEV); - it8772f_gpio_led( - GPIO_DEV, - 2 /* set */, - 0x02 /* select */, - 0x01 /* polarity */, - 0x01 /* 1 = pullup */, - 0x01 /* output */, - 0x00 /* 1 = Simple IO function */, - SIO_GPIO_BLINK_GPIO22, - IT8772F_GPIO_BLINK_FREQUENCY_1_HZ); + ite_reg_write(GPIO_DEV, ITE_GPIO_REG_SELECT(1), 0x02); + ite_gpio_setup(GPIO_DEV, 22, ITE_GPIO_OUTPUT, ITE_GPIO_ALT_FN_MODE, + ITE_GPIO_POL_INVERT | ITE_GPIO_PULLUP_ENABLE); + ite_gpio_setup_led(GPIO_DEV, 22, ITE_GPIO_LED_1, ITE_LED_FREQ_1HZ, + ITE_LED_CONTROL_DEFAULT); break; default: break; |