1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!-- Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.    -->
3<!--                                                                        -->
4<!-- Redistribution and use in source and binary forms, with or without     -->
5<!-- modification, are permitted provided that the following conditions are -->
6<!-- met:                                                                   -->
7<!--     * Redistributions of source code must retain the above copyright   -->
8<!--       notice, this list of conditions and the following disclaimer.    -->
9<!--     * Redistributions in binary form must reproduce the above          -->
10<!--       copyright notice, this list of conditions and the following      -->
11<!--       disclaimer in the documentation and/or other materials provided  -->
12<!--       with the distribution.                                           -->
13<!--     * Neither the name of The Linux Foundation nor the names of its    -->
14<!--       contributors may be used to endorse or promote products derived  -->
15<!--       from this software without specific prior written permission.    -->
16<!--                                                                        -->
17<!-- THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED           -->
18<!-- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF   -->
19<!-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT -->
20<!-- ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS -->
21<!-- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -->
22<!-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF   -->
23<!-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR        -->
24<!-- BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,  -->
25<!-- OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -->
26<!-- IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                          -->
27<mixer>
28    <!-- Initial Values -->
29    <!-- Preload Stage -->
30    <ctl name="Main AMP Enable Switch" value="0" />
31    <ctl name="DSP1 Preload Switch" value="0" />
32    <ctl name="R Main AMP Enable Switch" value="0" />
33    <ctl name="R DSP1 Preload Switch" value="0" />
34    <!-- Clock-trigger Stage -->
35    <ctl name="SINK_IDS" id="0" value="-1"/>
36    <ctl name="SINK_IDS" id="1" value="-1"/>
37    <ctl name="PCM Playback Volume" value="10"/>
38    <ctl name="TDM_0_RX Mixer EP6" value="0"/>
39
40    <!-- Preparation Stage -->
41    <path name="crus-switch-fw-prepare">
42        <ctl name="DRE DRE Switch" value="1" />
43        <ctl name="VBSTMON Output Switch" value="1" />
44        <ctl name="DSP Booted" value="0" />
45        <ctl name="R DRE DRE Switch" value="1" />
46        <ctl name="R VBSTMON Output Switch" value="1" />
47        <ctl name="R DSP Booted" value="0" />
48
49        <path name="~crus-fw-preload" />
50    </path>
51
52    <!-- Preload Stage -->
53    <path name="crus-fw-preload">
54        <ctl name="DSP1 Preload Switch" value="1" />
55        <ctl name="R DSP1 Preload Switch" value="1" />
56        <ctl name="Main AMP Enable Switch" value="0" />
57        <ctl name="R Main AMP Enable Switch" value="0" />
58    </path>
59
60    <!-- Firmware-switching Stage -->
61    <path name="crus-switch-fw-Calibration">
62        <ctl name="PCM Source" value="DSP" />
63        <ctl name="DSP1 Firmware" value="Calibration" />
64        <ctl name="R PCM Source" value="DSP" />
65        <ctl name="R DSP1 Firmware" value="Calibration" />
66    </path>
67
68    <path name="crus-switch-fw-Diagnostic">
69        <ctl name="PCM Source" value="DSP" />
70        <ctl name="DSP1 Firmware" value="Diagnostic" />
71        <ctl name="R PCM Source" value="DSP" />
72        <ctl name="R DSP1 Firmware" value="Diagnostic" />
73    </path>
74
75    <path name="crus-switch-fw-Protection">
76        <ctl name="PCM Source" value="DSP" />
77        <ctl name="DSP1 Firmware" value="Protection" />
78        <ctl name="R PCM Source" value="DSP" />
79        <ctl name="R DSP1 Firmware" value="Protection" />
80    </path>
81
82    <!-- DSP-initialization Stage -->
83    <path name="crus-dsp-pre-calibration-amp1">
84        <ctl name="Main AMP Enable Switch" value="1" />
85    </path>
86
87    <path name="crus-dsp-pre-calibration-amp2">
88        <ctl name="R Main AMP Enable Switch" value="1" />
89    </path>
90
91    <path name="crus-dsp-pre-calibration">
92        <path name="crus-dsp-pre-calibration-amp1" />
93        <path name="crus-dsp-pre-calibration-amp2" />
94    </path>
95
96    <path name="crus-dsp-pre-diagnostic-amp1">
97        <ctl name="Main AMP Enable Switch" value="1" />
98    </path>
99
100    <path name="crus-dsp-pre-diagnostic-amp2">
101        <ctl name="R Main AMP Enable Switch" value="1" />
102    </path>
103
104    <path name="crus-dsp-pre-diagnostic">
105        <path name="crus-dsp-pre-diagnostic-amp1" />
106        <path name="crus-dsp-pre-diagnostic-amp2" />
107    </path>
108
109    <path name="crus-dsp-pre-protection">
110        <ctl name="Main AMP Enable Switch" value="1" />
111        <ctl name="R Main AMP Enable Switch" value="1" />
112    </path>
113
114    <!-- Clock-trigger Stage -->
115    <path name="platform-controls">
116        <ctl name="PCM Playback Volume" value="1000"/>
117        <ctl name="SINK_IDS" id="0" value="0"/>
118        <ctl name="SINK_IDS" id="1" value="-1"/>
119        <ctl name="TDM_0_RX Mixer EP6" value="1"/>
120    </path>
121
122    <!-- Post loaded firmware -->
123    <path name="crus-dsp-post-loading-fw">
124        <ctl name="Main AMP Enable Switch" value="0" />
125        <ctl name="R Main AMP Enable Switch" value="0" />
126    </path>
127
128    <!-- Value & Information Fetch Stage -->
129    <path name="platform-values">
130        <ctl name="TDM_0_RX Format" />
131        <ctl name="TDM_0_RX Chan" />
132        <ctl name="TDM_0_RX Sample Rate" />
133        <ctl name="PCM Playback Volume" />
134        <ctl name="TDM_0_RX Mixer EP6" />
135    </path>
136
137    <path name="cs35l41-values">
138        <ctl name="DRE DRE Switch" />
139        <ctl name="R DRE DRE Switch" />
140        <ctl name="VBSTMON Output Switch" />
141        <ctl name="R VBSTMON Output Switch" />
142        <ctl name="AMP PCM Gain" />
143        <ctl name="R AMP PCM Gain" />
144        <ctl name="Digital PCM Volume" />
145        <ctl name="R Digital PCM Volume" />
146        <ctl name="PCM Source" />
147        <ctl name="R PCM Source" />
148        <ctl name="DSP Booted" />
149        <ctl name="R DSP Booted" />
150        <ctl name="Main AMP Enable Switch" />
151        <ctl name="R Main AMP Enable Switch" />
152        <ctl name="DSP1 Preload Switch" />
153        <ctl name="R DSP1 Preload Switch" />
154        <ctl name="DSP1 Firmware" />
155        <ctl name="R DSP1 Firmware" />
156    </path>
157
158
159    <!-- Note that the order of controls does matter because
160         it should be matched to the structure defined in
161         sp_cal_common.h -->
162    <!--
163        struct calibration_data {
164            unsigned int cal_r;
165            unsigned int cal_status;
166            unsigned int cal_checksum;
167            unsigned int cal_ambient;
168            unsigned int amp_pcm_gain;
169            unsigned int digital_pcm_gain;
170        };
171    -->
172    <path name="cs35l41-dsp-amp1-calibration-values">
173        <ctl name="DSP1 Calibration cd CAL_R" />
174        <ctl name="DSP1 Calibration cd CAL_STATUS" />
175        <ctl name="DSP1 Calibration cd CAL_CHECKSUM" />
176        <ctl name="DSP1 Calibration cd CAL_AMBIENT" />
177        <ctl name="AMP PCM Gain" />
178        <ctl name="Digital PCM Volume" />
179
180        <!-- Only for debug print -->
181        <ctl name="DSP1 Calibration cd CAL_SET_STATUS" />
182    </path>
183
184    <path name="cs35l41-dsp-amp2-calibration-values">
185        <ctl name="R DSP1 Calibration cd CAL_R" />
186        <ctl name="R DSP1 Calibration cd CAL_STATUS" />
187        <ctl name="R DSP1 Calibration cd CAL_CHECKSUM" />
188        <ctl name="R DSP1 Calibration cd CAL_AMBIENT" />
189        <ctl name="R AMP PCM Gain" />
190        <ctl name="R Digital PCM Volume" />
191
192        <!-- Only for debug print -->
193        <ctl name="R DSP1 Calibration cd CAL_SET_STATUS" />
194    </path>
195
196    <!--
197        struct diagnostic_data {
198            struct calibration_data calibration_data;
199            unsigned int z_low_diff;
200            unsigned int diag_f0;
201            unsigned int diag_f0_status;
202        };
203    -->
204    <path name="cs35l41-dsp-amp1-diagnostic-values">
205        <!-- struct calibration_data START -->
206        <ctl name="DSP1 Diagnostic cd CAL_R" />
207        <ctl name="DSP1 Diagnostic cd CAL_STATUS" />
208        <ctl name="DSP1 Diagnostic cd CAL_CHECKSUM" />
209        <ctl name="DSP1 Diagnostic cd CAL_AMBIENT" />
210        <ctl name="AMP PCM Gain" />
211        <ctl name="Digital PCM Volume" />
212        <!-- struct calibration_data END -->
213        <ctl name="DSP1 Diagnostic cd DIAG_Z_LOW_DIFF" />
214        <ctl name="DSP1 Diagnostic cd DIAG_F0" />
215        <ctl name="DSP1 Diagnostic cd DIAG_F0_STATUS" />
216
217        <!-- Only for debug print -->
218        <ctl name="DSP1 Diagnostic cd CAL_SET_STATUS" />
219    </path>
220
221    <path name="cs35l41-dsp-amp2-diagnostic-values">
222        <!-- struct calibration_data START -->
223        <ctl name="R DSP1 Diagnostic cd CAL_R" />
224        <ctl name="R DSP1 Diagnostic cd CAL_STATUS" />
225        <ctl name="R DSP1 Diagnostic cd CAL_CHECKSUM" />
226        <ctl name="R DSP1 Diagnostic cd CAL_AMBIENT" />
227        <ctl name="R AMP PCM Gain" />
228        <ctl name="R Digital PCM Volume" />
229        <!-- struct calibration_data END -->
230        <ctl name="R DSP1 Diagnostic cd DIAG_Z_LOW_DIFF" />
231        <ctl name="R DSP1 Diagnostic cd DIAG_F0" />
232        <ctl name="R DSP1 Diagnostic cd DIAG_F0_STATUS" />
233
234        <!-- Only for debug print -->
235        <ctl name="R DSP1 Diagnostic cd CAL_SET_STATUS" />
236    </path>
237
238    <path name="cs35l41-dsp-amp1-protection-values">
239        <!-- struct calibration_data START -->
240        <ctl name="DSP1 Protection cd CAL_R" />
241        <ctl name="DSP1 Protection cd CAL_STATUS" />
242        <ctl name="DSP1 Protection cd CAL_CHECKSUM" />
243        <ctl name="DSP1 Protection cd CAL_AMBIENT" />
244
245        <!-- These controls are unrelated so we can simply
246             skip them
247        <ctl name="AMP PCM Gain" />
248        <ctl name="Digital PCM Volume" />
249        -->
250        <!-- struct calibration_data END -->
251    </path>
252
253    <path name="cs35l41-dsp-amp2-protection-values">
254        <!-- struct calibration_data START -->
255        <ctl name="R DSP1 Protection cd CAL_R" />
256        <ctl name="R DSP1 Protection cd CAL_STATUS" />
257        <ctl name="R DSP1 Protection cd CAL_CHECKSUM" />
258        <ctl name="R DSP1 Protection cd CAL_AMBIENT" />
259
260        <!-- These controls are unrelated so we can simply
261             skip them
262        <ctl name="R AMP PCM Gain" />
263        <ctl name="R Digital PCM Volume" />
264        -->
265        <!-- struct calibration_data END -->
266    </path>
267
268    <path name="cs35l41-dsp-amp1-calibration-completion">
269        <ctl name="DSP1 Calibration cd CAL_STATUS" />
270    </path>
271
272    <path name="cs35l41-dsp-amp2-calibration-completion">
273        <ctl name="R DSP1 Calibration cd CAL_STATUS" />
274    </path>
275
276    <path name="cs35l41-dsp-amp1-apply-calibration-completion">
277        <ctl name="DSP1 Protection cd CAL_SET_STATUS" />
278    </path>
279
280    <path name="cs35l41-dsp-amp2-apply-calibration-completion">
281        <ctl name="R DSP1 Protection cd CAL_SET_STATUS" />
282    </path>
283
284    <path name="cs35l41-dsp-amp1-diagnostic-completion">
285        <ctl name="DSP1 Diagnostic cd CAL_STATUS" />
286        <ctl name="DSP1 Diagnostic cd DIAG_F0_STATUS" />
287    </path>
288
289    <path name="cs35l41-dsp-amp2-diagnostic-completion">
290        <ctl name="R DSP1 Diagnostic cd CAL_STATUS" />
291        <ctl name="R DSP1 Diagnostic cd DIAG_F0_STATUS" />
292    </path>
293
294    <path name="cs35l41-dsp-amp1-enable-status">
295        <ctl name="Main AMP Enable Switch" />
296    </path>
297
298    <path name="cs35l41-dsp-amp2-enable-status">
299        <ctl name="R Main AMP Enable Switch" />
300    </path>
301</mixer>
302