From 01344bce1a6052448564b83c9e1b8f0f16a8adfe Mon Sep 17 00:00:00 2001 From: Jianeng Ceng Date: Tue, 9 Apr 2024 21:20:20 +0800 Subject: acpi: Make acpi_device_write_dsd_gpio() public Make sure it can be used for other driver. At present, i2c_generic_write_gpio() is not suitable for being called by other drivers, so delete it, add acpi_device_write_dsd_gpio() to replace it, and make it public. BUG=None TEST= Build BIOS FW pass and it can be use for other driver. Change-Id: Ifb2e60690711b39743afd455c6776c5ace863378 Signed-off-by: Jianeng Ceng Reviewed-on: https://review.coreboot.org/c/coreboot/+/81788 Tested-by: build bot (Jenkins) Reviewed-by: Eric Lai Reviewed-by: Kapil Porwal Reviewed-by: Subrata Banik --- src/acpi/device.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/acpi') diff --git a/src/acpi/device.c b/src/acpi/device.c index 95316b0861..091a0865a1 100644 --- a/src/acpi/device.c +++ b/src/acpi/device.c @@ -39,6 +39,23 @@ #define ACPI_DSD_STORAGE_D3_UUID "5025030F-842F-4AB4-A561-99A5189762D0" #define ACPI_DSD_STORAGE_D3_NAME "StorageD3Enable" +/* Write GPIO descriptor of DSD property */ +int acpi_device_write_dsd_gpio(struct acpi_gpio *gpio, int *curr_index) +{ + int ret = -1; + + if (!gpio || !curr_index) + return ret; + + if (gpio->pin_count == 0) + return ret; + + acpi_device_write_gpio(gpio); + ret = *curr_index++; + + return ret; +} + /* Write empty word value and return pointer to it */ static void *acpi_device_write_zero_len(void) { -- cgit v1.2.3