OSDN Git Service

cht-bsw-rt5672: merge all possible configurations to HiFi.conf
[android-x86/external-alsa-ucm-conf.git] / ucm2 / cht-bsw-rt5672 / HiFi.conf
1 # Adapted from https://github.com/plbossart/UCM/tree/master/cht-bsw-rt5672
2
3 Define.Speaker "yes"
4 Define.Headphones "yes"
5 Define.MonoSpeaker "yes"
6 Define.DigitalMic1 "yes"
7 Define.DigitalMic2 "yes"
8 Define.HeadsetMic "yes"
9
10 If.cfg-dmic1 {
11         Condition {
12                 Type Regex
13                 String "${CardLongName}"
14                 Regex "(SoMeThInK1)" # fixme!
15         }
16         True {
17                 Define.MonoSpeaker ""
18                 Define.DigitalMic2 ""
19         }
20 }
21
22 If.cfg-dmic2 {
23         Condition {
24                 Type Regex
25                 String "${CardLongName}"
26                 Regex "(LENOVO.*ThinkPad8)"
27         }
28         True {
29                 Define.MonoSpeaker ""
30                 Define.DigitalMic1 ""
31         }
32 }
33
34 SectionVerb {
35         Include.e.File "/codecs/rt5672/EnableSeq.conf"
36
37         If.Controls {
38                 Condition {
39                         Type ControlExists
40                         Control "name='media0_in Gain 0 Switch'"
41                 }
42                 Before.EnableSequence "0"
43                 True {
44                         Include.pe.File "/platforms/bytcr/PlatformEnableSeq.conf"
45                         Include.pd.File "/platforms/bytcr/PlatformDisableSeq.conf"
46                 }
47         }
48 }
49
50 If.spk {
51         Condition {
52                 Type String
53                 Empty "${var:Speaker}"
54         }
55         False.Include.spk.File "/codecs/rt5672/Speaker.conf"
56 }
57
58 If.mspk {
59         Condition {
60                 Type String
61                 Empty "${var:MonoSpeaker}"
62         }
63         True {
64                 RenameDevice."Speaker1" "Speaker"
65                 RemoveDevice."Speaker2" "Speaker2"
66         }
67         False.Include.mspk.File "/codecs/rt5672/MonoSpeaker.conf"
68 }
69
70 If.hp {
71         Condition {
72                 Type String
73                 Empty "${var:Headphones}"
74         }
75         #True.RemoveDevice."Headphones" "Headphones"
76         False.Include.hp.File "/codecs/rt5672/HeadPhones.conf"
77 }
78
79 If.dmic1 {
80         Condition {
81                 Type String
82                 Empty "${var:DigitalMic1}"
83         }
84         True.RemoveDevice."Mic1" "Mic1"
85         False {
86                 Include.dmic1.File "/codecs/rt5672/DMIC1.conf"
87                 If.dmic2 {
88                         Condition {
89                                 Type "String"
90                                 Empty "${var:DigitalMic2}"
91                         }
92                         True.RenameDevice."Mic1" "Mic"
93                 }
94         }
95 }
96
97 If.dmic2 {
98         Condition {
99                 Type String
100                 Empty "${var:DigitalMic2}"
101         }
102         True.RemoveDevice."Mic2" "Mic2"
103         False {
104                 Include.dmic2.File "/codecs/rt5672/DMIC2.conf"
105                 If.dmic1 {
106                         Condition {
107                                 Type "String"
108                                 Empty "${var:DigitalMic1}"
109                         }
110                         True.RenameDevice."Mic2" "Mic"
111                 }
112         }
113 }
114
115 If.hsmic {
116         Condition {
117                 Type String
118                 Empty "${var:HeadsetMic}"
119         }
120         #True.RemoveDevice."Headset" "Headset"
121         False.Include.hsmic.File "/codecs/rt5672/HeadsetMic.conf"
122 }