]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
sof-bytcht-rt5645: reuse legacy settings
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Mon, 13 Apr 2020 15:48:33 +0000 (10:48 -0500)
committerJaroslav Kysela <perex@perex.cz>
Thu, 28 May 2020 07:45:44 +0000 (09:45 +0200)
Just test if controls for the legacy driver are available

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/chtrt5645/HiFi-dmic1.conf
ucm2/chtrt5645/HiFi-dmic2.conf
ucm2/chtrt5645/HiFi-mono-speaker-analog-mic.conf
ucm2/chtrt5645/HiFi.conf

index c7e12c9e2625954112aa9b4daf921dc748b9c451..4e9ada8b1314af248a505ecd7c47b4b83e61be9d 100644 (file)
@@ -4,21 +4,46 @@ SectionVerb {
                TQ "HiFi"
        }
 
-       EnableSequence [
-               <platforms/bytcr/PlatformEnableSeq.conf>
-               <codecs/rt5645/EnableSeq.conf>
-
-               cset "name='Stereo1 ADC1 Mux' 1"
-               cset "name='I2S2 Func Switch' on"
-               # 3/12 the headphone mic tends to be quite loud
-               cset "name='IN1 Boost' 3"
-               # 8/8 the internal analog mic tends to be quite soft
-               cset "name='IN2 Boost' 8"
-       ]
-
-       DisableSequence [
-               <codecs/rt5645/DisableSeq.conf>
-       ]
+       If.Controls {
+               Condition {
+                       Type ControlExists
+                       Control "name='media0_in Gain 0 Switch'"
+               }
+               True {
+                       EnableSequence [
+                               <platforms/bytcr/PlatformEnableSeq.conf>
+                               <codecs/rt5645/EnableSeq.conf>
+
+                               cset "name='Stereo1 ADC1 Mux' 1"
+                               cset "name='I2S2 Func Switch' on"
+                               # 3/12 the headphone mic tends to be quite loud
+                               cset "name='IN1 Boost' 3"
+                               # 8/8 the internal analog mic tends to be quite soft
+                               cset "name='IN2 Boost' 8"
+                       ]
+
+                       DisableSequence [
+                               <platforms/bytcr/PlatformDisableSeq.conf>
+                               <codecs/rt5645/DisableSeq.conf>
+                       ]
+               }
+               False {
+                       EnableSequence [
+                               <codecs/rt5645/EnableSeq.conf>
+
+                               cset "name='Stereo1 ADC1 Mux' 1"
+                               cset "name='I2S2 Func Switch' on"
+                               # 3/12 the headphone mic tends to be quite loud
+                               cset "name='IN1 Boost' 3"
+                               # 8/8 the internal analog mic tends to be quite soft
+                               cset "name='IN2 Boost' 8"
+                       ]
+
+                       DisableSequence [
+                               <codecs/rt5645/DisableSeq.conf>
+                       ]
+               }
+       }
 }
 
 SectionDevice."Speaker" {
index 95fedb3eb03e2e3d801929fe03db33933405e7a3..aa2a87b39230b0591fd73fc68566848657a2afc5 100644 (file)
@@ -4,21 +4,46 @@ SectionVerb {
                TQ "HiFi"
        }
 
-       EnableSequence [
-               <platforms/bytcr/PlatformEnableSeq.conf>
-               <codecs/rt5645/EnableSeq.conf>
-
-               cset "name='Stereo1 ADC1 Mux' 1"
-               cset "name='I2S2 Func Switch' on"
-               # 3/12 the headphone mic tends to be quite loud
-               cset "name='IN1 Boost' 3"
-               # 8/8 the internal analog mic tends to be quite soft
-               cset "name='IN2 Boost' 8"
-       ]
-
-       DisableSequence [
-               <codecs/rt5645/DisableSeq.conf>
-       ]
+       If.Controls {
+               Condition {
+                       Type ControlExists
+                       Control "name='media0_in Gain 0 Switch'"
+               }
+               True {
+                       EnableSequence [
+                               <platforms/bytcr/PlatformEnableSeq.conf>
+                               <codecs/rt5645/EnableSeq.conf>
+
+                               cset "name='Stereo1 ADC1 Mux' 1"
+                               cset "name='I2S2 Func Switch' on"
+                               # 3/12 the headphone mic tends to be quite loud
+                               cset "name='IN1 Boost' 3"
+                               # 8/8 the internal analog mic tends to be quite soft
+                               cset "name='IN2 Boost' 8"
+                       ]
+
+                       DisableSequence [
+                               <platforms/bytcr/PlatformDisableSeq.conf>
+                               <codecs/rt5645/DisableSeq.conf>
+                       ]
+               }
+               False {
+                       EnableSequence [
+                               <codecs/rt5645/EnableSeq.conf>
+
+                               cset "name='Stereo1 ADC1 Mux' 1"
+                               cset "name='I2S2 Func Switch' on"
+                               # 3/12 the headphone mic tends to be quite loud
+                               cset "name='IN1 Boost' 3"
+                               # 8/8 the internal analog mic tends to be quite soft
+                               cset "name='IN2 Boost' 8"
+                       ]
+
+                       DisableSequence [
+                               <codecs/rt5645/DisableSeq.conf>
+                       ]
+               }
+       }
 }
 
 SectionDevice."Speaker" {
index f6180a4932eb191f1b5c08b449f44c79824c23d6..fc8244ef8e4484ee584c5a47ddb743772d6cca86 100644 (file)
@@ -4,21 +4,46 @@ SectionVerb {
                TQ "HiFi"
        }
 
-       EnableSequence [
-               <platforms/bytcr/PlatformEnableSeq.conf>
-               <codecs/rt5645/EnableSeq.conf>
-
-               cset "name='Stereo1 ADC1 Mux' 1"
-               cset "name='I2S2 Func Switch' on"
-               # 3/12 the headphone mic tends to be quite loud
-               cset "name='IN1 Boost' 3"
-               # 8/8 the internal analog mic tends to be quite soft
-               cset "name='IN2 Boost' 8"
-       ]
-
-       DisableSequence [
-               <codecs/rt5645/DisableSeq.conf>
-       ]
+       If.Controls {
+               Condition {
+                       Type ControlExists
+                       Control "name='media0_in Gain 0 Switch'"
+               }
+               True {
+                       EnableSequence [
+                               <platforms/bytcr/PlatformEnableSeq.conf>
+                               <codecs/rt5645/EnableSeq.conf>
+
+                               cset "name='Stereo1 ADC1 Mux' 1"
+                               cset "name='I2S2 Func Switch' on"
+                               # 3/12 the headphone mic tends to be quite loud
+                               cset "name='IN1 Boost' 3"
+                               # 8/8 the internal analog mic tends to be quite soft
+                               cset "name='IN2 Boost' 8"
+                       ]
+
+                       DisableSequence [
+                               <platforms/bytcr/PlatformDisableSeq.conf>
+                               <codecs/rt5645/DisableSeq.conf>
+                       ]
+               }
+               False {
+                       EnableSequence [
+                               <codecs/rt5645/EnableSeq.conf>
+
+                               cset "name='Stereo1 ADC1 Mux' 1"
+                               cset "name='I2S2 Func Switch' on"
+                               # 3/12 the headphone mic tends to be quite loud
+                               cset "name='IN1 Boost' 3"
+                               # 8/8 the internal analog mic tends to be quite soft
+                               cset "name='IN2 Boost' 8"
+                       ]
+
+                       DisableSequence [
+                               <codecs/rt5645/DisableSeq.conf>
+                       ]
+               }
+       }
 }
 
 SectionDevice."Speaker" {
index 116d456e349e427019aa00c5da73fd3e4aa53099..dd6328c4287b52fd342465700a73dd39786e254d 100644 (file)
@@ -4,21 +4,46 @@ SectionVerb {
                TQ "HiFi"
        }
 
-       EnableSequence [
-               <platforms/bytcr/PlatformEnableSeq.conf>
-               <codecs/rt5645/EnableSeq.conf>
-
-               cset "name='Stereo1 ADC1 Mux' 1"
-               cset "name='I2S2 Func Switch' on"
-               # 3/12 the headphone mic tends to be quite loud
-               cset "name='IN1 Boost' 3"
-               # 8/8 the internal analog mic tends to be quite soft
-               cset "name='IN2 Boost' 8"
-       ]
-
-       DisableSequence [
-               <codecs/rt5645/DisableSeq.conf>
-       ]
+       If.Controls {
+               Condition {
+                       Type ControlExists
+                       Control "name='media0_in Gain 0 Switch'"
+               }
+               True {
+                       EnableSequence [
+                               <platforms/bytcr/PlatformEnableSeq.conf>
+                               <codecs/rt5645/EnableSeq.conf>
+
+                               cset "name='Stereo1 ADC1 Mux' 1"
+                               cset "name='I2S2 Func Switch' on"
+                               # 3/12 the headphone mic tends to be quite loud
+                               cset "name='IN1 Boost' 3"
+                               # 8/8 the internal analog mic tends to be quite soft
+                               cset "name='IN2 Boost' 8"
+                       ]
+
+                       DisableSequence [
+                               <platforms/bytcr/PlatformDisableSeq.conf>
+                               <codecs/rt5645/DisableSeq.conf>
+                       ]
+               }
+               False {
+                       EnableSequence [
+                               <codecs/rt5645/EnableSeq.conf>
+
+                               cset "name='Stereo1 ADC1 Mux' 1"
+                               cset "name='I2S2 Func Switch' on"
+                               # 3/12 the headphone mic tends to be quite loud
+                               cset "name='IN1 Boost' 3"
+                               # 8/8 the internal analog mic tends to be quite soft
+                               cset "name='IN2 Boost' 8"
+                       ]
+
+                       DisableSequence [
+                               <codecs/rt5645/DisableSeq.conf>
+                       ]
+               }
+       }
 }
 
 SectionDevice."Speaker" {