1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
|
/*
* MC-1N2 ASoC codec driver - private header
*
* Copyright (c) 2010 Yamaha Corporation
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/
#ifndef MC1N2_PRIV_H
#define MC1N2_PRIV_H
#include "mcdriver.h"
/*
* Virtual registers
*/
enum {
MC1N2_DVOL_AD0,
MC1N2_DVOL_AENG6,
MC1N2_DVOL_PDM,
MC1N2_DVOL_DIR0,
MC1N2_DVOL_DIR1,
MC1N2_DVOL_DIR2,
MC1N2_DVOL_AD0_ATT,
MC1N2_DVOL_DIR0_ATT,
MC1N2_DVOL_DIR1_ATT,
MC1N2_DVOL_DIR2_ATT,
MC1N2_DVOL_SIDETONE,
MC1N2_DVOL_DAC_MASTER,
MC1N2_DVOL_DAC_VOICE,
MC1N2_DVOL_DAC_ATT,
MC1N2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UT1R_DACR_SW,
MC1N2_LOUT2L_MIC1_SW,
MC1N2_LOUT2L_MIC2_SW,
MC1N2_LOUT2L_MIC3_SW,
MC1N2_LOUT2L_LINE_SW,
MC1N2_LOUT2L_DAC_SW,
MC1N2_LOUT2R_MIC1_SW,
MC1N2_LOUT2R_MIC2_SW,
MC1N2_LOUT2R_MIC3_SW,
MC1N2_LOUT2R_LINER_SW,
MC1N2_LOUT2R_DACR_SW,
MC1N2_DMIX_ADC_SW,
MC1N2_DMIX_DIR0_SW,
MC1N2_DMIX_DIR1_SW,
MC1N2_DMIX_DIR2_SW,
MC1N2_DACMAIN_SRC,
MC1N2_DACVOICE_SRC,
MC1N2_DIT0_SRC,
MC1N2_DIT1_SRC,
MC1N2_DIT2_SRC,
MC1N2_AE_SRC,
MC1N2_ADCL_LINE_SRC,
MC1N2_ADCR_LINE_SRC,
MC1N2_HPL_LINE_SRC,
MC1N2_HPL_DAC_SRC,
MC1N2_SPL_LINE_SRC,
MC1N2_SPL_DAC_SRC,
MC1N2_SPR_LINE_SRC,
MC1N2_SPR_DAC_SRC,
MC1N2_LOUT1L_LINE_SRC,
MC1N2_LOUT1L_DAC_SRC,
MC1N2_LOUT2L_LINE_SRC,
MC1N2_LOUT2L_DAC_SRC,
MC1N2_AE_PARAM_SEL,
MC1N2_ADC_PDM_SEL,
MC1N2_MICBIAS1,
MC1N2_MICBIAS2,
MC1N2_MICBIAS3,
MC1N2_N_REG
};
#define MC1N2_N_VOL_REG MC1N2_ADCL_MIC1_SW
#define MC1N2_DSOURCE_OFF 0
#define MC1N2_DSOURCE_ADC 1
#define MC1N2_DSOURCE_DIR0 2
#define MC1N2_DSOURCE_DIR1 3
#define MC1N2_DSOURCE_DIR2 4
#define MC1N2_DSOURCE_MIX 5
#define MC1N2_AE_PARAM_1 0
#define MC1N2_AE_PARAM_2 1
#define MC1N2_AE_PARAM_3 2
#define MC1N2_AE_PARAM_4 3
#define MC1N2_AE_PARAM_5 4
#define mc1n2_i2c_read_byte(c,r) i2c_smbus_read_byte_data((c), (r)<<1)
extern struct i2c_client *mc1n2_get_i2c_client(void);
/*
* For debugging
*/
#ifdef CONFIG_SND_SOC_MC1N2_DEBUG
#define dbg_info(format, arg...) snd_printd(KERN_INFO format, ## arg)
#define TRACE_FUNC() snd_printd(KERN_INFO "<trace> %s()\n", __FUNCTION__)
#define _McDrv_Ctrl McDrv_Ctrl_dbg
extern SINT32 McDrv_Ctrl_dbg(UINT32 dCmd, void *pvPrm, UINT32 dPrm);
#else
#define dbg_info(format, arg...)
#define TRACE_FUNC()
#define _McDrv_Ctrl McDrv_Ctrl
#endif /* CONFIG_SND_SOC_MC1N2_DEBUG */
#endif /* MC1N2_PRIV_H */
|