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="DSP1 Preload Switch" value="0" />
46        <ctl name="R DRE DRE Switch" value="1" />
47        <ctl name="R VBSTMON Output Switch" value="1" />
48        <ctl name="R DSP Booted" value="0" />
49        <ctl name="R DSP1 Preload Switch" value="0" />
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    </path>
57
58    <path name="crus-fw-preload-amp1">
59        <ctl name="DSP1 Preload Switch" value="1" />
60    </path>
61
62    <path name="crus-fw-preload-amp2">
63        <ctl name="R DSP1 Preload Switch" value="1" />
64    </path>
65
66    <!-- Firmware-switching Stage -->
67    <path name="crus-switch-fw-Calibration">
68        <ctl name="AMP PCM Gain" value="17" />
69        <ctl name="Digital PCM Volume" value="817" />
70        <ctl name="PCM Source" value="DSP" />
71        <ctl name="DSP1 Firmware" value="Calibration" />
72        <ctl name="R AMP PCM Gain" value="17" />
73        <ctl name="R Digital PCM Volume" value="817" />
74        <ctl name="R PCM Source" value="DSP" />
75        <ctl name="R DSP1 Firmware" value="Calibration" />
76    </path>
77
78    <path name="crus-switch-fw-Diagnostic">
79        <ctl name="AMP PCM Gain" value="17" />
80        <ctl name="Digital PCM Volume" value="817" />
81        <ctl name="PCM Source" value="DSP" />
82        <ctl name="DSP1 Firmware" value="Diagnostic" />
83        <ctl name="R AMP PCM Gain" value="17" />
84        <ctl name="R Digital PCM Volume" value="817" />
85        <ctl name="R PCM Source" value="DSP" />
86        <ctl name="R DSP1 Firmware" value="Diagnostic" />
87    </path>
88
89    <path name="crus-switch-fw-Protection">
90        <ctl name="PCM Source" value="DSP" />
91        <ctl name="DSP1 Firmware" value="Protection" />
92        <ctl name="R PCM Source" value="DSP" />
93        <ctl name="R DSP1 Firmware" value="Protection" />
94    </path>
95
96    <!-- DSP-initialization Stage -->
97    <path name="crus-dsp-pre-calibration-amp1">
98        <ctl name="Main AMP Enable Switch" value="1" />
99    </path>
100
101    <path name="crus-dsp-pre-calibration-amp2">
102        <ctl name="R Main AMP Enable Switch" value="1" />
103    </path>
104
105    <path name="crus-dsp-pre-calibration">
106        <path name="crus-dsp-pre-calibration-amp1" />
107        <path name="crus-dsp-pre-calibration-amp2" />
108    </path>
109
110    <path name="crus-dsp-pre-diagnostic-amp1">
111        <ctl name="Main AMP Enable Switch" value="1" />
112    </path>
113
114    <path name="crus-dsp-pre-diagnostic-amp2">
115        <ctl name="R Main AMP Enable Switch" value="1" />
116    </path>
117
118    <path name="crus-dsp-pre-diagnostic">
119        <path name="crus-dsp-pre-diagnostic-amp1" />
120        <path name="crus-dsp-pre-diagnostic-amp2" />
121    </path>
122
123    <path name="crus-dsp-pre-protection">
124        <ctl name="Main AMP Enable Switch" value="1" />
125        <ctl name="R Main AMP Enable Switch" value="1" />
126    </path>
127
128    <!-- Clock-trigger Stage -->
129    <path name="platform-controls">
130        <ctl name="PCM Playback Volume" value="1000"/>
131        <ctl name="SINK_IDS" id="0" value="0"/>
132        <ctl name="SINK_IDS" id="1" value="-1"/>
133        <ctl name="TDM_0_RX Mixer EP6" value="1"/>
134    </path>
135
136    <!-- Post loaded firmware -->
137    <path name="crus-dsp-post-loading-fw">
138        <ctl name="Main AMP Enable Switch" value="0" />
139        <ctl name="R Main AMP Enable Switch" value="0" />
140    </path>
141
142    <!-- Value & Information Fetch Stage -->
143    <path name="platform-values">
144        <ctl name="TDM_0_RX Format" />
145        <ctl name="TDM_0_RX Chan" />
146        <ctl name="TDM_0_RX Sample Rate" />
147        <ctl name="PCM Playback Volume" />
148        <ctl name="TDM_0_RX Mixer EP6" />
149    </path>
150
151    <path name="cs35l41-values">
152        <ctl name="DRE DRE Switch" />
153        <ctl name="R DRE DRE Switch" />
154        <ctl name="VBSTMON Output Switch" />
155        <ctl name="R VBSTMON Output Switch" />
156        <ctl name="AMP PCM Gain" />
157        <ctl name="R AMP PCM Gain" />
158        <ctl name="Digital PCM Volume" />
159        <ctl name="R Digital PCM Volume" />
160        <ctl name="PCM Source" />
161        <ctl name="R PCM Source" />
162        <ctl name="DSP Booted" />
163        <ctl name="R DSP Booted" />
164        <ctl name="Main AMP Enable Switch" />
165        <ctl name="R Main AMP Enable Switch" />
166        <ctl name="DSP1 Preload Switch" />
167        <ctl name="R DSP1 Preload Switch" />
168        <ctl name="DSP1 Firmware" />
169        <ctl name="R DSP1 Firmware" />
170    </path>
171
172
173    <!-- Note that the order of controls does matter because
174         it should be matched to the structure defined in
175         sp_cal_common.h -->
176    <!--
177        struct calibration_data {
178            unsigned int cal_r;
179            unsigned int cal_status;
180            unsigned int cal_checksum;
181            unsigned int cal_ambient;
182            unsigned int amp_pcm_gain;
183            unsigned int digital_pcm_gain;
184        };
185    -->
186    <path name="cs35l41-dsp-amp1-calibration-values">
187        <ctl name="DSP1 Calibration cd CAL_R" />
188        <ctl name="DSP1 Calibration cd CAL_STATUS" />
189        <ctl name="DSP1 Calibration cd CAL_CHECKSUM" />
190        <ctl name="DSP1 Calibration cd CAL_AMBIENT" />
191        <ctl name="AMP PCM Gain" />
192        <ctl name="Digital PCM Volume" />
193
194        <!-- Only for debug print -->
195        <ctl name="DSP1 Calibration cd CAL_SET_STATUS" />
196    </path>
197
198    <path name="cs35l41-dsp-amp2-calibration-values">
199        <ctl name="R DSP1 Calibration cd CAL_R" />
200        <ctl name="R DSP1 Calibration cd CAL_STATUS" />
201        <ctl name="R DSP1 Calibration cd CAL_CHECKSUM" />
202        <ctl name="R DSP1 Calibration cd CAL_AMBIENT" />
203        <ctl name="R AMP PCM Gain" />
204        <ctl name="R Digital PCM Volume" />
205
206        <!-- Only for debug print -->
207        <ctl name="R DSP1 Calibration cd CAL_SET_STATUS" />
208    </path>
209
210    <!--
211        struct diagnostic_data {
212            struct calibration_data calibration_data;
213            unsigned int z_low_diff;
214            unsigned int diag_f0;
215            unsigned int diag_f0_status;
216        };
217    -->
218    <path name="cs35l41-dsp-amp1-diagnostic-values">
219        <!-- struct calibration_data START -->
220        <ctl name="DSP1 Diagnostic cd CAL_R" />
221        <ctl name="DSP1 Diagnostic cd CAL_STATUS" />
222        <ctl name="DSP1 Diagnostic cd CAL_CHECKSUM" />
223        <ctl name="DSP1 Diagnostic cd CAL_AMBIENT" />
224        <ctl name="AMP PCM Gain" />
225        <ctl name="Digital PCM Volume" />
226        <!-- struct calibration_data END -->
227        <ctl name="DSP1 Diagnostic cd DIAG_Z_LOW_DIFF" />
228        <ctl name="DSP1 Diagnostic cd DIAG_F0" />
229        <ctl name="DSP1 Diagnostic cd DIAG_F0_STATUS" />
230
231        <!-- Only for debug print -->
232        <ctl name="DSP1 Diagnostic cd CAL_SET_STATUS" />
233    </path>
234
235    <path name="cs35l41-dsp-amp2-diagnostic-values">
236        <!-- struct calibration_data START -->
237        <ctl name="R DSP1 Diagnostic cd CAL_R" />
238        <ctl name="R DSP1 Diagnostic cd CAL_STATUS" />
239        <ctl name="R DSP1 Diagnostic cd CAL_CHECKSUM" />
240        <ctl name="R DSP1 Diagnostic cd CAL_AMBIENT" />
241        <ctl name="R AMP PCM Gain" />
242        <ctl name="R Digital PCM Volume" />
243        <!-- struct calibration_data END -->
244        <ctl name="R DSP1 Diagnostic cd DIAG_Z_LOW_DIFF" />
245        <ctl name="R DSP1 Diagnostic cd DIAG_F0" />
246        <ctl name="R DSP1 Diagnostic cd DIAG_F0_STATUS" />
247
248        <!-- Only for debug print -->
249        <ctl name="R DSP1 Diagnostic cd CAL_SET_STATUS" />
250    </path>
251
252    <path name="cs35l41-dsp-amp1-protection-values">
253        <!-- struct calibration_data START -->
254        <ctl name="DSP1 Protection cd CAL_R" />
255        <ctl name="DSP1 Protection cd CAL_STATUS" />
256        <ctl name="DSP1 Protection cd CAL_CHECKSUM" />
257        <ctl name="DSP1 Protection cd CAL_AMBIENT" />
258
259        <!-- These controls are unrelated so we can simply
260             skip them
261        <ctl name="AMP PCM Gain" />
262        <ctl name="Digital PCM Volume" />
263        -->
264        <!-- struct calibration_data END -->
265    </path>
266
267    <path name="cs35l41-dsp-amp2-protection-values">
268        <!-- struct calibration_data START -->
269        <ctl name="R DSP1 Protection cd CAL_R" />
270        <ctl name="R DSP1 Protection cd CAL_STATUS" />
271        <ctl name="R DSP1 Protection cd CAL_CHECKSUM" />
272        <ctl name="R DSP1 Protection cd CAL_AMBIENT" />
273
274        <!-- These controls are unrelated so we can simply
275             skip them
276        <ctl name="R AMP PCM Gain" />
277        <ctl name="R Digital PCM Volume" />
278        -->
279        <!-- struct calibration_data END -->
280    </path>
281
282    <path name="cs35l41-dsp-amp1-calibration-completion">
283        <ctl name="DSP1 Calibration cd CAL_STATUS" />
284    </path>
285
286    <path name="cs35l41-dsp-amp2-calibration-completion">
287        <ctl name="R DSP1 Calibration cd CAL_STATUS" />
288    </path>
289
290    <path name="cs35l41-dsp-amp1-protection-completion">
291        <ctl name="DSP1 Protection cd CAL_SET_STATUS" />
292    </path>
293
294    <path name="cs35l41-dsp-amp2-protection-completion">
295        <ctl name="R DSP1 Protection cd CAL_SET_STATUS" />
296    </path>
297
298    <path name="cs35l41-dsp-amp1-diagnostic-completion">
299        <ctl name="DSP1 Diagnostic cd CAL_STATUS" />
300        <ctl name="DSP1 Diagnostic cd DIAG_F0_STATUS" />
301    </path>
302
303    <path name="cs35l41-dsp-amp2-diagnostic-completion">
304        <ctl name="R DSP1 Diagnostic cd CAL_STATUS" />
305        <ctl name="R DSP1 Diagnostic cd DIAG_F0_STATUS" />
306    </path>
307
308    <path name="cs35l41-dsp-amp1-enable-status">
309        <ctl name="Main AMP Enable Switch" />
310    </path>
311
312    <path name="cs35l41-dsp-amp2-enable-status">
313        <ctl name="R Main AMP Enable Switch" />
314    </path>
315</mixer>
316