From 227d434e2dcd49047994f7d131e5af63aa301aed Mon Sep 17 00:00:00 2001 From: Ian Feng Date: Mon, 28 Jul 2025 16:26:02 +0800 Subject: [PATCH] drivers/soundwire/alc711: Support clock stop flag from devicetree Allow overriding the default value (true) via devicetree configuration. If disable_clkstop_sm_support is set in the devicetree, the corresponding field in alc711_slave is set to false. BUG=b:417133565, b:420516709 TEST=Verified build and boot with ALC721 and ALC722. Headphone path switches successfully via audio jack event. Confirmed SSDT dump at PCI0.HDAS.SNDW. Package (0x02) { "mipi-sdw-simplified-clockstopprepare-sm-supported", Zero }, Change-Id: If958cd0c2136e4dd3f60cb9203d9394913d3f66e Signed-off-by: Ian Feng Reviewed-on: https://review.coreboot.org/c/coreboot/+/88586 Reviewed-by: Mac Chiang Reviewed-by: Simon Yang Reviewed-by: Subrata Banik Tested-by: build bot (Jenkins) --- src/drivers/soundwire/alc711/alc711.c | 4 ++++ src/drivers/soundwire/alc711/chip.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/drivers/soundwire/alc711/alc711.c b/src/drivers/soundwire/alc711/alc711.c index c698000266..dc738405ad 100644 --- a/src/drivers/soundwire/alc711/alc711.c +++ b/src/drivers/soundwire/alc711/alc711.c @@ -131,6 +131,10 @@ static void soundwire_alc711_fill_ssdt(const struct device *dev) /* Currently only 1 audio mode is supported. */ memcpy(&alc711_audio_mode, &config->audio_mode, sizeof(struct soundwire_audio_mode)); + /* Override the default (true) if disable_clkstop_sm_support is set in the devicetree. */ + if (config->disable_clkstop_sm_support) + alc711_slave.simplified_clockstopprepare_sm_supported = false; + dsd = acpi_dp_new_table("_DSD"); soundwire_gen_codec(dsd, &alc711_codec, NULL); acpi_dp_write(dsd); diff --git a/src/drivers/soundwire/alc711/chip.h b/src/drivers/soundwire/alc711/chip.h index 8b0230e6d1..26aaffafa4 100644 --- a/src/drivers/soundwire/alc711/chip.h +++ b/src/drivers/soundwire/alc711/chip.h @@ -7,6 +7,7 @@ #include struct drivers_soundwire_alc711_config { + bool disable_clkstop_sm_support; const char *name; const char *desc; struct soundwire_address alc711_address;