Skip to contentSkip to conversation

sof-soundwire: Split cs42l43 dmic initialisation

PATCH Applied Charles Keepax 2 participants 2 messages Mar 6, 2025 – Mar 10, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sof-soundwire: Split cs42l43 dmic initialisation

Split the initialisation of cs42l43 into a headset part and a dmic part. This will prevent the dmic mute controls getting attached to the mute LED when the codec dmics are not being used.

---
 ucm2/codecs/cs42l43-dmic/init.conf    | 23 +++++++++++++++++++++++
 ucm2/codecs/cs42l43/init.conf         | 11 +----------
 ucm2/sof-soundwire/sof-soundwire.conf |  2 +-
 3 files changed, 25 insertions(+), 11 deletions(-)
 create mode 100644 ucm2/codecs/cs42l43-dmic/init.conf
ucm2/codecs/cs42l43-dmic/init.conf new file +23 -0
new file mode 100644
index 0000000..441d082
@@ -0,0 +1,23 @@
+# cs42l43 specific control settings
+
+LibraryConfig.remap.Config {
+	ctl.default.map {
+		"name='cs42l43 Microphone Capture Switch'" {
+			"name='cs42l43 Decimator 3 Switch'".vindex.0 0
+			"name='cs42l43 Decimator 4 Switch'".vindex.1 0
+		}
+		"name='cs42l43 Microphone Capture Volume'" {
+			"name='cs42l43 Decimator 3 Volume'".vindex.0 0
+			"name='cs42l43 Decimator 4 Volume'".vindex.1 0
+		}
+	}
+}
+
+FixedBootSequence [
+	cset "name='cs42l43 Decimator 3 Switch' 0"
+	cset "name='cs42l43 Decimator 4 Switch' 0"
+	exec "-/sbin/modprobe snd_ctl_led"
+	sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:cs42l43 Decimator 3 Switch"
+	sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:cs42l43 Decimator 4 Switch"
+]
+
ucm2/codecs/cs42l43/init.conf +1 -10
index 0fbb517..8e41a0f 100644
@@ -2,14 +2,6 @@
 
 LibraryConfig.remap.Config {
 	ctl.default.map {
-		"name='cs42l43 Microphone Capture Switch'" {
-			"name='cs42l43 Decimator 3 Switch'".vindex.0 0
-			"name='cs42l43 Decimator 4 Switch'".vindex.1 0
-		}
-		"name='cs42l43 Microphone Capture Volume'" {
-			"name='cs42l43 Decimator 3 Volume'".vindex.0 0
-			"name='cs42l43 Decimator 4 Volume'".vindex.1 0
-		}
 		"name='cs42l43 Headset Microphone Capture Switch'" {
 			"name='cs42l43 Decimator 1 Switch'".vindex.0 0
 		}
@@ -20,8 +12,7 @@ LibraryConfig.remap.Config {
 }
 
 FixedBootSequence [
+	cset "name='cs42l43 Decimator 1 Switch' 0"
 	exec "-/sbin/modprobe snd_ctl_led"
 	sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:cs42l43 Decimator 1 Switch"
-	sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:cs42l43 Decimator 3 Switch"
-	sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:cs42l43 Decimator 4 Switch"
 ]
ucm2/sof-soundwire/sof-soundwire.conf +1 -1
index 96d2966..57e5610 100644
@@ -114,7 +114,7 @@ If.hs_init {
 If.mic_init {
 	Condition {
 		Type RegexMatch
-		Regex "(rt712-dmic|rt713-dmic|rt715(-sdca)?)"
+		Regex "(cs42l43-dmic|rt712-dmic|rt713-dmic|rt715(-sdca)?)"
 		String "${var:MicCodec1}"
 	}
 	True.Include.mic_init.File "/codecs/${var:MicCodec1}/init.conf"
Signature · 1 line
2.39.5
#1 lore raw
Quoted 5 lines · Charles Keepax

Split the initialisation of cs42l43 into a headset part and a dmic part. This will prevent the dmic mute controls getting attached to the mute LED when the codec dmics are not being used.

Applied. Thank you.

Jaroslav

Signature · 2 lines
Jaroslav Kysela <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.