• Home
  • Raw
  • Download

Lines Matching +full:out +full:- +full:mono

2  * wm8753.c  --  WM8753 ALSA Soc Audio driver
4 * Copyright 2003-11 Wolfson Microelectronics PLC.
16 * Dual DAI:-
27 * Fast DAI switching:-
169 static const char *wm8753_mono_mix[] = {"Stereo", "Left", "Right", "Mono"};
171 static const char *wm8753_line_mix[] = {"Line 1 + 2", "Line 1 - 2",
176 static const char *wm8753_rxmsel[] = {"RXP - RXN", "RXP + RXN", "RXP", "RXN"};
179 static const char *wm8753_mono2_src[] = {"Inverted Mono 1", "Left", "Right",
183 static const char *wm8753_radcsel[] = {"PGA", "Line or RXP-RXN", "Sidetone"};
184 static const char *wm8753_ladcsel[] = {"PGA", "Line or RXP-RXN", "Line"};
186 "Analogue Mix Right", "Digital Mono Mix"};
235 ucontrol->value.enumerated.item[0] = wm8753->dai_func; in wm8753_get_dai()
246 if (wm8753->dai_func == ucontrol->value.enumerated.item[0]) in wm8753_set_dai()
250 return -EBUSY; in wm8753_set_dai()
254 wm8753->dai_func = ucontrol->value.enumerated.item[0]; in wm8753_set_dai()
256 if (((ioctl >> 2) & 0x3) == wm8753->dai_func) in wm8753_set_dai()
259 ioctl = (ioctl & 0x1f3) | (wm8753->dai_func << 2); in wm8753_set_dai()
263 wm8753_hifi_write_dai_fmt(component, wm8753->hifi_fmt); in wm8753_set_dai()
264 wm8753_voice_write_dai_fmt(component, wm8753->voice_fmt); in wm8753_set_dai()
269 static const DECLARE_TLV_DB_SCALE(rec_mix_tlv, -1500, 300, 0);
271 static const DECLARE_TLV_DB_SCALE(adc_tlv, -9750, 50, 1);
272 static const DECLARE_TLV_DB_SCALE(dac_tlv, -12750, 50, 1);
274 /* 0000000 - 0101111 = "Analogue mute" */
275 0, 48, TLV_DB_SCALE_ITEM(-25500, 0, 0),
276 48, 127, TLV_DB_SCALE_ITEM(-7300, 100, 0)
278 static const DECLARE_TLV_DB_SCALE(mix_tlv, -1500, 300, 0);
279 static const DECLARE_TLV_DB_SCALE(voice_mix_tlv, -1200, 300, 0);
280 static const DECLARE_TLV_DB_SCALE(pga_tlv, -1725, 75, 0);
283 SOC_SINGLE("Hi-Fi DAC Left/Right channel Swap", WM8753_HIFI, 5, 1, 0),
294 SOC_SINGLE_TLV("Mono Playback Volume", WM8753_MOUTV, 0, 127, 0, out_tlv),
308 SOC_SINGLE_TLV("Mono Bypass Playback Volume", WM8753_MOUTM1, 4, 7, 1, mix_tlv),
309 SOC_SINGLE_TLV("Mono Sidetone Playback Volume", WM8753_MOUTM2, 4, 7, 1,
311 SOC_SINGLE_TLV("Mono Voice Playback Volume", WM8753_MOUTM2, 0, 7, 1,
313 SOC_SINGLE("Mono Playback ZC Switch", WM8753_MOUTV, 7, 1, 0),
320 SOC_ENUM("Treble Cut-off", wm8753_enum[2]),
333 SOC_ENUM("Capture Filter Cut-off", wm8753_enum[24]),
348 SOC_ENUM("3D Upper Cut-off", wm8753_enum[6]),
349 SOC_ENUM("3D Lower Cut-off", wm8753_enum[7]),
356 SOC_ENUM("De-emphasis", wm8753_enum[8]),
357 SOC_ENUM("Playback Mono Mix", wm8753_enum[9]),
389 /* Mono mixer */
398 /* Mono 2 Mux */
402 /* Out 3 Mux */
406 /* Out 4 Mux */
410 /* ADC Mono Mix */
449 /* Mono Line mux */
469 SND_SOC_DAPM_PGA("Left Out 1", WM8753_PWR3, 8, 0, NULL, 0),
470 SND_SOC_DAPM_PGA("Left Out 2", WM8753_PWR3, 6, 0, NULL, 0),
476 SND_SOC_DAPM_PGA("Right Out 1", WM8753_PWR3, 7, 0, NULL, 0),
477 SND_SOC_DAPM_PGA("Right Out 2", WM8753_PWR3, 5, 0, NULL, 0),
481 SND_SOC_DAPM_MIXER("Mono Mixer", WM8753_PWR4, 2, 0,
483 SND_SOC_DAPM_PGA("Mono Out 1", WM8753_PWR3, 2, 0, NULL, 0),
484 SND_SOC_DAPM_PGA("Mono Out 2", WM8753_PWR3, 1, 0, NULL, 0),
487 SND_SOC_DAPM_MUX("Mono 2 Mux", SND_SOC_NOPM, 0, 0, &wm8753_mono2_controls),
491 SND_SOC_DAPM_PGA("Out 3", WM8753_PWR3, 4, 0, NULL, 0),
494 SND_SOC_DAPM_PGA("Out 4", WM8753_PWR3, 3, 0, NULL, 0),
519 SND_SOC_DAPM_MUX("Line Mono Mux", SND_SOC_NOPM, 0, 0,
555 /* mono mixer */
556 {"Mono Mixer", "Voice Playback Switch", "Voice DAC"},
557 {"Mono Mixer", "Left Playback Switch", "Left DAC"},
558 {"Mono Mixer", "Right Playback Switch", "Right DAC"},
559 {"Mono Mixer", "Sidetone Playback Switch", "Mic Sidetone Mux"},
560 {"Mono Mixer", "Bypass Playback Switch", "Line Mono Mux"},
562 /* left out */
563 {"Left Out 1", NULL, "Left Mixer"},
564 {"Left Out 2", NULL, "Left Mixer"},
565 {"LOUT1", NULL, "Left Out 1"},
566 {"LOUT2", NULL, "Left Out 2"},
568 /* right out */
569 {"Right Out 1", NULL, "Right Mixer"},
570 {"Right Out 2", NULL, "Right Mixer"},
571 {"ROUT1", NULL, "Right Out 1"},
572 {"ROUT2", NULL, "Right Out 2"},
574 /* mono 1 out */
575 {"Mono Out 1", NULL, "Mono Mixer"},
576 {"MONO1", NULL, "Mono Out 1"},
578 /* mono 2 out */
579 {"Mono 2 Mux", "Left + Right", "Out3 Left + Right"},
580 {"Mono 2 Mux", "Inverted Mono 1", "MONO1"},
581 {"Mono 2 Mux", "Left", "Left Mixer"},
582 {"Mono 2 Mux", "Right", "Right Mixer"},
583 {"Mono Out 2", NULL, "Mono 2 Mux"},
584 {"MONO2", NULL, "Mono Out 2"},
586 /* out 3 */
592 {"Out 3", NULL, "Out3 Mux"},
593 {"OUT3", NULL, "Out 3"},
595 /* out 4 */
599 {"Out 4", NULL, "Out4 Mux"},
600 {"OUT4", NULL, "Out 4"},
604 {"Playback Mixer", "Voice Capture Switch", "Mono Mixer"},
615 {"Capture Left Mux", "Line or RXP-RXN", "Line Left Mux"},
620 {"Capture Right Mux", "Line or RXP-RXN", "Line Right Mux"},
623 /* Mono Capture mixer-mux */
630 {"Capture Left Mixer", "Digital Mono Mix", "Capture Left Mux"},
631 {"Capture Left Mixer", "Digital Mono Mix", "Capture Right Mux"},
632 {"Capture Right Mixer", "Digital Mono Mix", "Capture Left Mux"},
633 {"Capture Right Mixer", "Digital Mono Mix", "Capture Right Mux"},
659 /* Line Mono Mux */
660 {"Line Mono Mux", "Line Mix", "Line Mixer"},
661 {"Line Mono Mux", "Rx Mix", "Rx Mixer"},
665 {"Line Mixer", "Line 1 - 2", "LINE1"},
667 {"Line Mixer", "Line 1 - 2", "LINE2"},
672 {"Rx Mixer", "RXP - RXN", "RXP"},
674 {"Rx Mixer", "RXP - RXN", "RXN"},
716 pll_div->div2 = 1; in pll_factors()
719 pll_div->div2 = 0; in pll_factors()
725 pll_div->n = Ndiv; in pll_factors()
740 pll_div->k = K; in pll_factors()
748 struct snd_soc_component *component = codec_dai->component; in wm8753_set_dai_pll()
751 return -ENODEV; in wm8753_set_dai_pll()
860 return -EINVAL; in get_coeff()
869 struct snd_soc_component *component = codec_dai->component; in wm8753_set_dai_sysclk()
879 wm8753->sysclk = freq; in wm8753_set_dai_sysclk()
882 wm8753->pcmclk = freq; in wm8753_set_dai_sysclk()
887 return -EINVAL; in wm8753_set_dai_sysclk()
915 return -EINVAL; in wm8753_vdac_adc_set_dai_fmt()
929 struct snd_soc_component *component = dai->component; in wm8753_pcm_hw_params()
950 if (params_rate(params) * 384 == wm8753->pcmclk) in wm8753_pcm_hw_params()
979 return -EINVAL; in wm8753_pcm_set_dai_fmt()
994 return -EINVAL; in wm8753_pcm_set_dai_fmt()
1014 return -EINVAL; in wm8753_pcm_set_dai_fmt()
1018 return -EINVAL; in wm8753_pcm_set_dai_fmt()
1029 struct snd_soc_component *component = codec_dai->component; in wm8753_set_dai_clkdiv()
1046 return -EINVAL; in wm8753_set_dai_clkdiv()
1076 return -EINVAL; in wm8753_hdac_set_dai_fmt()
1104 return -EINVAL; in wm8753_i2s_set_dai_fmt()
1119 return -EINVAL; in wm8753_i2s_set_dai_fmt()
1139 return -EINVAL; in wm8753_i2s_set_dai_fmt()
1143 return -EINVAL; in wm8753_i2s_set_dai_fmt()
1158 struct snd_soc_component *component = dai->component; in wm8753_i2s_hw_params()
1165 coeff = get_coeff(wm8753->sysclk, params_rate(params)); in wm8753_i2s_hw_params()
1232 return -EINVAL; in wm8753_mode3_4_set_dai_fmt()
1242 switch (wm8753->dai_func) { in wm8753_hifi_write_dai_fmt()
1265 struct snd_soc_component *component = codec_dai->component; in wm8753_hifi_set_dai_fmt()
1268 wm8753->hifi_fmt = fmt; in wm8753_hifi_set_dai_fmt()
1279 if (wm8753->dai_func != 0) in wm8753_voice_write_dai_fmt()
1295 struct snd_soc_component *component = codec_dai->component; in wm8753_voice_set_dai_fmt()
1298 wm8753->voice_fmt = fmt; in wm8753_voice_set_dai_fmt()
1305 struct snd_soc_component *component = dai->component; in wm8753_mute()
1311 if (mute && wm8753->dai_func == 1) { in wm8753_mute()
1330 regmap_update_bits(wm8753->regmap, WM8753_PWR1, 0x0180, 0x0100); in wm8753_charge_work()
1346 flush_delayed_work(&wm8753->charge_work); in wm8753_set_bias_level()
1352 schedule_delayed_work(&wm8753->charge_work, in wm8753_set_bias_level()
1360 cancel_delayed_work_sync(&wm8753->charge_work); in wm8753_set_bias_level()
1381 * 1. Voice over PCM DAI - HIFI DAC over HIFI DAI
1382 * 2. Voice over HIFI DAI - HIFI disabled
1383 * 3. Voice disabled - HIFI over HIFI
1384 * 4. Voice disabled - HIFI over HIFI, uses voice DAI LRC for capture
1406 { .name = "wm8753-hifi",
1424 { .name = "wm8753-voice",
1447 regcache_sync(wm8753->regmap); in wm8753_resume()
1457 INIT_DELAYED_WORK(&wm8753->charge_work, wm8753_charge_work); in wm8753_probe()
1461 dev_err(component->dev, "Failed to issue reset: %d\n", ret); in wm8753_probe()
1465 wm8753->dai_func = 0; in wm8753_probe()
1523 wm8753 = devm_kzalloc(&spi->dev, sizeof(struct wm8753_priv), in wm8753_spi_probe()
1526 return -ENOMEM; in wm8753_spi_probe()
1530 wm8753->regmap = devm_regmap_init_spi(spi, &wm8753_regmap); in wm8753_spi_probe()
1531 if (IS_ERR(wm8753->regmap)) { in wm8753_spi_probe()
1532 ret = PTR_ERR(wm8753->regmap); in wm8753_spi_probe()
1533 dev_err(&spi->dev, "Failed to allocate register map: %d\n", in wm8753_spi_probe()
1538 ret = devm_snd_soc_register_component(&spi->dev, &soc_component_dev_wm8753, in wm8753_spi_probe()
1541 dev_err(&spi->dev, "Failed to register CODEC: %d\n", ret); in wm8753_spi_probe()
1562 wm8753 = devm_kzalloc(&i2c->dev, sizeof(struct wm8753_priv), in wm8753_i2c_probe()
1565 return -ENOMEM; in wm8753_i2c_probe()
1569 wm8753->regmap = devm_regmap_init_i2c(i2c, &wm8753_regmap); in wm8753_i2c_probe()
1570 if (IS_ERR(wm8753->regmap)) { in wm8753_i2c_probe()
1571 ret = PTR_ERR(wm8753->regmap); in wm8753_i2c_probe()
1572 dev_err(&i2c->dev, "Failed to allocate register map: %d\n", in wm8753_i2c_probe()
1577 ret = devm_snd_soc_register_component(&i2c->dev, &soc_component_dev_wm8753, in wm8753_i2c_probe()
1580 dev_err(&i2c->dev, "Failed to register CODEC: %d\n", ret); in wm8753_i2c_probe()