Subrata Banik has submitted this change. ( https://review.coreboot.org/c/coreboot/+/85282?usp=email )
Change subject: drivers/soundwire/alc711: Add common Kconfig for ALC7xx soundwire codecs ......................................................................
drivers/soundwire/alc711: Add common Kconfig for ALC7xx soundwire codecs
- Use common config DRIVERS_SOUNDWIRE_ALC_BASE_7XX for ALC7xx variants - Introduce soundwire codec address in soundwire chip.h to calculate device address for acpi table based on overridetree. - Update devicetree and Kconfig to use common config.
BUG=b:368495490 TEST=build coreboot image and boot on Intel RVP board. Disassemble SSDT and confirm ACPI entries are correct for alc7xx device.
Change-Id: I5953d0fcb7b15368888901f88c5616757ac42877 Signed-off-by: Varun Upadhyay varun.upadhyay@intel.com Signed-off-by: Naveen M naveen.m@intel.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/85282 Reviewed-by: Subrata Banik subratabanik@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Karthik Ramasubramanian kramasub@google.com --- M src/drivers/soundwire/alc711/alc711.c M src/drivers/soundwire/alc711/chip.h M src/mainboard/intel/adlrvp/Kconfig M src/mainboard/intel/adlrvp/devicetree.cb M src/mainboard/intel/adlrvp/devicetree_m.cb M src/mainboard/intel/adlrvp/devicetree_n.cb M src/mainboard/intel/mtlrvp/Kconfig M src/mainboard/intel/mtlrvp/variants/baseboard/mtlrvp_p/devicetree.cb 8 files changed, 22 insertions(+), 24 deletions(-)
Approvals: Karthik Ramasubramanian: Looks good to me, approved Subrata Banik: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/src/drivers/soundwire/alc711/alc711.c b/src/drivers/soundwire/alc711/alc711.c index 1a31f0d..83552c4 100644 --- a/src/drivers/soundwire/alc711/alc711.c +++ b/src/drivers/soundwire/alc711/alc711.c @@ -10,25 +10,6 @@
#include "chip.h"
-static struct soundwire_address alc711_address = { -#if CONFIG(DRIVERS_SOUNDWIRE_ALC722) - .version = SOUNDWIRE_VERSION_1_2, - .part_id = MIPI_DEV_ID_REALTEK_ALC722, - .class = MIPI_CLASS_SDCA, -#elif CONFIG(DRIVERS_SOUNDWIRE_ALC721) - .version = SOUNDWIRE_VERSION_1_2, - .part_id = MIPI_DEV_ID_REALTEK_ALC721, - .class = MIPI_CLASS_SDCA, -#elif CONFIG(DRIVERS_SOUNDWIRE_ALC711) - .version = SOUNDWIRE_VERSION_1_1, - .part_id = MIPI_DEV_ID_REALTEK_ALC711, - .class = MIPI_CLASS_NONE, -#else -#error "No Realtek SoundWire codec selected" -#endif - .manufacturer_id = MIPI_MFG_ID_REALTEK, -}; - static struct soundwire_slave alc711_slave = { .wake_up_unavailable = false, .test_mode_supported = false, @@ -123,10 +104,11 @@ acpigen_write_device(acpi_device_name(dev));
/* Set codec address IDs. */ - alc711_address.link_id = dev->path.generic.id; - alc711_address.unique_id = dev->path.generic.subid; + config->alc711_address.link_id = dev->path.generic.id; + config->alc711_address.unique_id = dev->path.generic.subid; + config->alc711_address.manufacturer_id = MIPI_MFG_ID_REALTEK;
- acpigen_write_ADR_soundwire_device(&alc711_address); + acpigen_write_ADR_soundwire_device(&config->alc711_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/alc711/chip.h b/src/drivers/soundwire/alc711/chip.h index 6d317fd..c628209 100644 --- a/src/drivers/soundwire/alc711/chip.h +++ b/src/drivers/soundwire/alc711/chip.h @@ -3,9 +3,13 @@ #ifndef __DRIVERS_SOUNDWIRE_ALC711_CHIP_H__ #define __DRIVERS_SOUNDWIRE_ALC711_CHIP_H__
+#include <device/soundwire.h> +#include <mipi/ids.h> + struct drivers_soundwire_alc711_config { const char *name; const char *desc; + struct soundwire_address alc711_address; };
#endif /* __DRIVERS_SOUNDWIRE_ALC711_CHIP_H__ */ diff --git a/src/mainboard/intel/adlrvp/Kconfig b/src/mainboard/intel/adlrvp/Kconfig index 0171ebc..279a8f9 100644 --- a/src/mainboard/intel/adlrvp/Kconfig +++ b/src/mainboard/intel/adlrvp/Kconfig @@ -10,7 +10,7 @@ select DRIVERS_INTEL_DPTF select DRIVERS_INTEL_MIPI_CAMERA select DRIVERS_INTEL_SOUNDWIRE - select DRIVERS_SOUNDWIRE_ALC711 + select DRIVERS_SOUNDWIRE_ALC_BASE_7XX select DRIVERS_SPI_ACPI select DRIVERS_USB_ACPI select HAVE_ACPI_RESUME diff --git a/src/mainboard/intel/adlrvp/devicetree.cb b/src/mainboard/intel/adlrvp/devicetree.cb index a6bad13..a3b3c93 100644 --- a/src/mainboard/intel/adlrvp/devicetree.cb +++ b/src/mainboard/intel/adlrvp/devicetree.cb @@ -456,6 +456,9 @@ chip drivers/soundwire/alc711 # SoundWire Link 0 ID 1 register "desc" = ""Headset Codec"" + register "alc711_address.version" = "SOUNDWIRE_VERSION_1_1" + register "alc711_address.class" = "MIPI_CLASS_NONE" + register "alc711_address.part_id" = "MIPI_DEV_ID_REALTEK_ALC711" device generic 0.1 on end end end diff --git a/src/mainboard/intel/adlrvp/devicetree_m.cb b/src/mainboard/intel/adlrvp/devicetree_m.cb index 922b673..d6bf36a 100644 --- a/src/mainboard/intel/adlrvp/devicetree_m.cb +++ b/src/mainboard/intel/adlrvp/devicetree_m.cb @@ -393,6 +393,9 @@ chip drivers/soundwire/alc711 # SoundWire Link 0 ID 1 register "desc" = ""Headset Codec"" + register "alc711_address.version" = "SOUNDWIRE_VERSION_1_1" + register "alc711_address.class" = "MIPI_CLASS_NONE" + register "alc711_address.part_id" = "MIPI_DEV_ID_REALTEK_ALC711" device generic 0.1 on end end end diff --git a/src/mainboard/intel/adlrvp/devicetree_n.cb b/src/mainboard/intel/adlrvp/devicetree_n.cb index db859a1..7e66656 100644 --- a/src/mainboard/intel/adlrvp/devicetree_n.cb +++ b/src/mainboard/intel/adlrvp/devicetree_n.cb @@ -390,6 +390,9 @@ chip drivers/soundwire/alc711 # SoundWire Link 0 ID 1 register "desc" = ""Headset Codec"" + register "alc711_address.version" = "SOUNDWIRE_VERSION_1_1" + register "alc711_address.class" = "MIPI_CLASS_NONE" + register "alc711_address.part_id" = "MIPI_DEV_ID_REALTEK_ALC711" device generic 0.1 on end end end diff --git a/src/mainboard/intel/mtlrvp/Kconfig b/src/mainboard/intel/mtlrvp/Kconfig index 84ebade..dfe5e44 100644 --- a/src/mainboard/intel/mtlrvp/Kconfig +++ b/src/mainboard/intel/mtlrvp/Kconfig @@ -13,7 +13,7 @@ select DRIVERS_INTEL_MIPI_CAMERA select DRIVERS_INTEL_SOUNDWIRE select DRIVERS_SOUNDWIRE_ALC5682 - select DRIVERS_SOUNDWIRE_ALC711 + select DRIVERS_SOUNDWIRE_ALC_BASE_7XX select DRIVERS_SOUNDWIRE_MAX98373 select DRIVERS_USB_ACPI select HAVE_ACPI_RESUME diff --git a/src/mainboard/intel/mtlrvp/variants/baseboard/mtlrvp_p/devicetree.cb b/src/mainboard/intel/mtlrvp/variants/baseboard/mtlrvp_p/devicetree.cb index 9ba7118..3b17bce 100644 --- a/src/mainboard/intel/mtlrvp/variants/baseboard/mtlrvp_p/devicetree.cb +++ b/src/mainboard/intel/mtlrvp/variants/baseboard/mtlrvp_p/devicetree.cb @@ -604,6 +604,9 @@ chip drivers/soundwire/alc711 # SoundWire Link 0 ID 1 register "desc" = ""Headset Codec"" + register "alc711_address.version" = "SOUNDWIRE_VERSION_1_1" + register "alc711_address.class" = "MIPI_CLASS_NONE" + register "alc711_address.part_id" = "MIPI_DEV_ID_REALTEK_ALC711" device generic 0.1 on probe AUDIO MTL_ALC711_SNDW end