diff options
Diffstat (limited to 'sound/soc/codecs/alc5632.c')
-rw-r--r-- | sound/soc/codecs/alc5632.c | 197 |
1 files changed, 136 insertions, 61 deletions
diff --git a/sound/soc/codecs/alc5632.c b/sound/soc/codecs/alc5632.c index 390e437d7c5e..e2111e0ccad7 100644 --- a/sound/soc/codecs/alc5632.c +++ b/sound/soc/codecs/alc5632.c | |||
@@ -145,15 +145,14 @@ static const DECLARE_TLV_DB_SCALE(hp_tlv, -4650, 150, 0); | |||
145 | /* -16.5db min scale, 1.5db steps, no mute */ | 145 | /* -16.5db min scale, 1.5db steps, no mute */ |
146 | static const DECLARE_TLV_DB_SCALE(adc_rec_tlv, -1650, 150, 0); | 146 | static const DECLARE_TLV_DB_SCALE(adc_rec_tlv, -1650, 150, 0); |
147 | static const unsigned int boost_tlv[] = { | 147 | static const unsigned int boost_tlv[] = { |
148 | TLV_DB_RANGE_HEAD(3), | 148 | TLV_DB_RANGE_HEAD(2), |
149 | 0, 0, TLV_DB_SCALE_ITEM(0, 0, 0), | 149 | 0, 1, TLV_DB_SCALE_ITEM(0, 2000, 0), |
150 | 1, 1, TLV_DB_SCALE_ITEM(2000, 0, 0), | 150 | 1, 3, TLV_DB_SCALE_ITEM(2000, 1000, 0), |
151 | 2, 2, TLV_DB_SCALE_ITEM(3000, 0, 0), | ||
152 | }; | 151 | }; |
153 | /* 0db min scale, 6 db steps, no mute */ | 152 | /* 0db min scale, 6 db steps, no mute */ |
154 | static const DECLARE_TLV_DB_SCALE(dig_tlv, 0, 600, 0); | 153 | static const DECLARE_TLV_DB_SCALE(dig_tlv, 0, 600, 0); |
155 | /* 0db min scalem 0.75db steps, no mute */ | 154 | /* 0db min scalem 0.75db steps, no mute */ |
156 | static const DECLARE_TLV_DB_SCALE(vdac_tlv, -3525, 075, 0); | 155 | static const DECLARE_TLV_DB_SCALE(vdac_tlv, -3525, 75, 0); |
157 | 156 | ||
158 | static const struct snd_kcontrol_new alc5632_vol_snd_controls[] = { | 157 | static const struct snd_kcontrol_new alc5632_vol_snd_controls[] = { |
159 | /* left starts at bit 8, right at bit 0 */ | 158 | /* left starts at bit 8, right at bit 0 */ |
@@ -176,26 +175,32 @@ static const struct snd_kcontrol_new alc5632_snd_controls[] = { | |||
176 | ALC5632_AUX_OUT_VOL, 15, 7, 1, 1), | 175 | ALC5632_AUX_OUT_VOL, 15, 7, 1, 1), |
177 | SOC_SINGLE_TLV("Voice DAC Playback Volume", | 176 | SOC_SINGLE_TLV("Voice DAC Playback Volume", |
178 | ALC5632_VOICE_DAC_VOL, 0, 63, 0, vdac_tlv), | 177 | ALC5632_VOICE_DAC_VOL, 0, 63, 0, vdac_tlv), |
179 | SOC_SINGLE_TLV("Phone Capture Volume", | 178 | SOC_SINGLE("Voice DAC Playback Switch", |
179 | ALC5632_VOICE_DAC_VOL, 12, 1, 1), | ||
180 | SOC_SINGLE_TLV("Phone Playback Volume", | ||
180 | ALC5632_PHONE_IN_VOL, 8, 31, 1, vol_tlv), | 181 | ALC5632_PHONE_IN_VOL, 8, 31, 1, vol_tlv), |
181 | SOC_DOUBLE_TLV("LineIn Capture Volume", | 182 | SOC_DOUBLE_TLV("LineIn Playback Volume", |
182 | ALC5632_LINE_IN_VOL, 8, 0, 31, 1, vol_tlv), | 183 | ALC5632_LINE_IN_VOL, 8, 0, 31, 1, vol_tlv), |
183 | SOC_DOUBLE_TLV("Master Playback Volume", | 184 | SOC_DOUBLE_TLV("Master Playback Volume", |
184 | ALC5632_STEREO_DAC_IN_VOL, 8, 0, 63, 1, vdac_tlv), | 185 | ALC5632_STEREO_DAC_IN_VOL, 8, 0, 63, 1, vdac_tlv), |
185 | SOC_DOUBLE("Master Playback Switch", | 186 | SOC_DOUBLE("Master Playback Switch", |
186 | ALC5632_STEREO_DAC_IN_VOL, 15, 7, 1, 1), | 187 | ALC5632_STEREO_DAC_IN_VOL, 15, 7, 1, 1), |
187 | SOC_SINGLE_TLV("Mic1 Capture Volume", | 188 | SOC_SINGLE_TLV("Mic1 Playback Volume", |
188 | ALC5632_MIC_VOL, 8, 31, 1, vol_tlv), | 189 | ALC5632_MIC_VOL, 8, 31, 1, vol_tlv), |
189 | SOC_SINGLE_TLV("Mic2 Capture Volume", | 190 | SOC_SINGLE_TLV("Mic2 Playback Volume", |
190 | ALC5632_MIC_VOL, 0, 31, 1, vol_tlv), | 191 | ALC5632_MIC_VOL, 0, 31, 1, vol_tlv), |
191 | SOC_DOUBLE_TLV("Rec Capture Volume", | 192 | SOC_DOUBLE_TLV("Rec Capture Volume", |
192 | ALC5632_ADC_REC_GAIN, 8, 0, 31, 0, adc_rec_tlv), | 193 | ALC5632_ADC_REC_GAIN, 8, 0, 31, 0, adc_rec_tlv), |
193 | SOC_SINGLE_TLV("Mic 1 Boost Volume", | 194 | SOC_SINGLE_TLV("Mic 1 Boost Volume", |
194 | ALC5632_MIC_CTRL, 10, 2, 0, boost_tlv), | 195 | ALC5632_MIC_CTRL, 10, 3, 0, boost_tlv), |
195 | SOC_SINGLE_TLV("Mic 2 Boost Volume", | 196 | SOC_SINGLE_TLV("Mic 2 Boost Volume", |
196 | ALC5632_MIC_CTRL, 8, 2, 0, boost_tlv), | 197 | ALC5632_MIC_CTRL, 8, 3, 0, boost_tlv), |
197 | SOC_SINGLE_TLV("Digital Boost Volume", | 198 | SOC_SINGLE_TLV("DMIC Boost Capture Volume", |
198 | ALC5632_DIGI_BOOST_CTRL, 0, 7, 0, dig_tlv), | 199 | ALC5632_DIGI_BOOST_CTRL, 0, 7, 0, dig_tlv), |
200 | SOC_SINGLE("DMIC En Capture Switch", | ||
201 | ALC5632_DIGI_BOOST_CTRL, 15, 1, 0), | ||
202 | SOC_SINGLE("DMIC PreFilter Capture Switch", | ||
203 | ALC5632_DIGI_BOOST_CTRL, 12, 1, 0), | ||
199 | }; | 204 | }; |
200 | 205 | ||
201 | /* | 206 | /* |
@@ -244,36 +249,48 @@ SOC_DAPM_SINGLE("VOICE2SPK Playback Switch", ALC5632_VOICE_DAC_VOL, 14, 1, 1), | |||
244 | 249 | ||
245 | /* Left Record Mixer */ | 250 | /* Left Record Mixer */ |
246 | static const struct snd_kcontrol_new alc5632_captureL_mixer_controls[] = { | 251 | static const struct snd_kcontrol_new alc5632_captureL_mixer_controls[] = { |
247 | SOC_DAPM_SINGLE("Mic1 Capture Switch", ALC5632_ADC_REC_MIXER, 14, 1, 1), | 252 | SOC_DAPM_SINGLE("MIC12REC_L Capture Switch", ALC5632_ADC_REC_MIXER, 14, 1, 1), |
248 | SOC_DAPM_SINGLE("Mic2 Capture Switch", ALC5632_ADC_REC_MIXER, 13, 1, 1), | 253 | SOC_DAPM_SINGLE("MIC22REC_L Capture Switch", ALC5632_ADC_REC_MIXER, 13, 1, 1), |
249 | SOC_DAPM_SINGLE("LineInL Capture Switch", ALC5632_ADC_REC_MIXER, 12, 1, 1), | 254 | SOC_DAPM_SINGLE("LIL2REC Capture Switch", ALC5632_ADC_REC_MIXER, 12, 1, 1), |
250 | SOC_DAPM_SINGLE("Left Phone Capture Switch", ALC5632_ADC_REC_MIXER, 11, 1, 1), | 255 | SOC_DAPM_SINGLE("PH2REC_L Capture Switch", ALC5632_ADC_REC_MIXER, 11, 1, 1), |
251 | SOC_DAPM_SINGLE("HPMixerL Capture Switch", ALC5632_ADC_REC_MIXER, 10, 1, 1), | 256 | SOC_DAPM_SINGLE("HPL2REC Capture Switch", ALC5632_ADC_REC_MIXER, 10, 1, 1), |
252 | SOC_DAPM_SINGLE("SPKMixer Capture Switch", ALC5632_ADC_REC_MIXER, 9, 1, 1), | 257 | SOC_DAPM_SINGLE("SPK2REC_L Capture Switch", ALC5632_ADC_REC_MIXER, 9, 1, 1), |
253 | SOC_DAPM_SINGLE("MonoMixer Capture Switch", ALC5632_ADC_REC_MIXER, 8, 1, 1), | 258 | SOC_DAPM_SINGLE("MONO2REC_L Capture Switch", ALC5632_ADC_REC_MIXER, 8, 1, 1), |
254 | }; | 259 | }; |
255 | 260 | ||
256 | /* Right Record Mixer */ | 261 | /* Right Record Mixer */ |
257 | static const struct snd_kcontrol_new alc5632_captureR_mixer_controls[] = { | 262 | static const struct snd_kcontrol_new alc5632_captureR_mixer_controls[] = { |
258 | SOC_DAPM_SINGLE("Mic1 Capture Switch", ALC5632_ADC_REC_MIXER, 6, 1, 1), | 263 | SOC_DAPM_SINGLE("MIC12REC_R Capture Switch", ALC5632_ADC_REC_MIXER, 6, 1, 1), |
259 | SOC_DAPM_SINGLE("Mic2 Capture Switch", ALC5632_ADC_REC_MIXER, 5, 1, 1), | 264 | SOC_DAPM_SINGLE("MIC22REC_R Capture Switch", ALC5632_ADC_REC_MIXER, 5, 1, 1), |
260 | SOC_DAPM_SINGLE("LineInR Capture Switch", ALC5632_ADC_REC_MIXER, 4, 1, 1), | 265 | SOC_DAPM_SINGLE("LIR2REC Capture Switch", ALC5632_ADC_REC_MIXER, 4, 1, 1), |
261 | SOC_DAPM_SINGLE("Right Phone Capture Switch", ALC5632_ADC_REC_MIXER, 3, 1, 1), | 266 | SOC_DAPM_SINGLE("PH2REC_R Capture Switch", ALC5632_ADC_REC_MIXER, 3, 1, 1), |
262 | SOC_DAPM_SINGLE("HPMixerR Capture Switch", ALC5632_ADC_REC_MIXER, 2, 1, 1), | 267 | SOC_DAPM_SINGLE("HPR2REC Capture Switch", ALC5632_ADC_REC_MIXER, 2, 1, 1), |
263 | SOC_DAPM_SINGLE("SPKMixer Capture Switch", ALC5632_ADC_REC_MIXER, 1, 1, 1), | 268 | SOC_DAPM_SINGLE("SPK2REC_R Capture Switch", ALC5632_ADC_REC_MIXER, 1, 1, 1), |
264 | SOC_DAPM_SINGLE("MonoMixer Capture Switch", ALC5632_ADC_REC_MIXER, 0, 1, 1), | 269 | SOC_DAPM_SINGLE("MONO2REC_R Capture Switch", ALC5632_ADC_REC_MIXER, 0, 1, 1), |
265 | }; | 270 | }; |
266 | 271 | ||
267 | static const char *alc5632_spk_n_sour_sel[] = { | 272 | /* Dmic Mixer */ |
273 | static const struct snd_kcontrol_new alc5632_dmicl_mixer_controls[] = { | ||
274 | SOC_DAPM_SINGLE("DMICL2ADC Capture Switch", ALC5632_DIGI_BOOST_CTRL, 7, 1, 1), | ||
275 | }; | ||
276 | static const struct snd_kcontrol_new alc5632_dmicr_mixer_controls[] = { | ||
277 | SOC_DAPM_SINGLE("DMICR2ADC Capture Switch", ALC5632_DIGI_BOOST_CTRL, 6, 1, 1), | ||
278 | }; | ||
279 | |||
280 | static const char * const alc5632_spk_n_sour_sel[] = { | ||
268 | "RN/-R", "RP/+R", "LN/-R", "Mute"}; | 281 | "RN/-R", "RP/+R", "LN/-R", "Mute"}; |
269 | static const char *alc5632_hpl_out_input_sel[] = { | 282 | static const char * const alc5632_hpl_out_input_sel[] = { |
270 | "Vmid", "HP Left Mix"}; | 283 | "Vmid", "HP Left Mix"}; |
271 | static const char *alc5632_hpr_out_input_sel[] = { | 284 | static const char * const alc5632_hpr_out_input_sel[] = { |
272 | "Vmid", "HP Right Mix"}; | 285 | "Vmid", "HP Right Mix"}; |
273 | static const char *alc5632_spkout_input_sel[] = { | 286 | static const char * const alc5632_spkout_input_sel[] = { |
274 | "Vmid", "HPOut Mix", "Speaker Mix", "Mono Mix"}; | 287 | "Vmid", "HPOut Mix", "Speaker Mix", "Mono Mix"}; |
275 | static const char *alc5632_aux_out_input_sel[] = { | 288 | static const char * const alc5632_aux_out_input_sel[] = { |
276 | "Vmid", "HPOut Mix", "Speaker Mix", "Mono Mix"}; | 289 | "Vmid", "HPOut Mix", "Speaker Mix", "Mono Mix"}; |
290 | static const char * const alc5632_adcr_func_sel[] = { | ||
291 | "Stereo ADC", "Voice ADC"}; | ||
292 | static const char * const alc5632_i2s_out_sel[] = { | ||
293 | "ADC LR", "Voice Stereo Digital"}; | ||
277 | 294 | ||
278 | /* auxout output mux */ | 295 | /* auxout output mux */ |
279 | static const struct soc_enum alc5632_aux_out_input_enum = | 296 | static const struct soc_enum alc5632_aux_out_input_enum = |
@@ -312,6 +329,17 @@ static const struct soc_enum alc5632_amp_enum = | |||
312 | static const struct snd_kcontrol_new alc5632_amp_mux_controls = | 329 | static const struct snd_kcontrol_new alc5632_amp_mux_controls = |
313 | SOC_DAPM_ENUM("AB-D Amp Mux", alc5632_amp_enum); | 330 | SOC_DAPM_ENUM("AB-D Amp Mux", alc5632_amp_enum); |
314 | 331 | ||
332 | /* ADC output select */ | ||
333 | static const struct soc_enum alc5632_adcr_func_enum = | ||
334 | SOC_ENUM_SINGLE(ALC5632_DAC_FUNC_SELECT, 5, 2, alc5632_adcr_func_sel); | ||
335 | static const struct snd_kcontrol_new alc5632_adcr_func_controls = | ||
336 | SOC_DAPM_ENUM("ADCR Mux", alc5632_adcr_func_enum); | ||
337 | |||
338 | /* I2S out select */ | ||
339 | static const struct soc_enum alc5632_i2s_out_enum = | ||
340 | SOC_ENUM_SINGLE(ALC5632_I2S_OUT_CTL, 5, 2, alc5632_i2s_out_sel); | ||
341 | static const struct snd_kcontrol_new alc5632_i2s_out_controls = | ||
342 | SOC_DAPM_ENUM("I2SOut Mux", alc5632_i2s_out_enum); | ||
315 | 343 | ||
316 | static const struct snd_soc_dapm_widget alc5632_dapm_widgets[] = { | 344 | static const struct snd_soc_dapm_widget alc5632_dapm_widgets[] = { |
317 | /* Muxes */ | 345 | /* Muxes */ |
@@ -325,6 +353,10 @@ SND_SOC_DAPM_MUX("Right Headphone Mux", SND_SOC_NOPM, 0, 0, | |||
325 | &alc5632_hpr_out_mux_controls), | 353 | &alc5632_hpr_out_mux_controls), |
326 | SND_SOC_DAPM_MUX("SpeakerOut N Mux", SND_SOC_NOPM, 0, 0, | 354 | SND_SOC_DAPM_MUX("SpeakerOut N Mux", SND_SOC_NOPM, 0, 0, |
327 | &alc5632_spkoutn_mux_controls), | 355 | &alc5632_spkoutn_mux_controls), |
356 | SND_SOC_DAPM_MUX("ADCR Mux", SND_SOC_NOPM, 0, 0, | ||
357 | &alc5632_adcr_func_controls), | ||
358 | SND_SOC_DAPM_MUX("I2SOut Mux", ALC5632_PWR_MANAG_ADD1, 11, 0, | ||
359 | &alc5632_i2s_out_controls), | ||
328 | 360 | ||
329 | /* output mixers */ | 361 | /* output mixers */ |
330 | SND_SOC_DAPM_MIXER("HP Mix", SND_SOC_NOPM, 0, 0, | 362 | SND_SOC_DAPM_MIXER("HP Mix", SND_SOC_NOPM, 0, 0, |
@@ -343,6 +375,12 @@ SND_SOC_DAPM_MIXER("Mono Mix", ALC5632_PWR_MANAG_ADD2, 2, 0, | |||
343 | SND_SOC_DAPM_MIXER("Speaker Mix", ALC5632_PWR_MANAG_ADD2, 3, 0, | 375 | SND_SOC_DAPM_MIXER("Speaker Mix", ALC5632_PWR_MANAG_ADD2, 3, 0, |
344 | &alc5632_speaker_mixer_controls[0], | 376 | &alc5632_speaker_mixer_controls[0], |
345 | ARRAY_SIZE(alc5632_speaker_mixer_controls)), | 377 | ARRAY_SIZE(alc5632_speaker_mixer_controls)), |
378 | SND_SOC_DAPM_MIXER("DMICL Mix", SND_SOC_NOPM, 0, 0, | ||
379 | &alc5632_dmicl_mixer_controls[0], | ||
380 | ARRAY_SIZE(alc5632_dmicl_mixer_controls)), | ||
381 | SND_SOC_DAPM_MIXER("DMICR Mix", SND_SOC_NOPM, 0, 0, | ||
382 | &alc5632_dmicr_mixer_controls[0], | ||
383 | ARRAY_SIZE(alc5632_dmicr_mixer_controls)), | ||
346 | 384 | ||
347 | /* input mixers */ | 385 | /* input mixers */ |
348 | SND_SOC_DAPM_MIXER("Left Capture Mix", ALC5632_PWR_MANAG_ADD2, 1, 0, | 386 | SND_SOC_DAPM_MIXER("Left Capture Mix", ALC5632_PWR_MANAG_ADD2, 1, 0, |
@@ -352,20 +390,28 @@ SND_SOC_DAPM_MIXER("Right Capture Mix", ALC5632_PWR_MANAG_ADD2, 0, 0, | |||
352 | &alc5632_captureR_mixer_controls[0], | 390 | &alc5632_captureR_mixer_controls[0], |
353 | ARRAY_SIZE(alc5632_captureR_mixer_controls)), | 391 | ARRAY_SIZE(alc5632_captureR_mixer_controls)), |
354 | 392 | ||
355 | SND_SOC_DAPM_DAC("Left DAC", "HiFi Playback", | 393 | SND_SOC_DAPM_AIF_IN("AIFRXL", "Left HiFi Playback", 0, SND_SOC_NOPM, 0, 0), |
356 | ALC5632_PWR_MANAG_ADD2, 9, 0), | 394 | SND_SOC_DAPM_AIF_IN("AIFRXR", "Right HiFi Playback", 0, SND_SOC_NOPM, 0, 0), |
357 | SND_SOC_DAPM_DAC("Right DAC", "HiFi Playback", | 395 | SND_SOC_DAPM_AIF_OUT("AIFTXL", "Left HiFi Capture", 0, SND_SOC_NOPM, 0, 0), |
358 | ALC5632_PWR_MANAG_ADD2, 8, 0), | 396 | SND_SOC_DAPM_AIF_OUT("AIFTXR", "Right HiFi Capture", 0, SND_SOC_NOPM, 0, 0), |
397 | SND_SOC_DAPM_AIF_IN("VAIFRX", "Voice Playback", 0, SND_SOC_NOPM, 0, 0), | ||
398 | SND_SOC_DAPM_AIF_OUT("VAIFTX", "Voice Capture", 0, SND_SOC_NOPM, 0, 0), | ||
399 | |||
400 | SND_SOC_DAPM_DAC("Voice DAC", NULL, ALC5632_PWR_MANAG_ADD2, 10, 0), | ||
401 | SND_SOC_DAPM_DAC("Left DAC", NULL, ALC5632_PWR_MANAG_ADD2, 9, 0), | ||
402 | SND_SOC_DAPM_DAC("Right DAC", NULL, ALC5632_PWR_MANAG_ADD2, 8, 0), | ||
403 | SND_SOC_DAPM_ADC("Left ADC", NULL, ALC5632_PWR_MANAG_ADD2, 7, 0), | ||
404 | SND_SOC_DAPM_ADC("Right ADC", NULL, ALC5632_PWR_MANAG_ADD2, 6, 0), | ||
405 | |||
359 | SND_SOC_DAPM_MIXER("DAC Left Channel", ALC5632_PWR_MANAG_ADD1, 15, 0, NULL, 0), | 406 | SND_SOC_DAPM_MIXER("DAC Left Channel", ALC5632_PWR_MANAG_ADD1, 15, 0, NULL, 0), |
360 | SND_SOC_DAPM_MIXER("DAC Right Channel", | 407 | SND_SOC_DAPM_MIXER("DAC Right Channel", |
361 | ALC5632_PWR_MANAG_ADD1, 14, 0, NULL, 0), | 408 | ALC5632_PWR_MANAG_ADD1, 14, 0, NULL, 0), |
362 | SND_SOC_DAPM_MIXER("I2S Mix", ALC5632_PWR_MANAG_ADD1, 11, 0, NULL, 0), | 409 | SND_SOC_DAPM_MIXER("I2S Mix", ALC5632_PWR_MANAG_ADD1, 11, 0, NULL, 0), |
363 | SND_SOC_DAPM_MIXER("Phone Mix", SND_SOC_NOPM, 0, 0, NULL, 0), | 410 | SND_SOC_DAPM_MIXER("Phone Mix", SND_SOC_NOPM, 0, 0, NULL, 0), |
364 | SND_SOC_DAPM_MIXER("Line Mix", SND_SOC_NOPM, 0, 0, NULL, 0), | 411 | SND_SOC_DAPM_MIXER("Line Mix", SND_SOC_NOPM, 0, 0, NULL, 0), |
365 | SND_SOC_DAPM_ADC("Left ADC", "HiFi Capture", | 412 | SND_SOC_DAPM_MIXER("Voice Mix", SND_SOC_NOPM, 0, 0, NULL, 0), |
366 | ALC5632_PWR_MANAG_ADD2, 7, 0), | 413 | SND_SOC_DAPM_MIXER("ADCLR", SND_SOC_NOPM, 0, 0, NULL, 0), |
367 | SND_SOC_DAPM_ADC("Right ADC", "HiFi Capture", | 414 | |
368 | ALC5632_PWR_MANAG_ADD2, 6, 0), | ||
369 | SND_SOC_DAPM_PGA("Left Headphone", ALC5632_PWR_MANAG_ADD3, 11, 0, NULL, 0), | 415 | SND_SOC_DAPM_PGA("Left Headphone", ALC5632_PWR_MANAG_ADD3, 11, 0, NULL, 0), |
370 | SND_SOC_DAPM_PGA("Right Headphone", ALC5632_PWR_MANAG_ADD3, 10, 0, NULL, 0), | 416 | SND_SOC_DAPM_PGA("Right Headphone", ALC5632_PWR_MANAG_ADD3, 10, 0, NULL, 0), |
371 | SND_SOC_DAPM_PGA("Left Speaker", ALC5632_PWR_MANAG_ADD3, 13, 0, NULL, 0), | 417 | SND_SOC_DAPM_PGA("Left Speaker", ALC5632_PWR_MANAG_ADD3, 13, 0, NULL, 0), |
@@ -393,10 +439,12 @@ SND_SOC_DAPM_OUTPUT("HPL"), | |||
393 | SND_SOC_DAPM_OUTPUT("HPR"), | 439 | SND_SOC_DAPM_OUTPUT("HPR"), |
394 | SND_SOC_DAPM_OUTPUT("SPKOUT"), | 440 | SND_SOC_DAPM_OUTPUT("SPKOUT"), |
395 | SND_SOC_DAPM_OUTPUT("SPKOUTN"), | 441 | SND_SOC_DAPM_OUTPUT("SPKOUTN"), |
442 | |||
396 | SND_SOC_DAPM_INPUT("LINEINL"), | 443 | SND_SOC_DAPM_INPUT("LINEINL"), |
397 | SND_SOC_DAPM_INPUT("LINEINR"), | 444 | SND_SOC_DAPM_INPUT("LINEINR"), |
398 | SND_SOC_DAPM_INPUT("PHONEP"), | 445 | SND_SOC_DAPM_INPUT("PHONEP"), |
399 | SND_SOC_DAPM_INPUT("PHONEN"), | 446 | SND_SOC_DAPM_INPUT("PHONEN"), |
447 | SND_SOC_DAPM_INPUT("DMICDAT"), | ||
400 | SND_SOC_DAPM_INPUT("MIC1"), | 448 | SND_SOC_DAPM_INPUT("MIC1"), |
401 | SND_SOC_DAPM_INPUT("MIC2"), | 449 | SND_SOC_DAPM_INPUT("MIC2"), |
402 | SND_SOC_DAPM_VMID("Vmid"), | 450 | SND_SOC_DAPM_VMID("Vmid"), |
@@ -404,6 +452,10 @@ SND_SOC_DAPM_VMID("Vmid"), | |||
404 | 452 | ||
405 | 453 | ||
406 | static const struct snd_soc_dapm_route alc5632_dapm_routes[] = { | 454 | static const struct snd_soc_dapm_route alc5632_dapm_routes[] = { |
455 | /* Playback streams */ | ||
456 | {"Left DAC", NULL, "AIFRXL"}, | ||
457 | {"Right DAC", NULL, "AIFRXR"}, | ||
458 | |||
407 | /* virtual mixer - mixes left & right channels */ | 459 | /* virtual mixer - mixes left & right channels */ |
408 | {"I2S Mix", NULL, "Left DAC"}, | 460 | {"I2S Mix", NULL, "Left DAC"}, |
409 | {"I2S Mix", NULL, "Right DAC"}, | 461 | {"I2S Mix", NULL, "Right DAC"}, |
@@ -426,9 +478,12 @@ static const struct snd_soc_dapm_route alc5632_dapm_routes[] = { | |||
426 | {"HP Mix", "PHONE2HP Playback Switch", "Phone Mix"}, | 478 | {"HP Mix", "PHONE2HP Playback Switch", "Phone Mix"}, |
427 | {"HP Mix", "MIC12HP Playback Switch", "MIC1 PGA"}, | 479 | {"HP Mix", "MIC12HP Playback Switch", "MIC1 PGA"}, |
428 | {"HP Mix", "MIC22HP Playback Switch", "MIC2 PGA"}, | 480 | {"HP Mix", "MIC22HP Playback Switch", "MIC2 PGA"}, |
429 | 481 | {"HP Mix", "VOICE2HP Playback Switch", "Voice Mix"}, | |
430 | {"HPR Mix", "DACR2HP Playback Switch", "DAC Right Channel"}, | 482 | {"HPR Mix", "DACR2HP Playback Switch", "DAC Right Channel"}, |
431 | {"HPL Mix", "DACL2HP Playback Switch", "DAC Left Channel"}, | 483 | {"HPL Mix", "DACL2HP Playback Switch", "DAC Left Channel"}, |
484 | {"HPOut Mix", NULL, "HP Mix"}, | ||
485 | {"HPOut Mix", NULL, "HPR Mix"}, | ||
486 | {"HPOut Mix", NULL, "HPL Mix"}, | ||
432 | 487 | ||
433 | /* speaker mixer */ | 488 | /* speaker mixer */ |
434 | {"Speaker Mix", "LI2SPK Playback Switch", "Line Mix"}, | 489 | {"Speaker Mix", "LI2SPK Playback Switch", "Line Mix"}, |
@@ -436,35 +491,34 @@ static const struct snd_soc_dapm_route alc5632_dapm_routes[] = { | |||
436 | {"Speaker Mix", "MIC12SPK Playback Switch", "MIC1 PGA"}, | 491 | {"Speaker Mix", "MIC12SPK Playback Switch", "MIC1 PGA"}, |
437 | {"Speaker Mix", "MIC22SPK Playback Switch", "MIC2 PGA"}, | 492 | {"Speaker Mix", "MIC22SPK Playback Switch", "MIC2 PGA"}, |
438 | {"Speaker Mix", "DAC2SPK Playback Switch", "DAC Left Channel"}, | 493 | {"Speaker Mix", "DAC2SPK Playback Switch", "DAC Left Channel"}, |
439 | 494 | {"Speaker Mix", "VOICE2SPK Playback Switch", "Voice Mix"}, | |
440 | |||
441 | 495 | ||
442 | /* mono mixer */ | 496 | /* mono mixer */ |
443 | {"Mono Mix", "ADC2MONO_L Playback Switch", "Left Capture Mix"}, | 497 | {"Mono Mix", "ADC2MONO_L Playback Switch", "Left Capture Mix"}, |
444 | {"Mono Mix", "ADC2MONO_R Playback Switch", "Right Capture Mix"}, | 498 | {"Mono Mix", "ADC2MONO_R Playback Switch", "Right Capture Mix"}, |
445 | {"Mono Mix", "LI2MONO Playback Switch", "Line Mix"}, | 499 | {"Mono Mix", "LI2MONO Playback Switch", "Line Mix"}, |
446 | {"Mono Mix", "VOICE2MONO Playback Switch", "Phone Mix"}, | ||
447 | {"Mono Mix", "MIC12MONO Playback Switch", "MIC1 PGA"}, | 500 | {"Mono Mix", "MIC12MONO Playback Switch", "MIC1 PGA"}, |
448 | {"Mono Mix", "MIC22MONO Playback Switch", "MIC2 PGA"}, | 501 | {"Mono Mix", "MIC22MONO Playback Switch", "MIC2 PGA"}, |
449 | {"Mono Mix", "DAC2MONO Playback Switch", "DAC Left Channel"}, | 502 | {"Mono Mix", "DAC2MONO Playback Switch", "DAC Left Channel"}, |
503 | {"Mono Mix", "VOICE2MONO Playback Switch", "Voice Mix"}, | ||
450 | 504 | ||
451 | /* Left record mixer */ | 505 | /* Left record mixer */ |
452 | {"Left Capture Mix", "LineInL Capture Switch", "LINEINL"}, | 506 | {"Left Capture Mix", "LIL2REC Capture Switch", "LINEINL"}, |
453 | {"Left Capture Mix", "Left Phone Capture Switch", "PHONEN"}, | 507 | {"Left Capture Mix", "PH2REC_L Capture Switch", "PHONEN"}, |
454 | {"Left Capture Mix", "Mic1 Capture Switch", "MIC1 Pre Amp"}, | 508 | {"Left Capture Mix", "MIC12REC_L Capture Switch", "MIC1 Pre Amp"}, |
455 | {"Left Capture Mix", "Mic2 Capture Switch", "MIC2 Pre Amp"}, | 509 | {"Left Capture Mix", "MIC22REC_L Capture Switch", "MIC2 Pre Amp"}, |
456 | {"Left Capture Mix", "HPMixerL Capture Switch", "HPL Mix"}, | 510 | {"Left Capture Mix", "HPL2REC Capture Switch", "HPL Mix"}, |
457 | {"Left Capture Mix", "SPKMixer Capture Switch", "Speaker Mix"}, | 511 | {"Left Capture Mix", "SPK2REC_L Capture Switch", "Speaker Mix"}, |
458 | {"Left Capture Mix", "MonoMixer Capture Switch", "Mono Mix"}, | 512 | {"Left Capture Mix", "MONO2REC_L Capture Switch", "Mono Mix"}, |
459 | 513 | ||
460 | /*Right record mixer */ | 514 | /*Right record mixer */ |
461 | {"Right Capture Mix", "LineInR Capture Switch", "LINEINR"}, | 515 | {"Right Capture Mix", "LIR2REC Capture Switch", "LINEINR"}, |
462 | {"Right Capture Mix", "Right Phone Capture Switch", "PHONEP"}, | 516 | {"Right Capture Mix", "PH2REC_R Capture Switch", "PHONEP"}, |
463 | {"Right Capture Mix", "Mic1 Capture Switch", "MIC1 Pre Amp"}, | 517 | {"Right Capture Mix", "MIC12REC_R Capture Switch", "MIC1 Pre Amp"}, |
464 | {"Right Capture Mix", "Mic2 Capture Switch", "MIC2 Pre Amp"}, | 518 | {"Right Capture Mix", "MIC22REC_R Capture Switch", "MIC2 Pre Amp"}, |
465 | {"Right Capture Mix", "HPMixerR Capture Switch", "HPR Mix"}, | 519 | {"Right Capture Mix", "HPR2REC Capture Switch", "HPR Mix"}, |
466 | {"Right Capture Mix", "SPKMixer Capture Switch", "Speaker Mix"}, | 520 | {"Right Capture Mix", "SPK2REC_R Capture Switch", "Speaker Mix"}, |
467 | {"Right Capture Mix", "MonoMixer Capture Switch", "Mono Mix"}, | 521 | {"Right Capture Mix", "MONO2REC_R Capture Switch", "Mono Mix"}, |
468 | 522 | ||
469 | /* headphone left mux */ | 523 | /* headphone left mux */ |
470 | {"Left Headphone Mux", "HP Left Mix", "HPL Mix"}, | 524 | {"Left Headphone Mux", "HP Left Mix", "HPL Mix"}, |
@@ -504,10 +558,30 @@ static const struct snd_soc_dapm_route alc5632_dapm_routes[] = { | |||
504 | 558 | ||
505 | /* left ADC */ | 559 | /* left ADC */ |
506 | {"Left ADC", NULL, "Left Capture Mix"}, | 560 | {"Left ADC", NULL, "Left Capture Mix"}, |
561 | {"DMICL Mix", "DMICL2ADC Capture Switch", "DMICDAT"}, | ||
562 | {"Left ADC", NULL, "DMICL Mix"}, | ||
563 | {"ADCLR", NULL, "Left ADC"}, | ||
507 | 564 | ||
508 | /* right ADC */ | 565 | /* right ADC */ |
509 | {"Right ADC", NULL, "Right Capture Mix"}, | 566 | {"Right ADC", NULL, "Right Capture Mix"}, |
510 | 567 | {"DMICR Mix", "DMICR2ADC Capture Switch", "DMICDAT"}, | |
568 | {"Right ADC", NULL, "DMICR Mix"}, | ||
569 | {"ADCR Mux", "Stereo ADC", "Right ADC"}, | ||
570 | {"ADCR Mux", "Voice ADC", "Right ADC"}, | ||
571 | {"ADCLR", NULL, "ADCR Mux"}, | ||
572 | {"VAIFTX", NULL, "ADCR Mux"}, | ||
573 | |||
574 | /* Digital I2S out */ | ||
575 | {"I2SOut Mux", "ADC LR", "ADCLR"}, | ||
576 | {"I2SOut Mux", "Voice Stereo Digital", "VAIFRX"}, | ||
577 | {"AIFTXL", NULL, "I2SOut Mux"}, | ||
578 | {"AIFTXR", NULL, "I2SOut Mux"}, | ||
579 | |||
580 | /* Voice Mix */ | ||
581 | {"Voice DAC", NULL, "VAIFRX"}, | ||
582 | {"Voice Mix", NULL, "Voice DAC"}, | ||
583 | |||
584 | /* Speaker Output */ | ||
511 | {"SpeakerOut N Mux", "RN/-R", "Left Speaker"}, | 585 | {"SpeakerOut N Mux", "RN/-R", "Left Speaker"}, |
512 | {"SpeakerOut N Mux", "RP/+R", "Left Speaker"}, | 586 | {"SpeakerOut N Mux", "RP/+R", "Left Speaker"}, |
513 | {"SpeakerOut N Mux", "LN/-R", "Left Speaker"}, | 587 | {"SpeakerOut N Mux", "LN/-R", "Left Speaker"}, |
@@ -714,6 +788,7 @@ static int alc5632_set_dai_sysclk(struct snd_soc_dai *codec_dai, | |||
714 | struct alc5632_priv *alc5632 = snd_soc_codec_get_drvdata(codec); | 788 | struct alc5632_priv *alc5632 = snd_soc_codec_get_drvdata(codec); |
715 | 789 | ||
716 | switch (freq) { | 790 | switch (freq) { |
791 | case 4096000: | ||
717 | case 8192000: | 792 | case 8192000: |
718 | case 11289600: | 793 | case 11289600: |
719 | case 12288000: | 794 | case 12288000: |
@@ -994,7 +1069,7 @@ static int alc5632_probe(struct snd_soc_codec *codec) | |||
994 | 1069 | ||
995 | switch (alc5632->id) { | 1070 | switch (alc5632->id) { |
996 | case 0x5c: | 1071 | case 0x5c: |
997 | snd_soc_add_controls(codec, alc5632_vol_snd_controls, | 1072 | snd_soc_add_codec_controls(codec, alc5632_vol_snd_controls, |
998 | ARRAY_SIZE(alc5632_vol_snd_controls)); | 1073 | ARRAY_SIZE(alc5632_vol_snd_controls)); |
999 | break; | 1074 | break; |
1000 | default: | 1075 | default: |
@@ -1109,7 +1184,7 @@ static __devinit int alc5632_i2c_probe(struct i2c_client *client, | |||
1109 | return ret; | 1184 | return ret; |
1110 | } | 1185 | } |
1111 | 1186 | ||
1112 | static int alc5632_i2c_remove(struct i2c_client *client) | 1187 | static __devexit int alc5632_i2c_remove(struct i2c_client *client) |
1113 | { | 1188 | { |
1114 | struct alc5632_priv *alc5632 = i2c_get_clientdata(client); | 1189 | struct alc5632_priv *alc5632 = i2c_get_clientdata(client); |
1115 | snd_soc_unregister_codec(&client->dev); | 1190 | snd_soc_unregister_codec(&client->dev); |