From 446d0a71b47f7d6548a85a15731a035103d95bd8 Mon Sep 17 00:00:00 2001 From: Dmitry Osipenko Date: Thu, 20 May 2021 16:49:22 +0300 Subject: [PATCH] codecs/rt5640: Move out BayTrail-specific pin switches The UCM of RT5640 codec toggles switches that exists only in a case of the Intel BayTrail ASoC machine driver, RT5640 codec driver doesn't have them. Move these switches to the BayTrail UCM in order to make generic UCM rules reusable by other SoCs. Signed-off-by: Dmitry Osipenko Signed-off-by: Jaroslav Kysela --- ucm2/bytcr-rt5640/HiFi-Components.conf | 70 +++++++++++++++++++++++++ ucm2/bytcr-rt5640/HiFi-LongName.conf | 70 +++++++++++++++++++++++++ ucm2/bytcr-rt5640/HiFi.conf | 7 +++ ucm2/codecs/rt5640/DigitalMics.conf | 2 - ucm2/codecs/rt5640/EnableSeq.conf | 5 -- ucm2/codecs/rt5640/HeadPhones.conf | 2 - ucm2/codecs/rt5640/HeadsetMic.conf | 4 -- ucm2/codecs/rt5640/IN1-InternalMic.conf | 4 -- ucm2/codecs/rt5640/IN3-InternalMic.conf | 4 -- ucm2/codecs/rt5640/MonoSpeaker.conf | 2 - ucm2/codecs/rt5640/Speaker.conf | 2 - 11 files changed, 147 insertions(+), 25 deletions(-) diff --git a/ucm2/bytcr-rt5640/HiFi-Components.conf b/ucm2/bytcr-rt5640/HiFi-Components.conf index 1999717..227a9f5 100644 --- a/ucm2/bytcr-rt5640/HiFi-Components.conf +++ b/ucm2/bytcr-rt5640/HiFi-Components.conf @@ -10,6 +10,16 @@ If.spk { True { Include.spk.File "/codecs/rt5640/Speaker.conf" Define.HaveSpeaker "yes" + + SectionDevice."Speaker" { + EnableSequence [ + cset "name='Speaker Switch' on" + ] + + DisableSequence [ + cset "name='Speaker Switch' off" + ] + } } } @@ -22,12 +32,32 @@ If.mono { True { Include.mspk.File "/codecs/rt5640/MonoSpeaker.conf" Define.HaveSpeaker "yes" + + SectionDevice."Speaker" { + EnableSequence [ + cset "name='Speaker Switch' on" + ] + + DisableSequence [ + cset "name='Speaker Switch' off" + ] + } } } If.hp { Condition { Type String Empty "" } True.Include.hs.File "/codecs/rt5640/HeadPhones.conf" + + SectionDevice."Headphones" { + EnableSequence [ + cset "name='Headphone Switch' on" + ] + + DisableSequence [ + cset "name='Headphone Switch' off" + ] + } } If.dmic1 { @@ -39,6 +69,16 @@ If.dmic1 { True { Include.dmic.File "/codecs/rt5640/DigitalMics.conf" Define.HaveInternalMic "yes" + + SectionDevice."Mic" { + EnableSequence [ + cset "name='Internal Mic Switch' on" + ] + + DisableSequence [ + cset "name='Internal Mic Switch' off" + ] + } } } @@ -51,6 +91,16 @@ If.in1 { True { Include.mic1.File "/codecs/rt5640/IN1-InternalMic.conf" Define.HaveInternalMic "yes" + + SectionDevice."Mic" { + EnableSequence [ + cset "name='Internal Mic Switch' on" + ] + + DisableSequence [ + cset "name='Internal Mic Switch' off" + ] + } } } @@ -63,10 +113,30 @@ If.in3 { True { Include.mic3.File "/codecs/rt5640/IN3-InternalMic.conf" Define.HaveInternalMic "yes" + + SectionDevice."Mic" { + EnableSequence [ + cset "name='Internal Mic Switch' on" + ] + + DisableSequence [ + cset "name='Internal Mic Switch' off" + ] + } } } If.hsmic { Condition { Type String Empty "" } True.Include.hsmic.File "/codecs/rt5640/HeadsetMic.conf" + + SectionDevice."Headset" { + EnableSequence [ + cset "name='Headset Mic Switch' on" + ] + + DisableSequence [ + cset "name='Headset Mic Switch' off" + ] + } } diff --git a/ucm2/bytcr-rt5640/HiFi-LongName.conf b/ucm2/bytcr-rt5640/HiFi-LongName.conf index 34acef8..7b53284 100644 --- a/ucm2/bytcr-rt5640/HiFi-LongName.conf +++ b/ucm2/bytcr-rt5640/HiFi-LongName.conf @@ -10,6 +10,16 @@ If.spk { True { Include.spk.File "/codecs/rt5640/Speaker.conf" Define.HaveSpeaker "yes" + + SectionDevice."Speaker" { + EnableSequence [ + cset "name='Speaker Switch' on" + ] + + DisableSequence [ + cset "name='Speaker Switch' off" + ] + } } } @@ -22,12 +32,32 @@ If.mono { True { Include.mspk.File "/codecs/rt5640/MonoSpeaker.conf" Define.HaveSpeaker "yes" + + SectionDevice."Speaker" { + EnableSequence [ + cset "name='Speaker Switch' on" + ] + + DisableSequence [ + cset "name='Speaker Switch' off" + ] + } } } If.hp { Condition { Type String Empty "" } True.Include.hs.File "/codecs/rt5640/HeadPhones.conf" + + SectionDevice."Headphones" { + EnableSequence [ + cset "name='Headphone Switch' on" + ] + + DisableSequence [ + cset "name='Headphone Switch' off" + ] + } } If.dmic1 { @@ -39,6 +69,16 @@ If.dmic1 { True { Include.dmic.File "/codecs/rt5640/DigitalMics.conf" Define.HaveInternalMic "yes" + + SectionDevice."Mic" { + EnableSequence [ + cset "name='Internal Mic Switch' on" + ] + + DisableSequence [ + cset "name='Internal Mic Switch' off" + ] + } } } @@ -51,6 +91,16 @@ If.in1 { True { Include.mic1.File "/codecs/rt5640/IN1-InternalMic.conf" Define.HaveInternalMic "yes" + + SectionDevice."Mic" { + EnableSequence [ + cset "name='Internal Mic Switch' on" + ] + + DisableSequence [ + cset "name='Internal Mic Switch' off" + ] + } } } @@ -63,10 +113,30 @@ If.in3 { True { Include.mic3.File "/codecs/rt5640/IN3-InternalMic.conf" Define.HaveInternalMic "yes" + + SectionDevice."Mic" { + EnableSequence [ + cset "name='Internal Mic Switch' on" + ] + + DisableSequence [ + cset "name='Internal Mic Switch' off" + ] + } } } If.hsmic { Condition { Type String Empty "" } True.Include.hsmic.File "/codecs/rt5640/HeadsetMic.conf" + + SectionDevice."Headset" { + EnableSequence [ + cset "name='Headset Mic Switch' on" + ] + + DisableSequence [ + cset "name='Headset Mic Switch' off" + ] + } } diff --git a/ucm2/bytcr-rt5640/HiFi.conf b/ucm2/bytcr-rt5640/HiFi.conf index 7d504d1..d0a783a 100644 --- a/ucm2/bytcr-rt5640/HiFi.conf +++ b/ucm2/bytcr-rt5640/HiFi.conf @@ -24,6 +24,13 @@ If.DefineAif2 { SectionVerb { Include.e.File "/codecs/rt5640/EnableSeq.conf" + EnableSequence [ + cset "name='Speaker Switch' off" + cset "name='Headphone Switch' off" + cset "name='Headset Mic Switch' off" + cset "name='Internal Mic Switch' off" + ] + If.Controls { Condition { Type ControlExists diff --git a/ucm2/codecs/rt5640/DigitalMics.conf b/ucm2/codecs/rt5640/DigitalMics.conf index 032d954..7566f5b 100644 --- a/ucm2/codecs/rt5640/DigitalMics.conf +++ b/ucm2/codecs/rt5640/DigitalMics.conf @@ -10,7 +10,6 @@ SectionDevice."Mic" { cset "name='Mono ADC MIXR ADC2 Switch' on" cset "name='Stereo ADC MIXL ADC2 Switch' on" cset "name='Stereo ADC MIXR ADC2 Switch' on" - cset "name='Internal Mic Switch' on" ] @@ -19,7 +18,6 @@ SectionDevice."Mic" { cset "name='Mono ADC MIXR ADC2 Switch' off" cset "name='Stereo ADC MIXL ADC2 Switch' off" cset "name='Stereo ADC MIXR ADC2 Switch' off" - cset "name='Internal Mic Switch' off" ] diff --git a/ucm2/codecs/rt5640/EnableSeq.conf b/ucm2/codecs/rt5640/EnableSeq.conf index 49703ae..e177d90 100644 --- a/ucm2/codecs/rt5640/EnableSeq.conf +++ b/ucm2/codecs/rt5640/EnableSeq.conf @@ -71,9 +71,4 @@ EnableSequence [ cset "name='Mono ADC MIXR ADC1 Switch' off" cset "name='Mono ADC MIXL ADC2 Switch' off" cset "name='Mono ADC MIXR ADC2 Switch' off" - - cset "name='Speaker Switch' off" - cset "name='Headphone Switch' off" - cset "name='Internal Mic Switch' off" - cset "name='Headset Mic Switch' off" ] diff --git a/ucm2/codecs/rt5640/HeadPhones.conf b/ucm2/codecs/rt5640/HeadPhones.conf index 4fbe95d..3921e8d 100644 --- a/ucm2/codecs/rt5640/HeadPhones.conf +++ b/ucm2/codecs/rt5640/HeadPhones.conf @@ -15,7 +15,6 @@ SectionDevice."Headphones" { EnableSequence [ cset "name='HPO MIX HPVOL Switch' on" - cset "name='Headphone Switch' on" cset "name='HP Channel Switch' on" cset "name='HP L Playback Switch' on" cset "name='HP R Playback Switch' on" @@ -24,7 +23,6 @@ SectionDevice."Headphones" { ] DisableSequence [ - cset "name='Headphone Switch' off" cset "name='HP Channel Switch' off" cset "name='HP L Playback Switch' off" cset "name='HP R Playback Switch' off" diff --git a/ucm2/codecs/rt5640/HeadsetMic.conf b/ucm2/codecs/rt5640/HeadsetMic.conf index b49dad4..997aa29 100644 --- a/ucm2/codecs/rt5640/HeadsetMic.conf +++ b/ucm2/codecs/rt5640/HeadsetMic.conf @@ -14,8 +14,6 @@ SectionDevice."Headset" { } EnableSequence [ - cset "name='Headset Mic Switch' on" - cset "name='RECMIXL BST2 Switch' on" cset "name='RECMIXR BST2 Switch' on" @@ -33,8 +31,6 @@ SectionDevice."Headset" { cset "name='RECMIXL BST2 Switch' off" cset "name='RECMIXR BST2 Switch' off" - - cset "name='Headset Mic Switch' off" ] Value { diff --git a/ucm2/codecs/rt5640/IN1-InternalMic.conf b/ucm2/codecs/rt5640/IN1-InternalMic.conf index d670484..18715e5 100644 --- a/ucm2/codecs/rt5640/IN1-InternalMic.conf +++ b/ucm2/codecs/rt5640/IN1-InternalMic.conf @@ -6,8 +6,6 @@ SectionDevice."Mic" { ] EnableSequence [ - cset "name='Internal Mic Switch' on" - cset "name='RECMIXL BST1 Switch' on" cset "name='RECMIXR BST1 Switch' on" @@ -25,8 +23,6 @@ SectionDevice."Mic" { cset "name='RECMIXL BST1 Switch' off" cset "name='RECMIXR BST1 Switch' off" - - cset "name='Internal Mic Switch' off" ] Value { diff --git a/ucm2/codecs/rt5640/IN3-InternalMic.conf b/ucm2/codecs/rt5640/IN3-InternalMic.conf index 345db1e..c90b6e4 100644 --- a/ucm2/codecs/rt5640/IN3-InternalMic.conf +++ b/ucm2/codecs/rt5640/IN3-InternalMic.conf @@ -6,8 +6,6 @@ SectionDevice."Mic" { ] EnableSequence [ - cset "name='Internal Mic Switch' on" - cset "name='RECMIXL BST3 Switch' on" cset "name='RECMIXR BST3 Switch' on" @@ -25,8 +23,6 @@ SectionDevice."Mic" { cset "name='RECMIXL BST3 Switch' off" cset "name='RECMIXR BST3 Switch' off" - - cset "name='Internal Mic Switch' off" ] Value { diff --git a/ucm2/codecs/rt5640/MonoSpeaker.conf b/ucm2/codecs/rt5640/MonoSpeaker.conf index addaddd..a5cf839 100644 --- a/ucm2/codecs/rt5640/MonoSpeaker.conf +++ b/ucm2/codecs/rt5640/MonoSpeaker.conf @@ -10,7 +10,6 @@ SectionDevice."Speaker" { # for mono speaker we apply left on right # cset "name='SPOR MIX SPKVOL R Switch' on" cset "name='SPOL MIX SPKVOL R Switch' on" - cset "name='Speaker Switch' on" cset "name='Speaker Channel Switch' on" cset "name='Speaker L Playback Switch' on" cset "name='Speaker R Playback Switch' on" @@ -19,7 +18,6 @@ SectionDevice."Speaker" { ] DisableSequence [ - cset "name='Speaker Switch' off" cset "name='Speaker Channel Switch' off" cset "name='Speaker L Playback Switch' off" cset "name='Speaker R Playback Switch' off" diff --git a/ucm2/codecs/rt5640/Speaker.conf b/ucm2/codecs/rt5640/Speaker.conf index e7ff673..692a549 100644 --- a/ucm2/codecs/rt5640/Speaker.conf +++ b/ucm2/codecs/rt5640/Speaker.conf @@ -10,7 +10,6 @@ SectionDevice."Speaker" { cset "name='SPOR MIX SPKVOL R Switch' on" # undo MonoSpeaker mixing of right channel to left speaker cset "name='SPOL MIX SPKVOL R Switch' off" - cset "name='Speaker Switch' on" cset "name='Speaker Channel Switch' on" cset "name='Speaker L Playback Switch' on" cset "name='Speaker R Playback Switch' on" @@ -19,7 +18,6 @@ SectionDevice."Speaker" { ] DisableSequence [ - cset "name='Speaker Switch' off" cset "name='Speaker Channel Switch' off" cset "name='Speaker L Playback Switch' off" cset "name='Speaker R Playback Switch' off" -- 2.47.1