Subrata Banik has submitted this change. ( https://review.coreboot.org/c/coreboot/+/81920?usp=email )
(
9 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: drivers/soundwire: Support Realtek ALC722 codec ......................................................................
drivers/soundwire: Support Realtek ALC722 codec
This patch adds SoundWire driver to support ALC722 audio codec.
The existing ALC711 codec driver is refactored to include support for ALC722 device based on config flag.
The ACPI address for the codec is calculated with the information in the codec driver combined with the devicetree.cb hierarchy where the link and unique IDs are extracted from the device path.
For example this device is connected to master link ID 0 and has strap settings configuring it for unique ID 1:
chip drivers/soundwire/alc711 register "desc" = ""Headset Codec"" device generic 0.1 on end end
reference datasheet: Realtek ALC722-CG ver. 0.56
TEST=This driver was tested on Intel RVP with on board ALC722 codec by booting and disassembling the runtime SSDT to ensure that the devices have the expected address and properties. Test soundcard binding works and devices are detected and check for audio playback using speaker output.
Signed-off-by: Anil Kumar anil.kumar.k@intel.com Change-Id: Ieb16a1c6f3a79321fdc35987468daa8be33b6e49 Reviewed-on: https://review.coreboot.org/c/coreboot/+/81920 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Subrata Banik subratabanik@google.com --- M src/drivers/soundwire/alc711/Kconfig M src/drivers/soundwire/alc711/Makefile.mk M src/drivers/soundwire/alc711/alc711.c M src/include/mipi/ids.h 4 files changed, 32 insertions(+), 3 deletions(-)
Approvals: build bot (Jenkins): Verified Subrata Banik: Looks good to me, approved
diff --git a/src/drivers/soundwire/alc711/Kconfig b/src/drivers/soundwire/alc711/Kconfig index 0d96fa9..96ed819 100644 --- a/src/drivers/soundwire/alc711/Kconfig +++ b/src/drivers/soundwire/alc711/Kconfig @@ -1,4 +1,18 @@ ## SPDX-License-Identifier: GPL-2.0-only
+config DRIVERS_SOUNDWIRE_ALC_BASE_7XX + bool + help + Base code for Realtek ALC7xxx Codec SoundWire driver. + config DRIVERS_SOUNDWIRE_ALC711 bool + select DRIVERS_SOUNDWIRE_ALC_BASE_7XX + help + SoundWire driver for Realtek ALC711 device + +config DRIVERS_SOUNDWIRE_ALC722 + bool + select DRIVERS_SOUNDWIRE_ALC_BASE_7XX + help + SoundWire driver for Realtek ALC722 device diff --git a/src/drivers/soundwire/alc711/Makefile.mk b/src/drivers/soundwire/alc711/Makefile.mk index 63e0993..cdedc41 100644 --- a/src/drivers/soundwire/alc711/Makefile.mk +++ b/src/drivers/soundwire/alc711/Makefile.mk @@ -1,3 +1,3 @@ ## SPDX-License-Identifier: GPL-2.0-only
-ramstage-$(CONFIG_DRIVERS_SOUNDWIRE_ALC711) += alc711.c +ramstage-$(CONFIG_DRIVERS_SOUNDWIRE_ALC_BASE_7XX) += alc711.c diff --git a/src/drivers/soundwire/alc711/alc711.c b/src/drivers/soundwire/alc711/alc711.c index 7d1ac42..c5e7a8e5 100644 --- a/src/drivers/soundwire/alc711/alc711.c +++ b/src/drivers/soundwire/alc711/alc711.c @@ -11,10 +11,18 @@ #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_ALC711) .version = SOUNDWIRE_VERSION_1_1, - .manufacturer_id = MIPI_MFG_ID_REALTEK, .part_id = MIPI_DEV_ID_REALTEK_ALC711, - .class = MIPI_CLASS_NONE + .class = MIPI_CLASS_NONE, +#else +#error "No Realtek SoundWire codec selected" +#endif + .manufacturer_id = MIPI_MFG_ID_REALTEK, };
static struct soundwire_slave alc711_slave = { @@ -150,6 +158,12 @@ }
struct chip_operations drivers_soundwire_alc711_ops = { +#if CONFIG(DRIVERS_SOUNDWIRE_ALC711) .name = "Realtek ALC711 SoundWire Codec", +#elif CONFIG(DRIVERS_SOUNDWIRE_ALC722) + .name = "Realtek ALC722 SoundWire Codec", +#else + .name = "Unknown", +#endif .enable_dev = soundwire_alc711_enable }; diff --git a/src/include/mipi/ids.h b/src/include/mipi/ids.h index 5aa5a67..4e54b62 100644 --- a/src/include/mipi/ids.h +++ b/src/include/mipi/ids.h @@ -21,6 +21,7 @@ #define MIPI_MFG_ID_REALTEK 0x025d #define MIPI_DEV_ID_REALTEK_ALC5682 0x5682 #define MIPI_DEV_ID_REALTEK_ALC711 0x0711 +#define MIPI_DEV_ID_REALTEK_ALC722 0x0722 #define MIPI_DEV_ID_REALTEK_ALC1308 0x1308
#define MIPI_MFG_ID_MAXIM 0x019f