From fd175b25fcda2e82973a87af759da966a95804ce Mon Sep 17 00:00:00 2001 From: WeirdTreeThing Date: Sun, 24 Nov 2024 17:37:55 -0500 Subject: [PATCH] Pull in changes from main repo --- ucm2/codecs/nau8825/init.conf | 7 ++ ucm2/conf.d/avs_dmic/HiFi.conf | 57 +++-------- ucm2/conf.d/avs_max98373/HiFi.conf | 2 +- ucm2/conf.d/avs_max98927/HiFi.conf | 2 +- ucm2/conf.d/avs_nau8825/HiFi.conf | 2 +- ucm2/conf.d/avs_rt5514/HiFi.conf | 21 ++++ ucm2/conf.d/avs_rt5514/avs_rt5514.conf | 10 ++ ucm2/conf.d/avs_ssm4567-adi/HiFi.conf | 2 +- .../HiFi.conf} | 26 +++-- .../sof-glkda7219ma/sof-glkda7219ma.conf | 8 ++ .../sof-nau8825/{HiFi.kano.conf => HiFi.conf} | 58 ++++------- ucm2/conf.d/sof-nau8825/sof-nau8825.conf | 27 ++---- ucm2/conf.d/sof-rt5682/rt5682-headset.conf | 17 ++++ ucm2/conf.d/sof-rt5682/rt5682-init.conf | 11 ++- ucm2/conf.d/sof-rt5682/sof-rt5682.conf | 2 +- ucm2/platforms/intel-sof/codecs.conf | 95 +++++++++++++++++++ 16 files changed, 223 insertions(+), 124 deletions(-) create mode 100644 ucm2/codecs/nau8825/init.conf create mode 100644 ucm2/conf.d/avs_rt5514/HiFi.conf create mode 100644 ucm2/conf.d/avs_rt5514/avs_rt5514.conf rename ucm2/conf.d/{sof-nau8825/HiFi.osiris.conf => sof-glkda7219ma/HiFi.conf} (80%) create mode 100644 ucm2/conf.d/sof-glkda7219ma/sof-glkda7219ma.conf rename ucm2/conf.d/sof-nau8825/{HiFi.kano.conf => HiFi.conf} (52%) create mode 100644 ucm2/platforms/intel-sof/codecs.conf diff --git a/ucm2/codecs/nau8825/init.conf b/ucm2/codecs/nau8825/init.conf new file mode 100644 index 00000000..72aaea7f --- /dev/null +++ b/ucm2/codecs/nau8825/init.conf @@ -0,0 +1,7 @@ +# NAU8825 specific volume control settings + +BootSequence [ + cset "name='Mic Volume' 230" + cset "name='Frontend PGA Volume' 24" +] + diff --git a/ucm2/conf.d/avs_dmic/HiFi.conf b/ucm2/conf.d/avs_dmic/HiFi.conf index b54a6dda..6f0da6ff 100644 --- a/ucm2/conf.d/avs_dmic/HiFi.conf +++ b/ucm2/conf.d/avs_dmic/HiFi.conf @@ -1,5 +1,5 @@ -SectionVerb { -} +# Stock firmware exposes a 4ch dmic while MrChromebox firmware exposes a 2ch dmic for windows support +# Stock firmware version string includes "Google_" while MrChromebox firmware string is "MrChromebox-" If.4ch { Condition { @@ -7,48 +7,19 @@ If.4ch { Haystack "${sys:devices/virtual/dmi/id/bios_version}" Needle "Google" } - True { - SectionDevice."Internal Mic" { - Comment "Internal Microphone" + True.Define.DmicChannels 4 + False.Define.DmicChannels 2 +} - Value { - CapturePriority 100 - CapturePCM "hw:${CardId},2" - CaptureChannels 4 - } - If.dspvol { - Condition { - Type ControlExists - Control "name='DMIC FE DMIC Volume'" - } - True { - EnableSequence [ - cset "name='DMIC FE DMIC Volume' 2147483647" - ] - } - } - } - } - False { - SectionDevice."Internal Mic" { - Comment "Internal Microphone" +SectionDevice."Internal Mic" { + Comment "Internal Microphone" - Value { - CapturePriority 100 - CapturePCM "hw:${CardId},2" - CaptureChannels 2 - } - If.dspvol { - Condition { - Type ControlExists - Control "name='DMIC FE DMIC Volume'" - } - True { - EnableSequence [ - cset "name='DMIC FE DMIC Volume' 2147483647" - ] - } - } - } + Value { + CapturePriority 100 + CapturePCM "hw:${CardId},2" + CaptureChannels "${var:DmicChannels}" } + EnableSequence [ + cset "name='DMIC Volume' 2147483647" + ] } diff --git a/ucm2/conf.d/avs_max98373/HiFi.conf b/ucm2/conf.d/avs_max98373/HiFi.conf index ddb21800..1a4a4e93 100644 --- a/ucm2/conf.d/avs_max98373/HiFi.conf +++ b/ucm2/conf.d/avs_max98373/HiFi.conf @@ -68,7 +68,7 @@ SectionVerb { cset "name='Right Digital Vol Sel Switch' 1" cset "name='Left Spk Switch' off" cset "name='Right Spk Switch' off" - cset "name='ssp0p_fe DSP Volume' 1073741823" + cset "name='DSP Volume' 1073741823" ] } SectionDevice."Speaker" { diff --git a/ucm2/conf.d/avs_max98927/HiFi.conf b/ucm2/conf.d/avs_max98927/HiFi.conf index 046f8616..222f4efd 100644 --- a/ucm2/conf.d/avs_max98927/HiFi.conf +++ b/ucm2/conf.d/avs_max98927/HiFi.conf @@ -8,7 +8,7 @@ SectionVerb { cset "name='Right Digital Volume' 56" cset "name='Left Current Limit' 3.00A" cset "name='Right Current Limit' 3.00A" - cset "name='ssp0p_fe DSP Volume' 1073741823" + cset "name='DSP Volume' 1073741823" ] } SectionDevice."Speaker" { diff --git a/ucm2/conf.d/avs_nau8825/HiFi.conf b/ucm2/conf.d/avs_nau8825/HiFi.conf index 3a4f1b54..53460068 100644 --- a/ucm2/conf.d/avs_nau8825/HiFi.conf +++ b/ucm2/conf.d/avs_nau8825/HiFi.conf @@ -31,7 +31,7 @@ SectionDevice."Mic" { CapturePriority 200 CapturePCM "hw:${CardId},1" CaptureMixerElem "Headset Mic" - JackControl "Headphone Jack" + JackControl "Headset Mic Jack" } EnableSequence [ diff --git a/ucm2/conf.d/avs_rt5514/HiFi.conf b/ucm2/conf.d/avs_rt5514/HiFi.conf new file mode 100644 index 00000000..03840886 --- /dev/null +++ b/ucm2/conf.d/avs_rt5514/HiFi.conf @@ -0,0 +1,21 @@ +SectionDevice."Mic" { + Comment "Internal Microphone" + + Value { + CapturePCM "hw:${CardId},1" + CaptureChannels 4 + } + EnableSequence [ + cset "name='Sto1 ADC MIXL DMIC Switch' on" + cset "name='Sto1 ADC MIXR DMIC Switch' on" + cset "name='Sto2 ADC MIXL DMIC Switch' on" + cset "name='Sto2 ADC MIXR DMIC Switch' on" + ] + DisableSequence [ + cset "name='Sto1 ADC MIXL DMIC Switch' off" + cset "name='Sto1 ADC MIXR DMIC Switch' off" + cset "name='Sto2 ADC MIXL DMIC Switch' off" + cset "name='Sto2 ADC MIXR DMIC Switch' off" + ] +} + diff --git a/ucm2/conf.d/avs_rt5514/avs_rt5514.conf b/ucm2/conf.d/avs_rt5514/avs_rt5514.conf new file mode 100644 index 00000000..36ece3e3 --- /dev/null +++ b/ucm2/conf.d/avs_rt5514/avs_rt5514.conf @@ -0,0 +1,10 @@ +Syntax 6 + +SectionUseCase."HiFi" { + File "HiFi.conf" +} + +BootSequence [ + cset "name='ADC1 Capture Volume' 55" + cset "name='ADC2 Capture Volume' 55" +] diff --git a/ucm2/conf.d/avs_ssm4567-adi/HiFi.conf b/ucm2/conf.d/avs_ssm4567-adi/HiFi.conf index c6fb7416..aeda430c 100644 --- a/ucm2/conf.d/avs_ssm4567-adi/HiFi.conf +++ b/ucm2/conf.d/avs_ssm4567-adi/HiFi.conf @@ -8,7 +8,7 @@ SectionVerb { cset "name='Right DAC Low Power Mode Switch' on" cset "name='Left Master Playback Volume' 219" cset "name='Right Master Playback Volume' 219" - cset "name='ssp0p_fe DSP Volume' 858993480" + cset "name='DSP Volume' 858993480" ] } diff --git a/ucm2/conf.d/sof-nau8825/HiFi.osiris.conf b/ucm2/conf.d/sof-glkda7219ma/HiFi.conf similarity index 80% rename from ucm2/conf.d/sof-nau8825/HiFi.osiris.conf rename to ucm2/conf.d/sof-glkda7219ma/HiFi.conf index 7aea1d20..227658ee 100644 --- a/ucm2/conf.d/sof-nau8825/HiFi.osiris.conf +++ b/ucm2/conf.d/sof-glkda7219ma/HiFi.conf @@ -1,19 +1,12 @@ -SectionVerb { - EnableSequence [ - cset "name='Mic Volume' 230" - cset "name='Frontend PGA Volume' 24" - ] -} - # Split 4ch dmic into 2 virtual 2ch mics Include.pcm_split.File "/common/pcm/split.conf" Macro [ { SplitPCM { - Name "adl_stereo_in" + Name "glk_stereo_in" Direction Capture - Format S32_LE + Format S16_LE Channels 2 HWChannels 4 HWChannelPos0 FL @@ -45,26 +38,29 @@ SectionDevice."Headphones" { Value { PlaybackPriority 200 PlaybackPCM "hw:${CardId},1" + PlaybackMixerElem "Headphone" JackControl "Headphone Jack" } EnableSequence [ cset "name='Headphone Jack Switch' on" + cset "name='Headphone Switch' 1" ] DisableSequence [ cset "name='Headphone Jack Switch' off" + cset "name='Headphone Switch' 0" ] } SectionDevice."Mic" { Comment "Internal Microphone" - Value { + Value { CapturePriority 100 - CapturePCM "hw:${CardId},99" + CapturePCM "hw:${CardId},99" CaptureChannels 4 - } + } Macro.pcm_split.SplitPCMDevice { - Name "adl_stereo_in" + Name "glk_stereo_in" Direction Capture Device 99 HWChannels 4 @@ -87,10 +83,12 @@ SectionDevice."Headset" { } EnableSequence [ cset "name='Headset Mic Switch' on" + cset "name='Mic Switch' on" ] DisableSequence [ cset "name='Headset Mic Switch' off" + cset "name='Mic Switch' off" ] } -Include.hdmi.File "/codecs/hda/hdmi2345.conf" +Include.hdmi.File "/codecs/hda/hdmi567.conf" diff --git a/ucm2/conf.d/sof-glkda7219ma/sof-glkda7219ma.conf b/ucm2/conf.d/sof-glkda7219ma/sof-glkda7219ma.conf new file mode 100644 index 00000000..14126dd6 --- /dev/null +++ b/ucm2/conf.d/sof-glkda7219ma/sof-glkda7219ma.conf @@ -0,0 +1,8 @@ +Syntax 6 + +SectionUseCase."HiFi" { + File "HiFi.conf" + Comment "Default" +} + +Include.codec-init.File "/codecs/da7219/init.conf" diff --git a/ucm2/conf.d/sof-nau8825/HiFi.kano.conf b/ucm2/conf.d/sof-nau8825/HiFi.conf similarity index 52% rename from ucm2/conf.d/sof-nau8825/HiFi.kano.conf rename to ucm2/conf.d/sof-nau8825/HiFi.conf index ea827e17..1dc4ba41 100644 --- a/ucm2/conf.d/sof-nau8825/HiFi.kano.conf +++ b/ucm2/conf.d/sof-nau8825/HiFi.conf @@ -1,16 +1,3 @@ -SectionVerb { - EnableSequence [ - cset "name='Frontend PGA Volume' 12" - cset "name='Mic Volume' 255" - 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' 6" - cset "name='Right FS Max Volume' 6" - ] -} - # Split 4ch dmic into 2 virtual 2ch mics Include.pcm_split.File "/common/pcm/split.conf" @@ -30,28 +17,21 @@ Macro [ } ] -SectionDevice."Speaker" { - Comment "Internal Speakers" +If.max98360a { + Condition { + Type String + Empty "$${var:max98360a}" + } + False.Include.speaker.File "/codecs/max98357a/speaker.conf" +} - Value { - PlaybackPriority 100 - PlaybackPCM "hw:${CardId},0" - EchoReferenceDev "Echo Reference" + +If.max98373 { + Condition { + Type String + Empty "$${var:max98373}" } - EnableSequence [ - cset "name='Spk Switch' on" - cset "name='Left Spk Switch' on" - cset "name='Right Spk Switch' on" - cset "name='Left VI Sense Switch' on" - cset "name='Right VI Sense Switch' on" - ] - DisableSequence [ - cset "name='Spk Switch' off" - cset "name='Left Spk Switch' off" - cset "name='Right Spk Switch' off" - cset "name='Left VI Sense Switch' off" - cset "name='Right VI Sense Switch' off" - ] + False.Include.speaker.File "/codecs/max98373/speaker.conf" } SectionDevice."Headphones" { @@ -70,24 +50,18 @@ SectionDevice."Headphones" { ] } -SectionDevice."Echo Reference" { - Value { - CapturePCM "hw:${CardId},0" - } -} - SectionDevice."Mic" { Comment "Internal Microphone" Value { CapturePriority 100 - CapturePCM "hw:${CardId},99" + CapturePCM "hw:${CardId},${var:dmicpcm}" CaptureChannels 4 } Macro.pcm_split.SplitPCMDevice { Name "adl_stereo_in" Direction Capture - Device 99 + Device "${var:dmicpcm}" HWChannels 4 Channels 2 Channel0 0 @@ -114,4 +88,4 @@ SectionDevice."Headset" { ] } -Include.hdmi.File "/codecs/hda/hdmi2345.conf" +Include.hdmi.File "/codecs/hda/${var:hdmi}.conf" diff --git a/ucm2/conf.d/sof-nau8825/sof-nau8825.conf b/ucm2/conf.d/sof-nau8825/sof-nau8825.conf index 941d80a5..25ab2668 100644 --- a/ucm2/conf.d/sof-nau8825/sof-nau8825.conf +++ b/ucm2/conf.d/sof-nau8825/sof-nau8825.conf @@ -1,25 +1,18 @@ Syntax 6 -If.osiris { - Condition { - Type String - Haystack "${sys:devices/virtual/dmi/id/product_name}" - Needle "Osiris" - } - True.SectionUseCase."HiFi" { - File "HiFi.osiris.conf" - Comment "Default" - } +SectionUseCase."HiFi" { + File "HiFi.conf" + Comment "Default" } -If.kano { +Include.platform.File "/platforms/intel-sof/platform.conf" +Include.codec.File "/platforms/intel-sof/codecs.conf" +Include.codec-init.File "/codecs/nau8825/init.conf" + +If.max98373 { Condition { Type String - Haystack "${sys:devices/virtual/dmi/id/product_name}" - Needle "Kano" - } - True.SectionUseCase."HiFi" { - File "HiFi.kano.conf" - Comment "Default" + Empty "$${var:max98373}" } + False.Include.max98373-init.File "/codecs/max98373/init.conf" } diff --git a/ucm2/conf.d/sof-rt5682/rt5682-headset.conf b/ucm2/conf.d/sof-rt5682/rt5682-headset.conf index 36b56a82..9226080a 100644 --- a/ucm2/conf.d/sof-rt5682/rt5682-headset.conf +++ b/ucm2/conf.d/sof-rt5682/rt5682-headset.conf @@ -28,3 +28,20 @@ SectionDevice."Headphones" { ] } + +SectionDevice."Headset" { + Comment "Headset Microphone" + + Value { + CapturePriority 200 + CapturePCM "hw:${CardId},${var:pcm}" + CaptureMixerElem "Headset Mic" + JackControl "Headset Mic Jack" +} + EnableSequence [ + cset "name='Headset Mic Switch' on" +] + DisableSequence [ + cset "name='Headset Mic Switch' off" + ] +} diff --git a/ucm2/conf.d/sof-rt5682/rt5682-init.conf b/ucm2/conf.d/sof-rt5682/rt5682-init.conf index f976d520..0c5d8190 100644 --- a/ucm2/conf.d/sof-rt5682/rt5682-init.conf +++ b/ucm2/conf.d/sof-rt5682/rt5682-init.conf @@ -7,8 +7,13 @@ BootSequence [ cset "name='HPOR Playback Switch' off" cset "name='Stereo1 DAC MIXL DAC L1 Switch' 0" cset "name='Stereo1 DAC MIXR DAC R1 Switch' 0" - cset "name='RECMIX1L CBJ Switch' 0" + cset "name='RECMIX1L CBJ Switch' 1" cset "name='Stereo1 ADC L Mux' 0" - cset "name='Stereo1 ADC MIXL ADC1 Switch' 0" - cset "name='Stereo1 ADC MIXR ADC1 Switch' 0" + cset "name='Stereo1 ADC MIXL ADC1 Switch' 1" + cset "name='Stereo1 ADC MIXR ADC1 Switch' 1" + cset "name='CBJ Boost Volume' 3" + cset "name='Stereo1 ADC L1 Mux' 1" + cset "name='Stereo1 ADC R1 Mux' 1" + cset "name='IF1 01 ADC Swap Mux' 2" + cset "name='STO1 ADC Capture Switch' 1" ] diff --git a/ucm2/conf.d/sof-rt5682/sof-rt5682.conf b/ucm2/conf.d/sof-rt5682/sof-rt5682.conf index 02766351..f14b44ee 100644 --- a/ucm2/conf.d/sof-rt5682/sof-rt5682.conf +++ b/ucm2/conf.d/sof-rt5682/sof-rt5682.conf @@ -6,7 +6,7 @@ SectionUseCase."HiFi" { } Include.platform.File "/platforms/intel-sof/platform.conf" -Include.codec.File "codecs.conf" +Include.codec.File "/platforms/intel-sof/codecs.conf" # headphone codecs diff --git a/ucm2/platforms/intel-sof/codecs.conf b/ucm2/platforms/intel-sof/codecs.conf new file mode 100644 index 00000000..79a7d15d --- /dev/null +++ b/ucm2/platforms/intel-sof/codecs.conf @@ -0,0 +1,95 @@ +# codec probing + +# headset codecs + +If.rt5682 { + Condition { + Type String + String1 "$${sys:bus/i2c/devices/i2c-10EC5682:00/modalias}" + String2 "acpi:10EC5682:" + } + True.Define.rt5682 y +} + +If.rt5682s { + Condition { + Type String + String1 "$${sys:bus/i2c/devices/i2c-RTL5682:00/modalias}" + String2 "acpi:RTL5682:" + } + True.Define.rt5682s y +} + +# speaker amps + +If.max98357a { + Condition { + Type String + String1 "$${sys:bus/platform/devices/MX98357A:00/modalias}" + String2 "acpi:MX98357A:" + } + True.Define.max98357a y +} + +If.max98360a { + Condition { + Type String + String1 "$${sys:bus/platform/devices/MX98360A:00/modalias}" + String2 "acpi:MX98360A:" + } + True.Define.max98360a y +} + +If.max98373 { + Condition { + Type String + String1 "$${sys:bus/i2c/devices/i2c-MX98373:00/modalias}" + String2 "acpi:MX98373:" + } + True.Define.max98373 y +} + +If.max98390 { + Condition { + Type String + String1 "$${sys:bus/i2c/devices/i2c-MX98390:00/modalias}" + String2 "acpi:MX98390:" + } + True.Define.max98390 y +} + +If.rt1011 { + Condition { + Type String + String1 "$${sys:bus/i2c/devices/i2c-10EC1011:00/modalias}" + String2 "acpi:10EC1011:" + } + True.Define.rt1011 y +} + +If.rt1015 { + Condition { + Type String + String1 "$${sys:bus/i2c/devices/i2c-10EC1015:00/modalias}" + String2 "acpi:10EC1015:" + } + True.Define.rt1015 y +} + +If.rt1015p { + Condition { + Type String + String1 "$${sys:bus/platform/devices/RTL1015:00/modalias}" + String2 "acpi:RTL1015:" + } + True.Define.rt1015p y +} + +If.rt1019p { + Condition { + Type String + String1 "$${sys:bus/platform/devices/RTL1019:00/modalias}" + String2 "acpi:RTL1019:" + } + True.Define.rt1019p y +}