OSDN Git Service

sof-bytcht-rt5650: reuse legacy settings
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Mon, 13 Apr 2020 15:53:39 +0000 (10:53 -0500)
committerJaroslav Kysela <perex@perex.cz>
Thu, 28 May 2020 07:45:48 +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/chtrt5650/HiFi.conf

index b365bc6..2342e85 100644 (file)
@@ -5,20 +5,45 @@ SectionVerb {
                TQ "HiFi"
        }
 
-       EnableSequence [
-               <platforms/bytcr/PlatformEnableSeq.conf>
-               <codecs/rt5645/EnableSeq.conf>
-
-               cset "name='Speaker HWEQ' 1,164,237,135,1,165,0,0,1,166,237,135,1,167,0,0,1,192,30,196,1,193,0,0,1,194,30,196,1,195,0,0,1,196,31,180,1,197,0,75,1,198,31,180,1,199,31,180,1,200,0,75,1,201,31,180,0,177,51,224"
-               cset "name='DAC1 Playback Volume' 77,77"
-               cset "name='Speaker ClassD Playback Volume' 4"
-               cset "name='I2S2 Func Switch' off"
-               cset "name='RT5650 IF1 ADC Mux' 0"
-       ]
+       If.Controls {
+               Condition {
+                       Type ControlExists
+                       Control "name='media0_in Gain 0 Switch'"
+               }
+               True {
+                       EnableSequence [
+                               <platforms/bytcr/PlatformEnableSeq.conf>
+                               <codecs/rt5645/EnableSeq.conf>
+
+                               cset "name='Speaker HWEQ' 1,164,237,135,1,165,0,0,1,166,237,135,1,167,0,0,1,192,30,196,1,193,0,0,1,194,30,196,1,195,0,0,1,196,31,180,1,197,0,75,1,198,31,180,1,199,31,180,1,200,0,75,1,201,31,180,0,177,51,224"
+                               cset "name='DAC1 Playback Volume' 77,77"
+                               cset "name='Speaker ClassD Playback Volume' 4"
+                               cset "name='I2S2 Func Switch' off"
+                               cset "name='RT5650 IF1 ADC Mux' 0"
+                       ]
+
+                       DisableSequence [
+                               <platforms/bytcr/PlatformDisableSeq.conf>
+                               <codecs/rt5645/DisableSeq.conf>
+                       ]
+               }
+               False {
+                       EnableSequence [
+                               <codecs/rt5645/EnableSeq.conf>
+
+                               cset "name='Speaker HWEQ' 1,164,237,135,1,165,0,0,1,166,237,135,1,167,0,0,1,192,30,196,1,193,0,0,1,194,30,196,1,195,0,0,1,196,31,180,1,197,0,75,1,198,31,180,1,199,31,180,1,200,0,75,1,201,31,180,0,177,51,224"
+                               cset "name='DAC1 Playback Volume' 77,77"
+                               cset "name='Speaker ClassD Playback Volume' 4"
+                               cset "name='I2S2 Func Switch' off"
+                               cset "name='RT5650 IF1 ADC Mux' 0"
+                       ]
+
+                       DisableSequence [
+                               <codecs/rt5645/DisableSeq.conf>
+                       ]
+               }
+       }
 
-       DisableSequence [
-               <codecs/rt5645/DisableSeq.conf>
-       ]
 }
 
 SectionDevice."Speaker" {