From 197025656ec456331d1a34357b113913ec3b187f Mon Sep 17 00:00:00 2001 From: Libin Yang Date: Sun, 7 Feb 2021 12:30:58 +0800 Subject: [PATCH] ucm2: soundwire: add basic settings for SDCA devices Add support for rt711-sdca, rt1316 and rt715-sdca (aka rt714). Signed-off-by: Pierre-Louis Bossart Signed-off-by: Libin Yang Signed-off-by: Jaroslav Kysela --- ucm2/codecs/rt711-sdca/init.conf | 8 ++++++ ucm2/codecs/rt715-sdca/init.conf | 9 ++++++ ucm2/sof-soundwire/rt1316-1.conf | 22 +++++++++++++++ ucm2/sof-soundwire/rt1316-2.conf | 29 +++++++++++++++++++ ucm2/sof-soundwire/rt711-sdca.conf | 40 +++++++++++++++++++++++++++ ucm2/sof-soundwire/rt715-sdca.conf | 21 ++++++++++++++ ucm2/sof-soundwire/sof-soundwire.conf | 10 +++---- 7 files changed, 134 insertions(+), 5 deletions(-) create mode 100644 ucm2/codecs/rt711-sdca/init.conf create mode 100644 ucm2/codecs/rt715-sdca/init.conf create mode 100644 ucm2/sof-soundwire/rt1316-1.conf create mode 100644 ucm2/sof-soundwire/rt1316-2.conf create mode 100644 ucm2/sof-soundwire/rt711-sdca.conf create mode 100644 ucm2/sof-soundwire/rt715-sdca.conf diff --git a/ucm2/codecs/rt711-sdca/init.conf b/ucm2/codecs/rt711-sdca/init.conf new file mode 100644 index 00000000..3149233c --- /dev/null +++ b/ucm2/codecs/rt711-sdca/init.conf @@ -0,0 +1,8 @@ +# RT711-sdca specific volume control settings + +BootSequence [ + cset "name='rt711 FU05 Playback Volume' 87" + cset "name='rt711 ADC 22 Mux' 'MIC2'" + cset "name='rt711 FU0F Capture Volume' 57" + cset "name='rt711 FU0F Capture Switch' 1" +] diff --git a/ucm2/codecs/rt715-sdca/init.conf b/ucm2/codecs/rt715-sdca/init.conf new file mode 100644 index 00000000..8506de16 --- /dev/null +++ b/ucm2/codecs/rt715-sdca/init.conf @@ -0,0 +1,9 @@ ++# RT715-sdca (aka RT714) specific volume control settings + +BootSequence [ + cset "name='rt714 FU0A Capture Switch' 0" + cset "name='rt714 ADC 22 Mux' 'DMIC3'" + cset "name='rt714 ADC 23 Mux' 'DMIC4'" + cset "name='rt714 FU02 Capture Switch' 1" + cset "name='rt714 FU02 Capture Volume' 124" +] diff --git a/ucm2/sof-soundwire/rt1316-1.conf b/ucm2/sof-soundwire/rt1316-1.conf new file mode 100644 index 00000000..f442a798 --- /dev/null +++ b/ucm2/sof-soundwire/rt1316-1.conf @@ -0,0 +1,22 @@ +# Use case Configuration for sof-soundwire card + +SectionDevice."Speaker" { + Comment "Speaker" + + EnableSequence [ + cset "name='rt1316-1 DAC L Switch' 1" + cset "name='rt1316-1 DAC R Switch' 1" + cset "name='Speaker Switch' on" + ] + + DisableSequence [ + cset "name='rt1316-1 DAC L Switch' 0" + cset "name='rt1316-1 DAC R Switch' 0" + cset "name='Speaker Switch' off" + ] + + Value { + PlaybackPriority 100 + PlaybackPCM "hw:${CardId},2" + } +} diff --git a/ucm2/sof-soundwire/rt1316-2.conf b/ucm2/sof-soundwire/rt1316-2.conf new file mode 100644 index 00000000..f2fd9ab1 --- /dev/null +++ b/ucm2/sof-soundwire/rt1316-2.conf @@ -0,0 +1,29 @@ +# Use case Configuration for sof-soundwire card + +SectionDevice."Speaker" { + Comment "Speaker" + + EnableSequence [ + cset "name='rt1316-1 RX Channel Select' L,L" + cset "name='rt1316-2 RX Channel Select' R,R" + + cset "name='rt1316-1 DAC L Switch' 1" + cset "name='rt1316-1 DAC R Switch' 1" + cset "name='rt1316-2 DAC L Switch' 1" + cset "name='rt1316-2 DAC R Switch' 1" + cset "name='Speaker Switch' on" + ] + + DisableSequence [ + cset "name='rt1316-1 DAC L Switch' 0" + cset "name='rt1316-1 DAC R Switch' 0" + cset "name='rt1316-2 DAC L Switch' 0" + cset "name='rt1316-2 DAC R Switch' 0" + cset "name='Speaker Switch' off" + ] + + Value { + PlaybackPriority 100 + PlaybackPCM "hw:${CardId},2" + } +} diff --git a/ucm2/sof-soundwire/rt711-sdca.conf b/ucm2/sof-soundwire/rt711-sdca.conf new file mode 100644 index 00000000..3d47163f --- /dev/null +++ b/ucm2/sof-soundwire/rt711-sdca.conf @@ -0,0 +1,40 @@ +# Use case Configuration for sof-soundwire card + +SectionDevice."Headphones" { + Comment "Headphones" + + EnableSequence [ + cset "name='Headphone Switch' on" + ] + + DisableSequence [ + cset "name='Headphone Switch' off" + ] + + Value { + PlaybackPriority 200 + PlaybackPCM "hw:${CardId}" + JackControl "Headphone Jack" + } +} + +SectionDevice."Headset" { + Comment "Headset Microphone" + + EnableSequence [ + cset "name='PGA2.0 2 Master Capture Switch' 1" + ] + + DisableSequence [ + cset "name='PGA2.0 2 Master Capture Switch' 0" + ] + + Value { + CapturePriority 200 + CapturePCM "hw:${CardId},1" + JackControl "Headset Mic Jack" + CaptureSwitch "PGA2.0 2 Master Capture Switch" + CaptureVolume "PGA2.0 2 Master Capture Volume" + CaptureMixerElem "PGA2.0 2 Master" + } +} diff --git a/ucm2/sof-soundwire/rt715-sdca.conf b/ucm2/sof-soundwire/rt715-sdca.conf new file mode 100644 index 00000000..6e481e1a --- /dev/null +++ b/ucm2/sof-soundwire/rt715-sdca.conf @@ -0,0 +1,21 @@ +# Use case Configuration for sof-soundwire card + +SectionDevice."Mic" { + Comment "SoundWire microphones" + + EnableSequence [ + cset "name='rt714 FU02 Capture Switch' 1" + ] + + DisableSequence [ + cset "name='rt714 FU02 Capture Switch' 0" + ] + + Value { + CapturePriority 100 + CapturePCM "hw:${CardId},4" + CaptureSwitch "rt714 FU02 Capture Switch" + CaptureVolume "rt714 FU02 Capture Volume" + CaptureMixerElem "rt714 FU02" + } +} diff --git a/ucm2/sof-soundwire/sof-soundwire.conf b/ucm2/sof-soundwire/sof-soundwire.conf index ec8b01e1..52ce2f06 100644 --- a/ucm2/sof-soundwire/sof-soundwire.conf +++ b/ucm2/sof-soundwire/sof-soundwire.conf @@ -16,7 +16,7 @@ Define { DefineRegex { SpeakerCodec { - Regex " spk:([a-z0-9]+)" + Regex " spk:([a-z0-9]+(-sdca)?)" String "${CardComponents}" } SpeakerChannels { @@ -28,11 +28,11 @@ DefineRegex { String "${CardComponents}" } HeadsetCodec { - Regex " hs:([a-z0-9]+)" + Regex " hs:([a-z0-9]+(-sdca)?)" String "${CardComponents}" } MicCodec { - Regex " mic:([a-z0-9]+)" + Regex " mic:([a-z0-9]+(-sdca)?)" String "${CardComponents}" } Mics { @@ -44,7 +44,7 @@ DefineRegex { If.hs_init { Condition { Type RegexMatch - Regex "(rt5682|rt700|rt711)" + Regex "(rt5682|rt700|rt711(-sdca)?)" String "${var:HeadsetCodec1}" } True.Include.hs_init.File "/codecs/${var:HeadsetCodec1}/init.conf" @@ -53,7 +53,7 @@ If.hs_init { If.mic_init { Condition { Type RegexMatch - Regex "(rt715)" + Regex "(rt715(-sdca)?)" String "${var:MicCodec1}" } True.Include.mic_init.File "/codecs/${var:MicCodec1}/init.conf"