From 001f33cc03a724467138bb6a16aaa4496d3b4a44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=BBygowski?= Date: Wed, 17 Jul 2024 09:54:38 +0200 Subject: superio/ite,mb: Switch to new ITE GPIO driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Tested-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/c/coreboot/+/83469 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- src/mainboard/dell/xps_8300/smihandler.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/mainboard/dell') 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 #include #include +#include #include #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; -- cgit v1.2.3