[PATCH alsa-ucm-conf v2 1/2] sof-soundwire: Add basic support for cs42l43
cs42l43 is a codec device, add basic support for it. Including a dual channel DMIC input, stereo headphones, and a mono headset microphone.
Signed-off-by: Charles Keepax ckeepax@opensource.cirrus.com --- ucm2/sof-soundwire/cs42l43-dmic.conf | 28 +++++++++++++++++ ucm2/sof-soundwire/cs42l43.conf | 47 ++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 ucm2/sof-soundwire/cs42l43-dmic.conf create mode 100644 ucm2/sof-soundwire/cs42l43.conf
diff --git a/ucm2/sof-soundwire/cs42l43-dmic.conf b/ucm2/sof-soundwire/cs42l43-dmic.conf new file mode 100644 index 0000000..bf59eca --- /dev/null +++ b/ucm2/sof-soundwire/cs42l43-dmic.conf @@ -0,0 +1,28 @@ +# Use case Configuration for sof-soundwire card + +SectionDevice."Mic" { + Comment "Microphones" + + ConflictingDevice [ + "Headset" + ] + + EnableSequence [ + cset "name='cs42l43 DP1TX1 Input' 'Decimator 3'" + cset "name='cs42l43 DP1TX2 Input' 'Decimator 4'" + cset "name='cs42l43 Decimator 3 Switch' on" + cset "name='cs42l43 Decimator 4 Switch' on" + ] + + DisableSequence [ + cset "name='cs42l43 Decimator 3 Switch' off" + cset "name='cs42l43 Decimator 4 Switch' off" + cset "name='cs42l43 DP1TX1 Input' 'None'" + cset "name='cs42l43 DP1TX2 Input' 'None'" + ] + + Value { + CapturePriority 100 + CapturePCM "hw:${CardId},4" + } +} diff --git a/ucm2/sof-soundwire/cs42l43.conf b/ucm2/sof-soundwire/cs42l43.conf new file mode 100644 index 0000000..378dbb2 --- /dev/null +++ b/ucm2/sof-soundwire/cs42l43.conf @@ -0,0 +1,47 @@ +# Use case Configuration for sof-soundwire card + +SectionDevice."Headphones" { + Comment "Headphones" + + EnableSequence [ + cset "name='cs42l43 Headphone L Input 1' 'DP5RX1'" + cset "name='cs42l43 Headphone R Input 1' 'DP5RX2'" + ] + + DisableSequence [ + cset "name='cs42l43 Headphone L Input 1' 'None'" + cset "name='cs42l43 Headphone R Input 1' 'None'" + ] + + Value { + PlaybackPriority 200 + PlaybackPCM "hw:${CardId},0" + PlaybackVolume "cs42l43 Headphone Digital Volume" + JackControl "Headphone Jack" + } +} + +SectionDevice."Headset" { + Comment "Headset Microphone" + + EnableSequence [ + cset "name='cs42l43 ADC1 Input' 'IN1'" + cset "name='cs42l43 Decimator 1 Mode' 'ADC'" + + cset "name='cs42l43 DP1TX1 Input' 'Decimator 1'" + cset "name='cs42l43 DP1TX2 Input' 'Decimator 1'" + ] + + DisableSequence [ + cset "name='cs42l43 DP1TX1 Input' 'None'" + cset "name='cs42l43 DP1TX2 Input' 'None'" + ] + + Value { + CapturePriority 200 + CapturePCM "hw:${CardId},4" + CaptureVolume "cs42l43 Decimator 1 Volume" + CaptureSwitch "cs42l43 Decimator 1 Switch" + JackControl "Headset Mic Jack" + } +}
cs35l56 is a boosted speaker amp, add UCM support for configurations with up to 8 amps. This also updates the default naming for the speaker amp UCM file to remove the number of amps. Special cases are added for the existing amps that require different UCM for different numbers of amps, but future additions will defaults to not including it in the naming.
Signed-off-by: Charles Keepax ckeepax@opensource.cirrus.com --- ucm2/sof-soundwire/HiFi.conf | 12 +++- ucm2/sof-soundwire/cs35l56.conf | 123 ++++++++++++++++++++++++++++++++ 2 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 ucm2/sof-soundwire/cs35l56.conf
diff --git a/ucm2/sof-soundwire/HiFi.conf b/ucm2/sof-soundwire/HiFi.conf index a8c1e33..8b32d20 100644 --- a/ucm2/sof-soundwire/HiFi.conf +++ b/ucm2/sof-soundwire/HiFi.conf @@ -13,7 +13,17 @@ If.spkdev { Type String Empty "${var:SpeakerCodec1}" } - False.Include.spkdev.File "/sof-soundwire/${var:SpeakerCodec1}-${var:SpeakerAmps1}.conf" + False { + If.simplespeaker { + Condition { + Type RegexMatch + Regex "(rt1308|rt1316|rt1318)" + String "${var:SpeakerCodec1}" + } + True.Include.spkdev.File "/sof-soundwire/${var:SpeakerCodec1}-${var:SpeakerAmps1}.conf" + False.Include.spkdev.File "/sof-soundwire/${var:SpeakerCodec1}.conf" + } + } }
If.micdev { diff --git a/ucm2/sof-soundwire/cs35l56.conf b/ucm2/sof-soundwire/cs35l56.conf new file mode 100644 index 0000000..32c08e7 --- /dev/null +++ b/ucm2/sof-soundwire/cs35l56.conf @@ -0,0 +1,123 @@ +# Use case Configuration for sof-soundwire card + +SectionDevice."Speaker" { + Comment "Speaker" + + If.amp1 { + Condition { + Type ControlExists + Control "name='AMP1 Speaker Switch'" + } + True { + EnableSequence [ + cset "name='AMP1 Speaker Switch' 1" + ] + DisableSequence [ + cset "name='AMP1 Speaker Switch' 0" + ] + } + } + If.amp2 { + Condition { + Type ControlExists + Control "name='AMP2 Speaker Switch'" + } + True { + EnableSequence [ + cset "name='AMP2 Speaker Switch' 1" + ] + DisableSequence [ + cset "name='AMP2 Speaker Switch' 0" + ] + } + } + If.amp3 { + Condition { + Type ControlExists + Control "name='AMP3 Speaker Switch'" + } + True { + EnableSequence [ + cset "name='AMP3 Speaker Switch' 1" + ] + DisableSequence [ + cset "name='AMP3 Speaker Switch' 0" + ] + } + } + If.amp4 { + Condition { + Type ControlExists + Control "name='AMP4 Speaker Switch'" + } + True { + EnableSequence [ + cset "name='AMP4 Speaker Switch' 1" + ] + DisableSequence [ + cset "name='AMP4 Speaker Switch' 0" + ] + } + } + If.amp5 { + Condition { + Type ControlExists + Control "name='AMP5 Speaker Switch'" + } + True { + EnableSequence [ + cset "name='AMP5 Speaker Switch' 1" + ] + DisableSequence [ + cset "name='AMP5 Speaker Switch' 0" + ] + } + } + If.amp6 { + Condition { + Type ControlExists + Control "name='AMP6 Speaker Switch'" + } + True { + EnableSequence [ + cset "name='AMP6 Speaker Switch' 1" + ] + DisableSequence [ + cset "name='AMP6 Speaker Switch' 0" + ] + } + } + If.amp7 { + Condition { + Type ControlExists + Control "name='AMP7 Speaker Switch'" + } + True { + EnableSequence [ + cset "name='AMP7 Speaker Switch' 1" + ] + DisableSequence [ + cset "name='AMP7 Speaker Switch' 0" + ] + } + } + If.amp8 { + Condition { + Type ControlExists + Control "name='AMP8 Speaker Switch'" + } + True { + EnableSequence [ + cset "name='AMP8 Speaker Switch' 1" + ] + DisableSequence [ + cset "name='AMP8 Speaker Switch' 0" + ] + } + } + + Value { + PlaybackPriority 100 + PlaybackPCM "hw:${CardId},2" + } +}
On Wed, Dec 06, 2023 at 02:05:47PM +0000, Charles Keepax wrote:
- False {
If.simplespeaker {
Ooops this name is left over from when I had the if the other way around, so is a bit confusing. I will leave it a couple days for any comments then fixup if we are happy.
Thanks, Charles
On 06. 12. 23 15:05, Charles Keepax wrote:
cs35l56 is a boosted speaker amp, add UCM support for configurations with up to 8 amps. This also updates the default naming for the speaker amp UCM file to remove the number of amps. Special cases are added for the existing amps that require different UCM for different numbers of amps, but future additions will defaults to not including it in the naming.
Signed-off-by: Charles Keepax ckeepax@opensource.cirrus.com
...
- False.Include.spkdev.File "/sof-soundwire/${var:SpeakerCodec1}-${var:SpeakerAmps1}.conf"
Thanks, but I meant to do a global change like this:
https://github.com/alsa-project/alsa-ucm-conf/pull/370
Could you rebase your change on top?
Also, conditions may use ${var:SpeakerAmps1} for consistency. The driver should report the correct configuration. Macros are also helpful to reduce repeating configuration blocks.
Thanks, Jaroslav
On Wed, Dec 06, 2023 at 04:16:06PM +0100, Jaroslav Kysela wrote:
On 06. 12. 23 15:05, Charles Keepax wrote:
cs35l56 is a boosted speaker amp, add UCM support for configurations with up to 8 amps. This also updates the default naming for the speaker amp UCM file to remove the number of amps. Special cases are added for the existing amps that require different UCM for different numbers of amps, but future additions will defaults to not including it in the naming.
Signed-off-by: Charles Keepax ckeepax@opensource.cirrus.com
...
- False.Include.spkdev.File "/sof-soundwire/${var:SpeakerCodec1}-${var:SpeakerAmps1}.conf"
Thanks, but I meant to do a global change like this:
https://github.com/alsa-project/alsa-ucm-conf/pull/370
Could you rebase your change on top?
Sure no problem thank you.
Thanks, Charles
participants (2)
-
Charles Keepax
-
Jaroslav Kysela