From 5ecf083933ced6ad9efe85faefcb3eed61409944 Mon Sep 17 00:00:00 2001 From: WeirdTreeThing Date: Sat, 17 Jun 2023 23:17:26 -0400 Subject: [PATCH] tgl/*: use dmi matching, add rt5682vs variant of delbin --- tgl/sof-rt5682/Google-Delbin-rev3.conf | 8 - tgl/sof-rt5682/Google-Delbin-rev4.conf | 8 - tgl/sof-rt5682/Google-Eldrid-rev3.conf | 8 - tgl/sof-rt5682/Google-Elemi-rev3.conf | 8 - tgl/sof-rt5682/Google-Lillipup-rev3.conf | 8 - tgl/sof-rt5682/Google-Lindar-rev3.conf | 8 - tgl/sof-rt5682/Google-Lindar-rev4.conf | 8 - tgl/sof-rt5682/HiFi.conf | 114 ------------ .../{HiFi-Delbin.conf => HiFi.delbin.conf} | 0 tgl/sof-rt5682/HiFi.delbin.rt5682vs.conf | 173 ++++++++++++++++++ .../{HiFi-Eldrid.conf => HiFi.eldrid.conf} | 0 .../{HiFi-Elemi.conf => HiFi.elemi.conf} | 0 ...{HiFi-Lillipup.conf => HiFi.lillipup.conf} | 0 tgl/sof-rt5682/sof-rt5682.conf | 64 ++++++- 14 files changed, 232 insertions(+), 175 deletions(-) delete mode 100644 tgl/sof-rt5682/Google-Delbin-rev3.conf delete mode 100644 tgl/sof-rt5682/Google-Delbin-rev4.conf delete mode 100644 tgl/sof-rt5682/Google-Eldrid-rev3.conf delete mode 100644 tgl/sof-rt5682/Google-Elemi-rev3.conf delete mode 100644 tgl/sof-rt5682/Google-Lillipup-rev3.conf delete mode 100644 tgl/sof-rt5682/Google-Lindar-rev3.conf delete mode 100644 tgl/sof-rt5682/Google-Lindar-rev4.conf delete mode 100644 tgl/sof-rt5682/HiFi.conf rename tgl/sof-rt5682/{HiFi-Delbin.conf => HiFi.delbin.conf} (100%) create mode 100644 tgl/sof-rt5682/HiFi.delbin.rt5682vs.conf rename tgl/sof-rt5682/{HiFi-Eldrid.conf => HiFi.eldrid.conf} (100%) rename tgl/sof-rt5682/{HiFi-Elemi.conf => HiFi.elemi.conf} (100%) rename tgl/sof-rt5682/{HiFi-Lillipup.conf => HiFi.lillipup.conf} (100%) diff --git a/tgl/sof-rt5682/Google-Delbin-rev3.conf b/tgl/sof-rt5682/Google-Delbin-rev3.conf deleted file mode 100644 index ecede82..0000000 --- a/tgl/sof-rt5682/Google-Delbin-rev3.conf +++ /dev/null @@ -1,8 +0,0 @@ -Syntax 6 - -Comment "Tigerlake internal card" - -SectionUseCase."HiFi" { - File "HiFi-Delbin.conf" - Comment "Default" -} diff --git a/tgl/sof-rt5682/Google-Delbin-rev4.conf b/tgl/sof-rt5682/Google-Delbin-rev4.conf deleted file mode 100644 index ecede82..0000000 --- a/tgl/sof-rt5682/Google-Delbin-rev4.conf +++ /dev/null @@ -1,8 +0,0 @@ -Syntax 6 - -Comment "Tigerlake internal card" - -SectionUseCase."HiFi" { - File "HiFi-Delbin.conf" - Comment "Default" -} diff --git a/tgl/sof-rt5682/Google-Eldrid-rev3.conf b/tgl/sof-rt5682/Google-Eldrid-rev3.conf deleted file mode 100644 index a468b96..0000000 --- a/tgl/sof-rt5682/Google-Eldrid-rev3.conf +++ /dev/null @@ -1,8 +0,0 @@ -Syntax 6 - -Comment "Tigerlake internal card" - -SectionUseCase."HiFi" { - File "HiFi-Eldrid.conf" - Comment "Default" -} diff --git a/tgl/sof-rt5682/Google-Elemi-rev3.conf b/tgl/sof-rt5682/Google-Elemi-rev3.conf deleted file mode 100644 index ea2cac1..0000000 --- a/tgl/sof-rt5682/Google-Elemi-rev3.conf +++ /dev/null @@ -1,8 +0,0 @@ -Syntax 6 - -Comment "Tigerlake internal card" - -SectionUseCase."HiFi" { - File "HiFi-Elemi.conf" - Comment "Default" -} diff --git a/tgl/sof-rt5682/Google-Lillipup-rev3.conf b/tgl/sof-rt5682/Google-Lillipup-rev3.conf deleted file mode 100644 index cf0d8e9..0000000 --- a/tgl/sof-rt5682/Google-Lillipup-rev3.conf +++ /dev/null @@ -1,8 +0,0 @@ -Syntax 6 - -Comment "Tigerlake internal card" - -SectionUseCase."HiFi" { - File "HiFi-Lillipup.conf" - Comment "Default" -} diff --git a/tgl/sof-rt5682/Google-Lindar-rev3.conf b/tgl/sof-rt5682/Google-Lindar-rev3.conf deleted file mode 100644 index cf0d8e9..0000000 --- a/tgl/sof-rt5682/Google-Lindar-rev3.conf +++ /dev/null @@ -1,8 +0,0 @@ -Syntax 6 - -Comment "Tigerlake internal card" - -SectionUseCase."HiFi" { - File "HiFi-Lillipup.conf" - Comment "Default" -} diff --git a/tgl/sof-rt5682/Google-Lindar-rev4.conf b/tgl/sof-rt5682/Google-Lindar-rev4.conf deleted file mode 100644 index cf0d8e9..0000000 --- a/tgl/sof-rt5682/Google-Lindar-rev4.conf +++ /dev/null @@ -1,8 +0,0 @@ -Syntax 6 - -Comment "Tigerlake internal card" - -SectionUseCase."HiFi" { - File "HiFi-Lillipup.conf" - Comment "Default" -} diff --git a/tgl/sof-rt5682/HiFi.conf b/tgl/sof-rt5682/HiFi.conf deleted file mode 100644 index 4546530..0000000 --- a/tgl/sof-rt5682/HiFi.conf +++ /dev/null @@ -1,114 +0,0 @@ -SectionVerb { - Value { - FullySpecifiedUCM "1" - } - EnableSequence [ - cset "name='Left DAI Sel Mux' Right" - cset "name='Right DAI Sel Mux' Left" - cset "name='Left Digital Volume' 127" - cset "name='Right Digital Volume' 127" - cset "name='Left FS Max Volume' 7" - cset "name='Right FS Max Volume' 7" - - cset "name='Headphone Jack Switch' off" - cset "name='HPOL Playback Switch' off" - cset "name='HPOR Playback Switch' off" - cset "name='Stereo1 DAC MIXL DAC L1 Switch' 1" - cset "name='Stereo1 DAC MIXR DAC R1 Switch' 1" - cset "name='Stereo1 ADC L Mux' 0" - cset "name='STO1 ADC Capture Switch' on" - cset "name='RECMIX1L CBJ Switch' 1" - cset "name='IF1 01 ADC Swap Mux' 2" - cset "name='CBJ Boost Volume' 3" - cset "name='Stereo1 ADC L1 Mux' 1" - cset "name='Stereo1 ADC R1 Mux' 1" - cset "name='Stereo1 ADC MIXL ADC2 Switch' 0" - cset "name='Stereo1 ADC MIXR ADC2 Switch' 0" - cset "name='Stereo1 ADC MIXL ADC1 Switch' 1" - cset "name='Stereo1 ADC MIXR ADC1 Switch' 1" - ] - DisableSequence [ - ] -} - -SectionDevice."Speaker" { - Comment "Speaker" - - Value { - PlaybackPriority 100 - PlaybackPCM "hw:sofrt5682" - EchoReferenceDev "Echo Reference" - } - EnableSequence [ - cset "name='Left VI Sense Switch' on" - cset "name='Left Spk Switch' on" - cset "name='Right VI Sense Switch' on" - cset "name='Right Spk Switch' on" - ] - DisableSequence [ - cset "name='Left VI Sense Switch' off" - cset "name='Left Spk Switch' off" - cset "name='Right VI Sense Switch' off" - cset "name='Right Spk Switch' off" - ] -} - -SectionDevice."Headphones" { - Comment "Headphones" - - Value { - PlaybackPriority 200 - PlaybackPCM "hw:sofrt5682,1" - PlaybackMixerElem "DAC1" - JackControl "Headphone Jack" - } - EnableSequence [ - cset "name='Headphone Jack Switch' on" - cset "name='HPOL Playback Switch' 1" - cset "name='HPOR Playback Switch' 1" - ] - DisableSequence [ - cset "name='Headphone Jack Switch' off" - cset "name='HPOL Playback Switch' 0" - cset "name='HPOR Playback Switch' 0" - - ] -} - -SectionDevice."Echo Reference" { - Comment "Echo Reference" - - Value { - CapturePCM "hw:sofrt5682,0" - } -} - -SectionDevice."Mic" { - Comment "Internal Microphone" - - Value { - CapturePriority 100 - CapturePCM "hw:sofrt5682,99" - CaptureChannels 4 - } -} - -SectionDevice."Headset" { - Comment "Headset Microphone" - - Value { - CapturePriority 200 - CapturePCM "hw:sofrt5682,1" - CaptureMixerElem "Headset Mic" - JackControl "Headset Mic Jack" -} - EnableSequence [ - cset "name='Headset Mic Switch' on" -] - DisableSequence [ - cset "name='Headset Mic Switch' off" - - ] -} - -Include.hdmi.File "/conf.d/hdmi-common/hdmi345.conf" diff --git a/tgl/sof-rt5682/HiFi-Delbin.conf b/tgl/sof-rt5682/HiFi.delbin.conf similarity index 100% rename from tgl/sof-rt5682/HiFi-Delbin.conf rename to tgl/sof-rt5682/HiFi.delbin.conf diff --git a/tgl/sof-rt5682/HiFi.delbin.rt5682vs.conf b/tgl/sof-rt5682/HiFi.delbin.rt5682vs.conf new file mode 100644 index 0000000..a804b35 --- /dev/null +++ b/tgl/sof-rt5682/HiFi.delbin.rt5682vs.conf @@ -0,0 +1,173 @@ +SectionVerb { + Value { + FullySpecifiedUCM "1" + } + EnableSequence [ + cset "name='Left DAI Sel Mux' Right" + cset "name='Right DAI Sel Mux' Left" + cset "name='Left Digital Volume' 127" + cset "name='Right Digital Volume' 127" + cset "name='Left FS Max Volume' 7" + cset "name='Right FS Max Volume' 7" + + cset "name='Stereo1 DAC MIXL DAC L1 Switch' off" + cset "name='Stereo1 DAC MIXR DAC R1 Switch' off" + cset "name='RECMIX1L CBJ Switch' on" + cset "name='IF1 01 ADC Swap Mux' L/L" + cset "name='CBJ Boost Volume' 28" + cset "name='Stereo1 ADC L Mux' ADC1 L" + cset "name='Stereo1 ADC L1 Mux' ADC" + cset "name='Stereo1 ADC MIXL ADC2 Switch' off" + cset "name='Stereo1 ADC MIXL ADC1 Switch' on" + ] +} + +# Split 4ch dmic into 2 virtual 2ch mics +Include.pcm_split.File "/conf.d/dmic-common/split.conf" + +Macro [ + { + SplitPCM { + Name "tgl_stereo_in" + Direction Capture + Format S32_LE + Channels 2 + HWChannels 4 + HWChannelPos0 FL + HWChannelPos1 FR + HWChannelPos2 FL + HWChannelPos3 FR + } + } +] + +Include.ctl_remap.File "/conf.d/dmic-common/remap.conf" + +Macro [ + { + CtlRemapStereoVolSw { + Dst "Mic 1 Capture" + Src "STO1 ADC Capture" + Index0 0 + Index1 1 + } + } + { + CtlRemapStereoVolSw { + Dst "Mic 2 Capture" + Src "STO1 ADC Capture" + Index0 2 + Index1 3 + } + } +] + +SectionDevice."Speaker" { + Comment "Speaker" + + Value { + PlaybackPriority 100 + PlaybackPCM "hw:${CardId},0" + EchoReferenceDev "Echo Reference" + } + EnableSequence [ + cset "name='Left VI Sense Switch' on" + cset "name='Right VI Sense Switch' on" + ] + DisableSequence [ + cset "name='Left VI Sense Switch' off" + cset "name='Right VI Sense Switch' off" + ] +} + +SectionDevice."Headphones" { + Comment "Headphones" + + Value { + PlaybackPriority 200 + PlaybackPCM "hw:${CardId},1" + PlaybackMixerElem "DAC1" + JackControl "Headphone Jack" + } + EnableSequence [ + cset "name='Headphone Jack Switch' on" + cset "name='Stereo1 DAC MIXL DAC L1 Switch' 1" + cset "name='Stereo1 DAC MIXR DAC R1 Switch' 1" + ] + DisableSequence [ + cset "name='Headphone Jack Switch' off" + cset "name='Stereo1 DAC MIXL DAC L1 Switch' 0" + cset "name='Stereo1 DAC MIXR DAC R1 Switch' 0" + + ] +} + +SectionDevice."Echo Reference" { + Comment "Echo Reference" + + Value { + CapturePCM "hw:${CardId},0" + } +} + +SectionDevice."Mic" { + Comment "Front Mic" + + Value { + CapturePriority 100 + CapturePCM "hw:${CardId},99" + CaptureChannels 4 + } + Macro.pcm_split.SplitPCMDevice { + Name "tgl_stereo_in" + Direction Capture + Device 99 + HWChannels 4 + Channels 2 + Channel0 1 + Channel1 0 + ChannelPos0 FL + ChannelPos1 FR + } +} + +SectionDevice."Mic 1" { + Comment "Rear Mic" + + Value { + CapturePriority 100 + CapturePCM "hw:${CardId},99" + CaptureChannels 4 + } + Macro.pcm_split.SplitPCMDevice { + Name "tgl_stereo_in" + Direction Capture + Device 99 + HWChannels 4 + Channels 2 + Channel0 2 + Channel1 2 + ChannelPos0 FL + ChannelPos1 FR + } +} + +SectionDevice."Headset" { + Comment "Headset Microphone" + + Value { + CapturePriority 200 + CapturePCM "hw:${CardId},1" + CaptureMixerElem "Headset Mic" + JackControl "Headset Mic Jack" +} + EnableSequence [ + cset "name='Headset Mic Switch' on" + ] + DisableSequence [ + cset "name='Headset Mic Switch' off" + + ] +} + +Include.hdmi.File "/conf.d/hdmi-common/hdmi2345.conf" diff --git a/tgl/sof-rt5682/HiFi-Eldrid.conf b/tgl/sof-rt5682/HiFi.eldrid.conf similarity index 100% rename from tgl/sof-rt5682/HiFi-Eldrid.conf rename to tgl/sof-rt5682/HiFi.eldrid.conf diff --git a/tgl/sof-rt5682/HiFi-Elemi.conf b/tgl/sof-rt5682/HiFi.elemi.conf similarity index 100% rename from tgl/sof-rt5682/HiFi-Elemi.conf rename to tgl/sof-rt5682/HiFi.elemi.conf diff --git a/tgl/sof-rt5682/HiFi-Lillipup.conf b/tgl/sof-rt5682/HiFi.lillipup.conf similarity index 100% rename from tgl/sof-rt5682/HiFi-Lillipup.conf rename to tgl/sof-rt5682/HiFi.lillipup.conf diff --git a/tgl/sof-rt5682/sof-rt5682.conf b/tgl/sof-rt5682/sof-rt5682.conf index fb440b4..bc0bd0b 100644 --- a/tgl/sof-rt5682/sof-rt5682.conf +++ b/tgl/sof-rt5682/sof-rt5682.conf @@ -1,8 +1,62 @@ Syntax 6 -Comment "Tigerlake internal card" - -SectionUseCase."HiFi" { - File "HiFi.conf" - Comment "Default" +If.delbin { + Condition { + Type String + Haystack "${sys:devices/virtual/dmi/id/product_name}" + Needle "Delbin" + } + True { + If.rt5682vs { + Condition { + Type RegexMatch + Regex "^sku(65541)$" + String "${sys:devices/virtual/dmi/id/product_sku}" + } + True.SectionUseCase."HiFi" { + File "HiFi.delbin.rt5682vs.conf" + Comment "Default" + } + False.SectionUseCase."HiFi" { + File "HiFi.delbin.conf" + Comment "Default" + } + } + } +} + +If.elemi { + Condition { + Type String + Haystack "${sys:devices/virtual/dmi/id/product_name}" + Needle "Elemi" + } + True.SectionUseCase."HiFi" { + File "HiFi.elemi.conf" + Comment "Default" + } +} + +If.eldrid { + Condition { + Type String + Haystack "${sys:devices/virtual/dmi/id/product_name}" + Needle "Eldrid" + } + True.SectionUseCase."HiFi" { + File "HiFi.eldrid.conf" + Comment "Default" + } +} + +If.lillipup { + Condition { + Type RegexMatch + Regex "^(Lillipup|Lindar)$" + String "${sys:devices/virtual/dmi/id/product_name}" + } + True.SectionUseCase."HiFi" { + File "HiFi.lillipup.conf" + Comment "Default" + } }