From a06d28536fc17690bb0f187c24523d50c1ff6f6e Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Mon, 16 Mar 2020 16:42:11 -0500 Subject: [PATCH 1/6] sof-soundwire: initial UCM2 version Add conditional inclusion of sections Signed-off-by: Pierre-Louis Bossart --- ucm2/sof-soundwire/Hdmi.conf | 79 +++++++++++++++++++++++++++ ucm2/sof-soundwire/HiFi.conf | 14 +++++ ucm2/sof-soundwire/RT1308-1.conf | 31 +++++++++++ ucm2/sof-soundwire/RT711.conf | 44 +++++++++++++++ ucm2/sof-soundwire/RT715.conf | 35 ++++++++++++ ucm2/sof-soundwire/sof-soundwire.conf | 6 ++ 6 files changed, 209 insertions(+) create mode 100644 ucm2/sof-soundwire/Hdmi.conf create mode 100644 ucm2/sof-soundwire/HiFi.conf create mode 100644 ucm2/sof-soundwire/RT1308-1.conf create mode 100644 ucm2/sof-soundwire/RT711.conf create mode 100644 ucm2/sof-soundwire/RT715.conf create mode 100644 ucm2/sof-soundwire/sof-soundwire.conf diff --git a/ucm2/sof-soundwire/Hdmi.conf b/ucm2/sof-soundwire/Hdmi.conf new file mode 100644 index 000000000..d0ba7907e --- /dev/null +++ b/ucm2/sof-soundwire/Hdmi.conf @@ -0,0 +1,79 @@ +# Use case Configuration for sof-soundwire card + +If.hdmi1 { + Condition { + Type ControlExists + Control "iface=CARD,name='HDMI/DP,pcm=5 Jack'" + } + True { + SectionDevice."HDMI1" { + Comment "HDMI1/DP1 Output" + + EnableSequence [ + cset "name='IEC958 Playback Switch' on" + ] + + DisableSequence [ + cset "name='IEC958 Playback Switch' off" + ] + + Value { + PlaybackPriority 500 + PlaybackPCM "hw:${CardId},5" + JackControl "HDMI/DP,pcm=5 Jack" + } + } + } +} + +If.hdmi2 { + Condition { + Type ControlExists + Control "iface=CARD,name='HDMI/DP,pcm=6 Jack'" + } + True { + SectionDevice."HDMI2" { + Comment "HDMI2/DP2 Output" + + EnableSequence [ + cset "name='IEC958 Playback Switch',index=1 on" + ] + + DisableSequence [ + cset "name='IEC958 Playback Switch',index=1 off" + ] + + Value { + PlaybackPriority 600 + PlaybackPCM "hw:${CardId},6" + JackControl "HDMI/DP,pcm=6 Jack" + } + } + } +} + +If.hdmi3 { + Condition { + Type ControlExists + Control "iface=CARD,name='HDMI/DP,pcm=7 Jack'" + } + True { + SectionDevice."HDMI3" { + Comment "HDMI3/DP3 Output" + + EnableSequence [ + cset "name='IEC958 Playback Switch',index=2 on" + ] + + DisableSequence [ + cset "name='IEC958 Playback Switch',index=2 off" + ] + + Value { + PlaybackPriority 700 + PlaybackPCM "hw:${CardId},7" + JackControl "HDMI/DP,pcm=7 Jack" + } + } + } +} diff --git a/ucm2/sof-soundwire/HiFi.conf b/ucm2/sof-soundwire/HiFi.conf new file mode 100644 index 000000000..08ac5c9d6 --- /dev/null +++ b/ucm2/sof-soundwire/HiFi.conf @@ -0,0 +1,14 @@ +# Use case Configuration for sof-soundwire card + +SectionVerb { + + EnableSequence [ + cset "name='PGA1.0 1 Master Playback Volume' 80" + ] + +} + + + + + diff --git a/ucm2/sof-soundwire/RT1308-1.conf b/ucm2/sof-soundwire/RT1308-1.conf new file mode 100644 index 000000000..eb992410b --- /dev/null +++ b/ucm2/sof-soundwire/RT1308-1.conf @@ -0,0 +1,31 @@ +# Use case Configuration for sof-soundwire card + +If.RT1308-1 { + Condition { + Type String + Haystack "${CardComponents}" + Needle "spk:rt1308" + } + True { + + SectionDevice."Speaker" { + Comment "Speaker" + + EnableSequence [ + cset "name='rt1308-1 DAC L Switch' 1" + cset "name='rt1308-1 DAC R Switch' 1" + ] + + DisableSequence [ + cset "name='rt1308-1 DAC L Switch' 0" + cset "name='rt1308-1 DAC R Switch' 0" + ] + + Value { + PlaybackPriority 300 + PlaybackPCM "hw:${CardId},2" + PlaybackChannels "2" + } + } + } +} diff --git a/ucm2/sof-soundwire/RT711.conf b/ucm2/sof-soundwire/RT711.conf new file mode 100644 index 000000000..d8bfc14dd --- /dev/null +++ b/ucm2/sof-soundwire/RT711.conf @@ -0,0 +1,44 @@ +# Use case Configuration for sof-soundwire card + +If.RT711 { + Condition { + Type String + Haystack "${CardComponents}" + Needle "hs:rt711" + } + True { + + SectionDevice."Headphone" { + Comment "Headphone" + + EnableSequence [ + cset "name='rt711 DAC Surr Playback Volume' 87" + ] + + Value { + PlaybackPriority 200 + PlaybackPCM "hw:${CardId},0" + PlaybackChannels "2" + JackControl "Headphone Jack" + } + } + + SectionDevice."Microphone" { + Comment "Headset Mic" + + EnableSequence [ + cset "name='rt711 ADC 23 Mux' 'MIC2'" + cset "name='rt711 ADC 08 Capture Volume' 63" + cset "name='rt711 ADC 08 Capture Switch' 1" + cset "name='rt711 AMIC Volume' 1" + ] + + Value { + CapturePriority 200 + CapturePCM "hw:${CardId},1" + CaptureChannels "2" + JackControl "Headset Mic Jack" + } + } + } +} diff --git a/ucm2/sof-soundwire/RT715.conf b/ucm2/sof-soundwire/RT715.conf new file mode 100644 index 000000000..3a2385e51 --- /dev/null +++ b/ucm2/sof-soundwire/RT715.conf @@ -0,0 +1,35 @@ +# Use case Configuration for sof-soundwire card + +If.RT715 { + Condition { + Type String + Haystack "${CardComponents}" + Needle "mic:rt715" + } + True { + + SectionDevice."Dmic" { + Comment "SoundWire microphones" + + EnableSequence [ + cset "name='rt715 DMIC3 Boost' 2" + cset "name='rt715 DMIC4 Boost' 2" + cset "name='rt715 ADC 24 Mux' 3" + cset "name='rt715 ADC 25 Mux' 4" + cset "name='rt715 ADC 27 Capture Switch' 1" + cset "name='rt715 ADC 07 Capture Switch' 1" + ] + + DisableSequence [ + cset "name='rt715 ADC 27 Capture Switch' 0" + cset "name='rt715 ADC 07 Capture Switch' 0" + ] + + Value { + CapturePriority 300 + CapturePCM "hw:${CardId},4" + CaptureChannels "2" + } + } + } +} diff --git a/ucm2/sof-soundwire/sof-soundwire.conf b/ucm2/sof-soundwire/sof-soundwire.conf new file mode 100644 index 000000000..d7a051816 --- /dev/null +++ b/ucm2/sof-soundwire/sof-soundwire.conf @@ -0,0 +1,6 @@ +Syntax 2 + +SectionUseCase."HiFi" { + File "HiFi.conf" + Comment "Play HiFi quality Music" +} From 5315b0f2a5c63747bd536708c2b9da17e5f43d64 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Thu, 19 Mar 2020 18:04:48 -0500 Subject: [PATCH 2/6] sof-soundwire: add RT700 and RT5682 initial support Signed-off-by: Pierre-Louis Bossart --- ucm2/sof-soundwire/HiFi.conf | 2 + ucm2/sof-soundwire/RT5682.conf | 41 ++++++++++++++++++++ ucm2/sof-soundwire/RT700.conf | 71 ++++++++++++++++++++++++++++++++++ 3 files changed, 114 insertions(+) create mode 100644 ucm2/sof-soundwire/RT5682.conf create mode 100644 ucm2/sof-soundwire/RT700.conf diff --git a/ucm2/sof-soundwire/HiFi.conf b/ucm2/sof-soundwire/HiFi.conf index 08ac5c9d6..5bb3491d5 100644 --- a/ucm2/sof-soundwire/HiFi.conf +++ b/ucm2/sof-soundwire/HiFi.conf @@ -8,7 +8,9 @@ SectionVerb { } + + diff --git a/ucm2/sof-soundwire/RT5682.conf b/ucm2/sof-soundwire/RT5682.conf new file mode 100644 index 000000000..acab9c277 --- /dev/null +++ b/ucm2/sof-soundwire/RT5682.conf @@ -0,0 +1,41 @@ +# Use case Configuration for sof-soundwire card + +If.RT5682 { + Condition { + Type String + Haystack "${CardComponents}" + Needle "hs:rt5682" + } + True { + + SectionDevice."Headphone" { + Comment "Headphone" + + EnableSequence [ + + ] + + Value { + PlaybackPriority 200 + PlaybackPCM "hw:${CardId},0" + PlaybackChannels "2" + JackControl "Headphone Jack" + } + } + + SectionDevice."Microphone" { + Comment "Headset Mic" + + EnableSequence [ + + ] + + Value { + CapturePriority 200 + CapturePCM "hw:${CardId},1" + CaptureChannels "2" + JackControl "Headset Mic Jack" + } + } + } +} diff --git a/ucm2/sof-soundwire/RT700.conf b/ucm2/sof-soundwire/RT700.conf new file mode 100644 index 000000000..35f517420 --- /dev/null +++ b/ucm2/sof-soundwire/RT700.conf @@ -0,0 +1,71 @@ +# Use case Configuration for sof-soundwire card + +If.RT700 { + Condition { + Type String + Haystack "${CardComponents}" + Needle "hs:rt700" + } + True { + + SectionDevice."Headphone" { + Comment "Headphone" + + ConflictingDevice [ + "Speaker" + ] + + EnableSequence [ + + ] + + DisableSequence [ + + ] + + Value { + PlaybackPriority 200 + PlaybackPCM "hw:${CardId},0" + PlaybackChannels "2" + JackControl "Headphone Jack" + } + } + + SectionDevice."Speaker" { + Comment "Speaker" + + ConflictingDevice [ + "Headphone" + ] + + EnableSequence [ + + ] + + DisableSequence [ + + ] + + Value { + PlaybackPriority 300 + PlaybackPCM "hw:${CardId},0" + PlaybackChannels "2" + } + } + + SectionDevice."Microphone" { + Comment "Headset Mic" + + EnableSequence [ + + ] + + Value { + CapturePriority 200 + CapturePCM "hw:${CardId},1" + CaptureChannels "2" + JackControl "Headset Mic Jack" + } + } + } +} From b41fb1c19443e5f32ee52cb5f9982084230822d9 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Thu, 19 Mar 2020 19:04:19 -0500 Subject: [PATCH 3/6] sof-soundwire: add RT5682 settings Settings provided by M, Naveen Signed-off-by: Pierre-Louis Bossart --- ucm2/sof-soundwire/RT5682.conf | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/ucm2/sof-soundwire/RT5682.conf b/ucm2/sof-soundwire/RT5682.conf index acab9c277..d9b4892ab 100644 --- a/ucm2/sof-soundwire/RT5682.conf +++ b/ucm2/sof-soundwire/RT5682.conf @@ -12,7 +12,13 @@ If.RT5682 { Comment "Headphone" EnableSequence [ - + cset "name='Headphone Jack' on" + cset "name='rt5682 HPOL Playback Switch' 1" + cset "name='rt5682 HPOR Playback Switch' 1" + cset "name='rt5682 Stereo1 DAC MIXL DAC L1 Switch' 1" + cset "name='rt5682 Stereo1 DAC MIXR DAC R1 Switch' 1" + cset "name='rt5682 DAC L Mux' 1" + cset "name='rt5682 DAC R Mux' 1" ] Value { @@ -27,7 +33,13 @@ If.RT5682 { Comment "Headset Mic" EnableSequence [ - + cset "name='rt5682 RECMIX1L CBJ Switch' 1" + cset "name='rt5682 Stereo1 ADC MIXL ADC1 Switch' 1" + cset "name='rt5682 Stereo1 ADC MIXR ADC1 Switch' 1" + cset "name='rt5682 Stereo1 ADC L1 Mux' 1" + cset "name='rt5682 Stereo1 ADC R1 Mux' 1" + cset "name='rt5682 Stereo1 ADC L Mux' 0" + cset "name='rt5682 Stereo1 ADC R Mux' 0" ] Value { From 12ab70e86aca7132ad7c7dccda2e67793d1d30e0 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Fri, 27 Mar 2020 14:40:46 -0500 Subject: [PATCH 4/6] sof-soundwire: align with PR#28 Apply the values suggested by Libin in PR#28 The split between profiles is not done, not sure why it was needed in the first place. Signed-off-by: Pierre-Louis Bossart --- ucm2/sof-soundwire/HiFi.conf | 2 +- ucm2/sof-soundwire/RT1308-1.conf | 8 ++++++-- ucm2/sof-soundwire/RT711.conf | 13 +++++++++++++ ucm2/sof-soundwire/RT715.conf | 6 ++++++ 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/ucm2/sof-soundwire/HiFi.conf b/ucm2/sof-soundwire/HiFi.conf index 5bb3491d5..7966d5ec2 100644 --- a/ucm2/sof-soundwire/HiFi.conf +++ b/ucm2/sof-soundwire/HiFi.conf @@ -3,7 +3,7 @@ SectionVerb { EnableSequence [ - cset "name='PGA1.0 1 Master Playback Volume' 80" + cset "name='PGA1.0 1 Master Playback Volume' 50" ] } diff --git a/ucm2/sof-soundwire/RT1308-1.conf b/ucm2/sof-soundwire/RT1308-1.conf index eb992410b..fd12c6063 100644 --- a/ucm2/sof-soundwire/RT1308-1.conf +++ b/ucm2/sof-soundwire/RT1308-1.conf @@ -4,7 +4,7 @@ If.RT1308-1 { Condition { Type String Haystack "${CardComponents}" - Needle "spk:rt1308" + Needle "spk:rt1308" } True { @@ -12,13 +12,17 @@ If.RT1308-1 { Comment "Speaker" EnableSequence [ + cset "name='PGA3.0 3 Master Playback Volume' 50" + cset "name='rt1308-1 DAC L Switch' 1" cset "name='rt1308-1 DAC R Switch' 1" + cset "name='Speaker Switch' on" ] DisableSequence [ cset "name='rt1308-1 DAC L Switch' 0" - cset "name='rt1308-1 DAC R Switch' 0" + cset "name='rt1308-1 DAC R Switch' 0" + cset "name='Speaker Switch' off" ] Value { diff --git a/ucm2/sof-soundwire/RT711.conf b/ucm2/sof-soundwire/RT711.conf index d8bfc14dd..534692a23 100644 --- a/ucm2/sof-soundwire/RT711.conf +++ b/ucm2/sof-soundwire/RT711.conf @@ -13,6 +13,11 @@ If.RT711 { EnableSequence [ cset "name='rt711 DAC Surr Playback Volume' 87" + cset "name='Headphone Switch' on" + ] + + DisableSequence [ + cset "name='Headphone Switch' off" ] Value { @@ -31,6 +36,12 @@ If.RT711 { cset "name='rt711 ADC 08 Capture Volume' 63" cset "name='rt711 ADC 08 Capture Switch' 1" cset "name='rt711 AMIC Volume' 1" + + cset "name='PGA2.0 2 Master Capture Switch' 1" + ] + + DisableSequence [ + cset "name='PGA2.0 2 Master Capture Switch' 0" ] Value { @@ -38,6 +49,8 @@ If.RT711 { CapturePCM "hw:${CardId},1" CaptureChannels "2" JackControl "Headset Mic Jack" + CaptureSwitch "PGA2.0 2 Master Capture Switch" + CaptureVolume "PGA2.0 2 Master Capture Volume" } } } diff --git a/ucm2/sof-soundwire/RT715.conf b/ucm2/sof-soundwire/RT715.conf index 3a2385e51..2bc58b137 100644 --- a/ucm2/sof-soundwire/RT715.conf +++ b/ucm2/sof-soundwire/RT715.conf @@ -18,17 +18,23 @@ If.RT715 { cset "name='rt715 ADC 25 Mux' 4" cset "name='rt715 ADC 27 Capture Switch' 1" cset "name='rt715 ADC 07 Capture Switch' 1" + + cset "name='PGA5.0 5 Master Capture Switch' 1" ] DisableSequence [ cset "name='rt715 ADC 27 Capture Switch' 0" cset "name='rt715 ADC 07 Capture Switch' 0" + + cset "name='PGA5.0 5 Master Capture Switch' 0" ] Value { CapturePriority 300 CapturePCM "hw:${CardId},4" CaptureChannels "2" + CaptureSwitch "PGA5.0 5 Master Capture Switch" + CaptureVolume "PGA5.0 5 Master Capture Volume" } } } From 8907bc4e5e0ff61419ba55d613a908c455abb2e7 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Fri, 27 Mar 2020 14:59:19 -0500 Subject: [PATCH 5/6] sof-soundwire: update RT700 settings Use settings provided by @shumingfan Signed-off-by: Pierre-Louis Bossart --- ucm2/sof-soundwire/RT700.conf | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ucm2/sof-soundwire/RT700.conf b/ucm2/sof-soundwire/RT700.conf index 35f517420..292e90f81 100644 --- a/ucm2/sof-soundwire/RT700.conf +++ b/ucm2/sof-soundwire/RT700.conf @@ -16,7 +16,8 @@ If.RT700 { ] EnableSequence [ - + cset "name='DAC Front Playback Volume' 87" + cset "name='HPO Mux' 'Front'" ] DisableSequence [ @@ -39,7 +40,7 @@ If.RT700 { ] EnableSequence [ - + cset "name='DAC Front Playback Volume' 87" ] DisableSequence [ @@ -57,7 +58,14 @@ If.RT700 { Comment "Headset Mic" EnableSequence [ + cset "name='ADC 22 Mux' 'MIC2'" + cset "name='ADC 09 Capture Volume' 63" + cset "name='ADC 09 Capture Switch' 1" + cset "name='AMIC Volume' 1" + ] + DisableSequence [ + cset "name='ADC 09 Capture Switch' 0" ] Value { From a363784b7b5c90f01cbebb54054fa84b84e17baa Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Fri, 27 Mar 2020 14:59:57 -0500 Subject: [PATCH 6/6] sof-soundwire: update RT5682 settings Use settings provided by @shumingfan Signed-off-by: Pierre-Louis Bossart --- ucm2/sof-soundwire/RT5682.conf | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/ucm2/sof-soundwire/RT5682.conf b/ucm2/sof-soundwire/RT5682.conf index d9b4892ab..a43fa70fa 100644 --- a/ucm2/sof-soundwire/RT5682.conf +++ b/ucm2/sof-soundwire/RT5682.conf @@ -21,6 +21,11 @@ If.RT5682 { cset "name='rt5682 DAC R Mux' 1" ] + DisableSequence [ + cset "name='rt5682 HPOL Playback Switch' 0" + cset "name='rt5682 HPOR Playback Switch' 0" + ] + Value { PlaybackPriority 200 PlaybackPCM "hw:${CardId},0" @@ -33,13 +38,25 @@ If.RT5682 { Comment "Headset Mic" EnableSequence [ + cset "name='STO1 ADC Capture Switch' 1" cset "name='rt5682 RECMIX1L CBJ Switch' 1" - cset "name='rt5682 Stereo1 ADC MIXL ADC1 Switch' 1" - cset "name='rt5682 Stereo1 ADC MIXR ADC1 Switch' 1" - cset "name='rt5682 Stereo1 ADC L1 Mux' 1" - cset "name='rt5682 Stereo1 ADC R1 Mux' 1" + cset "name='IF1 01 ADC Swap Mux' 2" + cset "name='CBJ Boost Volume' 3" cset "name='rt5682 Stereo1 ADC L Mux' 0" cset "name='rt5682 Stereo1 ADC R Mux' 0" + cset "name='rt5682 Stereo1 ADC L1 Mux' 1" + cset "name='rt5682 Stereo1 ADC R1 Mux' 1" + cset "name='rt5682 Stereo1 ADC MIXL ADC2 Switch' 0" + cset "name='rt5682 Stereo1 ADC MIXR ADC2 Switch' 0" + cset "name='rt5682 Stereo1 ADC MIXL ADC1 Switch' 1" + cset "name='rt5682 Stereo1 ADC MIXR ADC1 Switch' 1" + ] + + DisableSequence [ + cset "name='STO1 ADC Capture Switch' 0" + cset "name='rt5682 RECMIX1L CBJ Switch' 0" + cset "name='rt5682 Stereo1 ADC MIXL ADC1 Switch' 0" + cset "name='rt5682 Stereo1 ADC MIXR ADC1 Switch' 0" ] Value {