OSDN Git Service

codecs/rt5640: Make headset optional
[android-x86/external-alsa-ucm-conf.git] / ucm2 / bytcr-rt5640 / HiFi-Components.conf
1 Define.HaveSpeaker ""
2 Define.HaveHeadsetMic ""
3 Define.HaveInternalMic ""
4
5 If.spk {
6         Condition {
7                 Type String
8                 Haystack "${CardComponents}"
9                 Needle "cfg-spk:2"
10         }
11         True {
12                 Include.spk.File "/codecs/rt5640/Speaker.conf"
13                 Define.HaveSpeaker "yes"
14
15                 SectionDevice."Speaker" {
16                         EnableSequence [
17                                 cset "name='Speaker Switch' on"
18                         ]
19
20                         DisableSequence [
21                                 cset "name='Speaker Switch' off"
22                         ]
23                 }
24         }
25 }
26
27 If.mono {
28         Condition {
29                 Type String
30                 Haystack "${CardComponents}"
31                 Needle "cfg-spk:1"
32         }
33         True {
34                 Include.mspk.File "/codecs/rt5640/MonoSpeaker.conf"
35                 Define.HaveSpeaker "yes"
36
37                 SectionDevice."Speaker" {
38                         EnableSequence [
39                                 cset "name='Speaker Switch' on"
40                         ]
41
42                         DisableSequence [
43                                 cset "name='Speaker Switch' off"
44                         ]
45                 }
46         }
47 }
48
49 If.hp {
50         Condition { Type String Empty "" }
51         True.Include.hs.File "/codecs/rt5640/HeadPhones.conf"
52
53         SectionDevice."Headphones" {
54                 EnableSequence [
55                         cset "name='Headphone Switch' on"
56                 ]
57
58                 DisableSequence [
59                         cset "name='Headphone Switch' off"
60                 ]
61         }
62 }
63
64 If.dmic1 {
65         Condition {
66                 Type String
67                 Haystack "${CardComponents}"
68                 Needle "cfg-mic:dmic1"
69         }
70         True {
71                 Include.dmic.File "/codecs/rt5640/DigitalMics.conf"
72                 Define.HaveInternalMic "yes"
73
74                 SectionDevice."Mic" {
75                         EnableSequence [
76                                 cset "name='Internal Mic Switch' on"
77                         ]
78
79                         DisableSequence [
80                                 cset "name='Internal Mic Switch' off"
81                         ]
82                 }
83         }
84 }
85
86 If.in1 {
87         Condition {
88                 Type String
89                 Haystack "${CardComponents}"
90                 Needle "cfg-mic:in1"
91         }
92         True {
93                 Include.mic1.File "/codecs/rt5640/IN1-InternalMic.conf"
94                 Define.HaveInternalMic "yes"
95
96                 SectionDevice."Mic" {
97                         EnableSequence [
98                                 cset "name='Internal Mic Switch' on"
99                         ]
100
101                         DisableSequence [
102                                 cset "name='Internal Mic Switch' off"
103                         ]
104                 }
105         }
106 }
107
108 If.in3 {
109         Condition {
110                 Type String
111                 Haystack "${CardComponents}"
112                 Needle "cfg-mic:in3"
113         }
114         True {
115                 Include.mic3.File "/codecs/rt5640/IN3-InternalMic.conf"
116                 Define.HaveInternalMic "yes"
117
118                 SectionDevice."Mic" {
119                         EnableSequence [
120                                 cset "name='Internal Mic Switch' on"
121                         ]
122
123                         DisableSequence [
124                                 cset "name='Internal Mic Switch' off"
125                         ]
126                 }
127         }
128 }
129
130 If.hsmic {
131         Condition { Type String Empty "" }
132         True.Include.hsmic.File "/codecs/rt5640/HeadsetMic.conf"
133         Define.HaveHeadsetMic "yes"
134
135         SectionDevice."Headset" {
136                 EnableSequence [
137                         cset "name='Headset Mic Switch' on"
138                 ]
139
140                 DisableSequence [
141                         cset "name='Headset Mic Switch' off"
142                 ]
143         }
144 }