From b6051e5648bab05efe7cfc5abf1c360b3b01ce1c Mon Sep 17 00:00:00 2001 From: Mac Chiang Date: Thu, 20 Mar 2025 17:19:02 +0800 Subject: [PATCH] drivers/soundwire/alc1320: use common struct to set soundwire ADDR_ Add common soundwire address struct for acpi table configuration over overridetree. refer to: commit 2411942a0518 ("drivers/soundwire/alc711: Add common Kconfig for ALC7xx soundwire codecs") BUG=b:378629979 TEST=emerge-fatcat coreboot check the ssdt dump PCI0.HDAS.SNDW has address: 0x000331025D132001 Change-Id: I2d3531eef6adf21a28a26dcc3ac1bb7830877905 Signed-off-by: Mac Chiang Reviewed-on: https://review.coreboot.org/c/coreboot/+/86939 Tested-by: build bot (Jenkins) Reviewed-by: Weimin Wu Reviewed-by: Pranava Y N Reviewed-by: Subrata Banik --- src/drivers/soundwire/alc1320/alc1320.c | 14 ++++---------- src/drivers/soundwire/alc1320/chip.h | 4 ++++ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/drivers/soundwire/alc1320/alc1320.c b/src/drivers/soundwire/alc1320/alc1320.c index 1362675f54..10c58e1ecb 100644 --- a/src/drivers/soundwire/alc1320/alc1320.c +++ b/src/drivers/soundwire/alc1320/alc1320.c @@ -10,13 +10,6 @@ #include "chip.h" -static struct soundwire_address alc1320_address = { - .version = SOUNDWIRE_VERSION_1_2, - .manufacturer_id = MIPI_MFG_ID_REALTEK, - .part_id = MIPI_DEV_ID_REALTEK_ALC1320, - .class = MIPI_CLASS_NONE -}; - static struct soundwire_slave alc1320_slave = { .wake_up_unavailable = false, .test_mode_supported = false, @@ -106,10 +99,11 @@ static void soundwire_alc1320_fill_ssdt(const struct device *dev) acpigen_write_device(acpi_device_name(dev)); /* Set codec address IDs. */ - alc1320_address.link_id = dev->path.generic.id; - alc1320_address.unique_id = dev->path.generic.subid; + config->alc1320_address.link_id = dev->path.generic.id; + config->alc1320_address.unique_id = dev->path.generic.subid; + config->alc1320_address.manufacturer_id = MIPI_MFG_ID_REALTEK; - acpigen_write_ADR_soundwire_device(&alc1320_address); + acpigen_write_ADR_soundwire_device(&config->alc1320_address); acpigen_write_name_string("_DDN", config->desc ? : dev->chip_ops->name); acpigen_write_STA(acpi_device_status(dev)); diff --git a/src/drivers/soundwire/alc1320/chip.h b/src/drivers/soundwire/alc1320/chip.h index 028c200219..4278aef0ba 100644 --- a/src/drivers/soundwire/alc1320/chip.h +++ b/src/drivers/soundwire/alc1320/chip.h @@ -3,9 +3,13 @@ #ifndef __DRIVERS_SOUNDWIRE_ALC1320_CHIP_H__ #define __DRIVERS_SOUNDWIRE_ALC1320_CHIP_H__ +#include +#include + struct drivers_soundwire_alc1320_config { const char *name; const char *desc; + struct soundwire_address alc1320_address; }; #endif /* __DRIVERS_SOUNDWIRE_ALC1320_CHIP_H__ */