]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
sof-bytcht-rt5672: reuse legacy settings
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Mon, 13 Apr 2020 15:29:14 +0000 (10:29 -0500)
committerJaroslav Kysela <perex@perex.cz>
Thu, 28 May 2020 07:45:35 +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/cht-bsw-rt5672/HiFi-stereo-dmic2.conf
ucm2/cht-bsw-rt5672/HiFi.conf

index 82c976bcdd25dcaa04813c4f19e7e8d4c9728790..50612aa815f467cb392270cd3b1ee36a285f1ca0 100644 (file)
@@ -1,14 +1,28 @@
 # Adapted from https://github.com/plbossart/UCM/tree/master/cht-bsw-rt5672
 
 SectionVerb {
-       EnableSequence [
-               <platforms/bytcr/PlatformEnableSeq.conf>
-               <codecs/rt5672/EnableSeq.conf>
-       ]
 
-       DisableSequence [
-               <platforms/bytcr/PlatformDisableSeq.conf>
-       ]
+       If.Controls {
+               Condition {
+                       Type ControlExists
+                       Control "name='media0_in Gain 0 Switch'"
+               }
+               True {
+                       EnableSequence [
+                               <platforms/bytcr/PlatformEnableSeq.conf>
+                               <codecs/rt5672/EnableSeq.conf>
+                       ]
+
+                       DisableSequence [
+                               <platforms/bytcr/PlatformDisableSeq.conf>
+                       ]
+               }
+               False {
+                       EnableSequence [
+                               <codecs/rt5672/EnableSeq.conf>
+                       ]
+               }
+       }
 }
 
 <codecs/rt5672/Speaker.conf>
index 9a64cc30d2ca691f9856df39b1f2391193384e75..fd344527505b536d4fb64e919e2579e9571511f7 100644 (file)
@@ -1,14 +1,28 @@
 # Adapted from https://github.com/plbossart/UCM/tree/master/cht-bsw-rt5672
 
 SectionVerb {
-       EnableSequence [
-               <platforms/bytcr/PlatformEnableSeq.conf>
-               <codecs/rt5672/EnableSeq.conf>
-       ]
 
-       DisableSequence [
-               <platforms/bytcr/PlatformDisableSeq.conf>
-       ]
+       If.Controls {
+               Condition {
+                       Type ControlExists
+                       Control "name='media0_in Gain 0 Switch'"
+               }
+               True {
+                       EnableSequence [
+                               <platforms/bytcr/PlatformEnableSeq.conf>
+                               <codecs/rt5672/EnableSeq.conf>
+                       ]
+
+                       DisableSequence [
+                               <platforms/bytcr/PlatformDisableSeq.conf>
+                       ]
+               }
+               False {
+                       EnableSequence [
+                               <codecs/rt5672/EnableSeq.conf>
+                       ]
+               }
+       }
 }
 
 <codecs/rt5672/Speaker.conf>