+++ /dev/null
-# 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"
# 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 {
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"
+}