From 507a439988b680770e4e4d8a9214dc7e44aa1652 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 20 Feb 2023 15:36:53 +0100 Subject: [PATCH] sof-soundwire: Initialize PGA switch controls in the BootSequence A bug in the driver / firmware may cause that the paths are active for the first boot, but if the sound card state is saved and restored later (e.g. next boot), the paths may be deactivated. BugLink: https://github.com/thesofproject/linux/issues/4196 Signed-off-by: Jaroslav Kysela --- ucm2/sof-soundwire/sof-soundwire.conf | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/ucm2/sof-soundwire/sof-soundwire.conf b/ucm2/sof-soundwire/sof-soundwire.conf index c6c9115..786ba63 100644 --- a/ucm2/sof-soundwire/sof-soundwire.conf +++ b/ucm2/sof-soundwire/sof-soundwire.conf @@ -69,7 +69,26 @@ If.mic_init_rt715 { Haystack "${var:MicCodec1}" } True.BootSequence [ - cset "name='PGA5.0 5 Master Capture Switch' 1" sysw "-/class/sound/ctl-led/mic/card${CardNumber}/detach:PGA5.0 5 Master Capture Switch" ] } + +If.pga_init_pga2 { + Condition { + Type ControlExists + Control "name='PGA2.0 2 Master Capture Switch'" + } + True.BootSequence [ + cset "name='PGA2.0 2 Master Capture Switch' 1" + ] +} + +If.pga_init_pga5 { + Condition { + Type ControlExists + Control "name='PGA5.0 5 Master Capture Switch'" + } + True.BootSequence [ + cset "name='PGA5.0 5 Master Capture Switch' 1" + ] +} -- 2.47.3