Skip to content

Commit

Permalink
sof-soundwire: Add basic support for cs42l43's speaker
Browse files Browse the repository at this point in the history
Previous support was added for the mics and headset on cs42l43, expand
this support with additional configuration for the speaker output.

Link: https://lore.kernel.org/alsa-devel/[email protected]/
Signed-off-by: Charles Keepax <[email protected]>
Signed-off-by: Jaroslav Kysela <[email protected]>
  • Loading branch information
charleskeepax authored and perexg committed Apr 24, 2024
1 parent 5285e10 commit c56d0a4
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ucm2/sof-soundwire/HiFi.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ SectionVerb {
Value.TQ "HiFi"
}

If.codec {
Condition {
Type String
Empty "${var:Codec1}"
}
False.Include.codec.File "/sof-soundwire/${var:Codec1}.conf"
}

If.spkdev {
Condition {
Type String
Expand Down
25 changes: 25 additions & 0 deletions ucm2/sof-soundwire/cs42l43-spk.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use case Configuration for sof-soundwire card

SectionDevice."Speaker" {
Comment "Speaker"

ConflictingDevice [
"Headphones"
]

EnableSequence [
cset "name='cs42l43 Speaker L Input 1' 'DP5RX1'"
cset "name='cs42l43 Speaker R Input 1' 'DP5RX2'"
]

DisableSequence [
cset "name='cs42l43 Speaker L Input 1' 'None'"
cset "name='cs42l43 Speaker R Input 1' 'None'"
]

Value {
PlaybackPriority 100
PlaybackPCM "hw:${CardId},0"
PlaybackMixerElem "cs42l43 Speaker Digital"
}
}
13 changes: 13 additions & 0 deletions ucm2/sof-soundwire/sof-soundwire.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ Define {
}

DefineRegex {
Codec {
Regex " codec:([a-z0-9]+(-sdca)?)"
String "${CardComponents}"
}
SpeakerCodec {
Regex " spk:([a-z0-9]+(-sdca)?)"
String "${CardComponents}"
Expand All @@ -44,6 +48,15 @@ DefineRegex {
}
}

If.codec_init {
Condition {
Type RegexMatch
Regex "(rt722)"
String "${var:Codec1}"
}
True.Include.codec_init.File "/codecs/${var:Codec1}/init.conf"
}

If.hs_init {
Condition {
Type RegexMatch
Expand Down

0 comments on commit c56d0a4

Please sign in to comment.