ucm2: sof-soundwire: add combined cs42l43-spk+cs35l56 config

In some systems cs42l43-spk and cs35l56 can be used simultaneously to
drive seprate speakers (e.g. tweeters and woofers), add a configuration
to support that.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/748
Link: https://lore.kernel.org/all/20260417144529.2385360-1-mstrozek@opensource.cirrus.com/
Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Maciej Strozek 2026-04-15 13:47:06 +01:00 committed by Jaroslav Kysela
commit 980fb83651
5 changed files with 57 additions and 2 deletions

View file

@ -0,0 +1 @@
cs42l43-spk+cs35l56

View file

@ -0,0 +1,42 @@
# cs42l43+cs35l56 specific control settings
#
# Arguments:
# Amp - amplifier number 1-8
#
DefineMacro.cs35l56spkInit.If.0 {
Condition {
Type ControlExists
Control "name='AMP${var:__Amp} Speaker Switch'"
}
True {
LibraryConfig.remap.Config.ctl.default.map {
"name='cs42l43 Speaker Playback Switch'" {
"name='AMP${var:__Amp} Speaker Switch'".vindex.0 0
}
}
FixedBootSequence [
cset "name='AMP${var:__Amp} Speaker Switch' 0"
]
Macro [{ SetLED { LED="speaker" Action="attach" CtlId="AMP${var:__Amp} Speaker Switch" } }]
}
}
LibraryConfig.remap.Config {
ctl.default.map {
"name='cs42l43 Speaker Playback Switch'" {
"name='cs42l43 Speaker Digital Switch'".vindex.0 [ 0 1 ]
}
}
}
Macro [
{ SetLED { LED="speaker" Action="attach" CtlId="cs42l43 Speaker Digital Switch" } }
{ cs35l56spkInit { Amp 1 } }
{ cs35l56spkInit { Amp 2 } }
{ cs35l56spkInit { Amp 3 } }
{ cs35l56spkInit { Amp 4 } }
{ cs35l56spkInit { Amp 5 } }
{ cs35l56spkInit { Amp 6 } }
{ cs35l56spkInit { Amp 7 } }
{ cs35l56spkInit { Amp 8 } }
]

View file

@ -0,0 +1 @@
cs42l43-spk.conf

View file

@ -0,0 +1 @@
cs42l43-spk.conf

View file

@ -22,7 +22,7 @@ Define {
DefineRegex {
SpeakerCodec {
Regex " spk:([a-z0-9]+((-sdca)|(-spk)|(-bridge))?(\\+[a-z0-9]+)?)"
Regex " spk:([a-z0-9]+((-sdca)|(-spk)|(-bridge))?(\\+[a-z0-9]+((-spk)?))?)"
String "${CardComponents}"
}
SpeakerChannels {
@ -55,6 +55,16 @@ DefineRegex {
}
}
# check to keep combatibility with older kernels that have two separate spk: tags
If.old_multi_spk {
Condition {
Type RegexMatch
Regex "(spk:cs42l43-spk .*spk:cs35l56( |$))|(spk:cs35l56 .*spk:cs42l43-spk( |$))"
String "${CardComponents}"
}
True.Define.SpeakerCodec1 "cs42l43-spk+cs35l56"
}
If.multi_init {
Condition {
Type String
@ -108,7 +118,7 @@ If.multi_headset {
If.spk_init {
Condition {
Type RegexMatch
Regex "(rt1318(-1)?|cs42l43-spk|cs35l56(-bridge)?)"
Regex "(rt1318(-1)?|cs42l43-spk(\\+cs35l56)?|cs35l56((-bridge)|(\\+cs42l43-spk))?)"
String "${var:SpeakerCodec1}"
}
True.Include.spk_init.File "/codecs/${var:SpeakerCodec1}/init.conf"