Lines Matching +full:spi +full:- +full:mux
2 * wm8988.c -- WM8988 ALSA SoC audio driver
20 #include <linux/spi/spi.h>
170 static const DECLARE_TLV_DB_SCALE(pga_tlv, -1725, 75, 0);
171 static const DECLARE_TLV_DB_SCALE(adc_tlv, -9750, 50, 1);
172 static const DECLARE_TLV_DB_SCALE(dac_tlv, -12750, 50, 1);
173 static const DECLARE_TLV_DB_SCALE(out_tlv, -12100, 100, 1);
174 static const DECLARE_TLV_DB_SCALE(bypass_tlv, -1500, 300, 0);
183 SOC_ENUM("Treble Cut-off", treble),
187 SOC_ENUM("3D Lower Cut-off", stereo_3d_lc),
188 SOC_ENUM("3D Upper Cut-off", stereo_3d_uc),
211 SOC_ENUM("Playback De-emphasis", deemph),
247 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wm8988_lrc_control()
300 /* Left PGA Mux */
309 /* Right PGA Mux */
318 /* Differential Mux */
325 /* Mono ADC Mux */
336 SND_SOC_DAPM_MUX("Differential Mux", SND_SOC_NOPM, 0, 0,
338 SND_SOC_DAPM_MUX("Left ADC Mux", SND_SOC_NOPM, 0, 0,
340 SND_SOC_DAPM_MUX("Right ADC Mux", SND_SOC_NOPM, 0, 0,
343 SND_SOC_DAPM_MUX("Left PGA Mux", WM8988_PWR1, 5, 0,
345 SND_SOC_DAPM_MUX("Right PGA Mux", WM8988_PWR1, 4, 0,
348 SND_SOC_DAPM_MUX("Left Line Mux", SND_SOC_NOPM, 0, 0,
350 SND_SOC_DAPM_MUX("Right Line Mux", SND_SOC_NOPM, 0, 0,
387 { "Left Line Mux", "Line 1", "LINPUT1" },
388 { "Left Line Mux", "Line 2", "LINPUT2" },
389 { "Left Line Mux", "PGA", "Left PGA Mux" },
390 { "Left Line Mux", "Differential", "Differential Mux" },
392 { "Right Line Mux", "Line 1", "RINPUT1" },
393 { "Right Line Mux", "Line 2", "RINPUT2" },
394 { "Right Line Mux", "PGA", "Right PGA Mux" },
395 { "Right Line Mux", "Differential", "Differential Mux" },
397 { "Left PGA Mux", "Line 1", "LINPUT1" },
398 { "Left PGA Mux", "Line 2", "LINPUT2" },
399 { "Left PGA Mux", "Differential", "Differential Mux" },
401 { "Right PGA Mux", "Line 1", "RINPUT1" },
402 { "Right PGA Mux", "Line 2", "RINPUT2" },
403 { "Right PGA Mux", "Differential", "Differential Mux" },
405 { "Differential Mux", "Line 1", "LINPUT1" },
406 { "Differential Mux", "Line 1", "RINPUT1" },
407 { "Differential Mux", "Line 2", "LINPUT2" },
408 { "Differential Mux", "Line 2", "RINPUT2" },
410 { "Left ADC Mux", "Stereo", "Left PGA Mux" },
411 { "Left ADC Mux", "Mono (Left)", "Left PGA Mux" },
412 { "Left ADC Mux", "Digital Mono", "Left PGA Mux" },
414 { "Right ADC Mux", "Stereo", "Right PGA Mux" },
415 { "Right ADC Mux", "Mono (Right)", "Right PGA Mux" },
416 { "Right ADC Mux", "Digital Mono", "Right PGA Mux" },
418 { "Left ADC", NULL, "Left ADC Mux" },
419 { "Right ADC", NULL, "Right ADC Mux" },
421 { "Left Line Mux", "Line 1", "LINPUT1" },
422 { "Left Line Mux", "Line 2", "LINPUT2" },
423 { "Left Line Mux", "PGA", "Left PGA Mux" },
424 { "Left Line Mux", "Differential", "Differential Mux" },
426 { "Right Line Mux", "Line 1", "RINPUT1" },
427 { "Right Line Mux", "Line 2", "RINPUT2" },
428 { "Right Line Mux", "PGA", "Right PGA Mux" },
429 { "Right Line Mux", "Differential", "Differential Mux" },
432 { "Left Mixer", "Left Bypass Switch", "Left Line Mux" },
434 { "Left Mixer", "Right Bypass Switch", "Right Line Mux" },
437 { "Right Mixer", "Left Bypass Switch", "Left Line Mux" },
439 { "Right Mixer", "Right Bypass Switch", "Right Line Mux" },
519 return -EINVAL; in get_coeff()
558 struct snd_soc_component *component = codec_dai->component; in wm8988_set_dai_sysclk()
566 wm8988->sysclk_constraints = &constraints_112896; in wm8988_set_dai_sysclk()
567 wm8988->sysclk = freq; in wm8988_set_dai_sysclk()
574 wm8988->sysclk_constraints = &constraints_12288; in wm8988_set_dai_sysclk()
575 wm8988->sysclk = freq; in wm8988_set_dai_sysclk()
580 wm8988->sysclk_constraints = &constraints_12; in wm8988_set_dai_sysclk()
581 wm8988->sysclk = freq; in wm8988_set_dai_sysclk()
584 return -EINVAL; in wm8988_set_dai_sysclk()
590 struct snd_soc_component *component = codec_dai->component; in wm8988_set_dai_fmt()
601 return -EINVAL; in wm8988_set_dai_fmt()
621 return -EINVAL; in wm8988_set_dai_fmt()
638 return -EINVAL; in wm8988_set_dai_fmt()
648 struct snd_soc_component *component = dai->component; in wm8988_pcm_startup()
652 * MCLK supplied to the CODEC - enforce this. in wm8988_pcm_startup()
654 if (!wm8988->sysclk) { in wm8988_pcm_startup()
655 dev_err(component->dev, in wm8988_pcm_startup()
657 return -EINVAL; in wm8988_pcm_startup()
660 snd_pcm_hw_constraint_list(substream->runtime, 0, in wm8988_pcm_startup()
662 wm8988->sysclk_constraints); in wm8988_pcm_startup()
671 struct snd_soc_component *component = dai->component; in wm8988_pcm_hw_params()
677 coeff = get_coeff(wm8988->sysclk, params_rate(params)); in wm8988_pcm_hw_params()
679 coeff = get_coeff(wm8988->sysclk / 2, params_rate(params)); in wm8988_pcm_hw_params()
683 dev_err(component->dev, in wm8988_pcm_hw_params()
685 params_rate(params), wm8988->sysclk); in wm8988_pcm_hw_params()
715 struct snd_soc_component *component = dai->component; in wm8988_mute()
742 regcache_sync(wm8988->regmap); in wm8988_set_bias_level()
776 .name = "wm8988-hifi",
801 dev_err(component->dev, "Failed to issue reset\n"); in wm8988_probe()
844 static int wm8988_spi_probe(struct spi_device *spi) in wm8988_spi_probe() argument
849 wm8988 = devm_kzalloc(&spi->dev, sizeof(struct wm8988_priv), in wm8988_spi_probe()
852 return -ENOMEM; in wm8988_spi_probe()
854 wm8988->regmap = devm_regmap_init_spi(spi, &wm8988_regmap); in wm8988_spi_probe()
855 if (IS_ERR(wm8988->regmap)) { in wm8988_spi_probe()
856 ret = PTR_ERR(wm8988->regmap); in wm8988_spi_probe()
857 dev_err(&spi->dev, "Failed to init regmap: %d\n", ret); in wm8988_spi_probe()
861 spi_set_drvdata(spi, wm8988); in wm8988_spi_probe()
863 ret = devm_snd_soc_register_component(&spi->dev, in wm8988_spi_probe()
883 wm8988 = devm_kzalloc(&i2c->dev, sizeof(struct wm8988_priv), in wm8988_i2c_probe()
886 return -ENOMEM; in wm8988_i2c_probe()
890 wm8988->regmap = devm_regmap_init_i2c(i2c, &wm8988_regmap); in wm8988_i2c_probe()
891 if (IS_ERR(wm8988->regmap)) { in wm8988_i2c_probe()
892 ret = PTR_ERR(wm8988->regmap); in wm8988_i2c_probe()
893 dev_err(&i2c->dev, "Failed to init regmap: %d\n", ret); in wm8988_i2c_probe()
897 ret = devm_snd_soc_register_component(&i2c->dev, in wm8988_i2c_probe()
930 printk(KERN_ERR "Failed to register WM8988 SPI driver: %d\n", in wm8988_modinit()