]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
cht-bsw-rt5672: merge all possible configurations to HiFi.conf
authorJaroslav Kysela <perex@perex.cz>
Tue, 16 Jun 2020 11:40:21 +0000 (13:40 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 23 Jun 2020 15:00:16 +0000 (17:00 +0200)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/cht-bsw-rt5672/HiFi-stereo-dmic2.conf [deleted file]
ucm2/cht-bsw-rt5672/HiFi.conf
ucm2/cht-bsw-rt5672/LENOVO-20BN002QGE-ThinkPad8-20BN002QGE.conf [deleted symlink]
ucm2/cht-bsw-rt5672/LENOVO-20BN002QGE-ThinkPad8.conf [deleted symlink]
ucm2/cht-bsw-rt5672/cht-bsw-rt5672-stereo-dmic2.conf [deleted file]

diff --git a/ucm2/cht-bsw-rt5672/HiFi-stereo-dmic2.conf b/ucm2/cht-bsw-rt5672/HiFi-stereo-dmic2.conf
deleted file mode 100644 (file)
index 0d95e90..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-# Adapted from https://github.com/plbossart/UCM/tree/master/cht-bsw-rt5672
-
-SectionVerb {
-       Include.e.File "/codecs/rt5672/EnableSeq.conf"
-
-       If.Controls {
-               Condition {
-                       Type ControlExists
-                       Control "name='media0_in Gain 0 Switch'"
-               }
-               Before.EnableSequence "0"
-               True {
-                       Include.pe.File "/platforms/bytcr/PlatformEnableSeq.conf"
-                       Include.pd.File "/platforms/bytcr/PlatformDisableSeq.conf"
-               }
-       }
-}
-
-Include.spk.File "/codecs/rt5672/Speaker.conf"
-RenameDevice."Speaker1" "Speaker"
-RemoveDevice."Speaker2" "Speaker2"
-Include.hp.File "/codecs/rt5672/HeadPhones.conf"
-
-Include.dmic.File "/codecs/rt5672/DMIC2.conf"
-RenameDevice."Mic2" "Mic"
-RemoveDevice."Mic1" "Mic1"
-Include.hsmic.File "/codecs/rt5672/HeadsetMic.conf"
index 39cb0fe125cd461b73307bc7b0ae17ffb3d8a77e..394e45d39ace9f8ed08193c947d7e0e136fd3783 100644 (file)
@@ -1,7 +1,37 @@
 # Adapted from https://github.com/plbossart/UCM/tree/master/cht-bsw-rt5672
 
-SectionVerb {
+Define.Speaker "yes"
+Define.Headphones "yes"
+Define.MonoSpeaker "yes"
+Define.DigitalMic1 "yes"
+Define.DigitalMic2 "yes"
+Define.HeadsetMic "yes"
+
+If.cfg-dmic1 {
+       Condition {
+               Type Regex
+               String "${CardLongName}"
+               Regex "(SoMeThInK1)" # fixme!
+       }
+       True {
+               Define.MonoSpeaker ""
+               Define.DigitalMic2 ""
+       }
+}
+
+If.cfg-dmic2 {
+       Condition {
+               Type Regex
+               String "${CardLongName}"
+               Regex "(LENOVO.*ThinkPad8)"
+       }
+       True {
+               Define.MonoSpeaker ""
+               Define.DigitalMic1 ""
+       }
+}
 
+SectionVerb {
        Include.e.File "/codecs/rt5672/EnableSeq.conf"
 
        If.Controls {
@@ -10,14 +40,83 @@ SectionVerb {
                        Control "name='media0_in Gain 0 Switch'"
                }
                Before.EnableSequence "0"
-               True.Include.pe.File "/platforms/bytcr/PlatformEnableSeq.conf"
+               True {
+                       Include.pe.File "/platforms/bytcr/PlatformEnableSeq.conf"
+                       Include.pd.File "/platforms/bytcr/PlatformDisableSeq.conf"
+               }
+       }
+}
+
+If.spk {
+       Condition {
+               Type String
+               Empty "${var:Speaker}"
+       }
+       False.Include.spk.File "/codecs/rt5672/Speaker.conf"
+}
+
+If.mspk {
+       Condition {
+               Type String
+               Empty "${var:MonoSpeaker}"
+       }
+       True {
+               RenameDevice."Speaker1" "Speaker"
+               RemoveDevice."Speaker2" "Speaker2"
+       }
+       False.Include.mspk.File "/codecs/rt5672/MonoSpeaker.conf"
+}
+
+If.hp {
+       Condition {
+               Type String
+               Empty "${var:Headphones}"
+       }
+       #True.RemoveDevice."Headphones" "Headphones"
+       False.Include.hp.File "/codecs/rt5672/HeadPhones.conf"
+}
+
+If.dmic1 {
+       Condition {
+               Type String
+               Empty "${var:DigitalMic1}"
+       }
+       True.RemoveDevice."Mic1" "Mic1"
+       False {
+               Include.dmic1.File "/codecs/rt5672/DMIC1.conf"
+               If.dmic2 {
+                       Condition {
+                               Type "String"
+                               Empty "${var:DigitalMic2}"
+                       }
+                       True.RenameDevice."Mic1" "Mic"
+               }
        }
 }
 
-Include.spk.File "/codecs/rt5672/Speaker.conf"
-Include.mspk.File "/codecs/rt5672/MonoSpeaker.conf"
-Include.hp.File "/codecs/rt5672/HeadPhones.conf"
+If.dmic2 {
+       Condition {
+               Type String
+               Empty "${var:DigitalMic2}"
+       }
+       True.RemoveDevice."Mic2" "Mic2"
+       False {
+               Include.dmic2.File "/codecs/rt5672/DMIC2.conf"
+               If.dmic1 {
+                       Condition {
+                               Type "String"
+                               Empty "${var:DigitalMic1}"
+                       }
+                       True.RenameDevice."Mic2" "Mic"
+               }
+       }
+}
 
-Include.dmic1.File "/codecs/rt5672/DMIC1.conf"
-Include.dmic2.File "/codecs/rt5672/DMIC2.conf"
-Include.hsmic.File "/codecs/rt5672/HeadsetMic.conf"
+If.hsmic {
+       Condition {
+               Type String
+               Empty "${var:HeadsetMic}"
+       }
+       #True.RemoveDevice."Headset" "Headset"
+       False.Include.hsmic.File "/codecs/rt5672/HeadsetMic.conf"
+}
diff --git a/ucm2/cht-bsw-rt5672/LENOVO-20BN002QGE-ThinkPad8-20BN002QGE.conf b/ucm2/cht-bsw-rt5672/LENOVO-20BN002QGE-ThinkPad8-20BN002QGE.conf
deleted file mode 120000 (symlink)
index 461f0c4..0000000
+++ /dev/null
@@ -1 +0,0 @@
-cht-bsw-rt5672-stereo-dmic2.conf
\ No newline at end of file
diff --git a/ucm2/cht-bsw-rt5672/LENOVO-20BN002QGE-ThinkPad8.conf b/ucm2/cht-bsw-rt5672/LENOVO-20BN002QGE-ThinkPad8.conf
deleted file mode 120000 (symlink)
index 461f0c4..0000000
+++ /dev/null
@@ -1 +0,0 @@
-cht-bsw-rt5672-stereo-dmic2.conf
\ No newline at end of file
diff --git a/ucm2/cht-bsw-rt5672/cht-bsw-rt5672-stereo-dmic2.conf b/ucm2/cht-bsw-rt5672/cht-bsw-rt5672-stereo-dmic2.conf
deleted file mode 100644 (file)
index e793e9d..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-Syntax 3
-
-SectionUseCase."HiFi" {
-       File "HiFi-stereo-dmic2.conf"
-       Comment "Play HiFi quality Music"
-}