Lines Matching +full:spi +full:- +full:mux
2 * wm8988.c -- WM8988 ALSA SoC audio driver
20 #include <linux/spi/spi.h>
105 static const DECLARE_TLV_DB_SCALE(pga_tlv, -1725, 75, 0);
106 static const DECLARE_TLV_DB_SCALE(adc_tlv, -9750, 50, 1);
107 static const DECLARE_TLV_DB_SCALE(dac_tlv, -12750, 50, 1);
108 static const DECLARE_TLV_DB_SCALE(out_tlv, -12100, 100, 1);
109 static const DECLARE_TLV_DB_SCALE(bypass_tlv, -1500, 300, 0);
118 SOC_ENUM("Treble Cut-off", treble),
122 SOC_ENUM("3D Lower Cut-off", stereo_3d_lc),
123 SOC_ENUM("3D Upper Cut-off", stereo_3d_uc),
146 SOC_ENUM("Playback De-emphasis", deemph),
182 struct snd_soc_codec *codec = w->codec; in wm8988_lrc_control()
235 /* Left PGA Mux */
244 /* Right PGA Mux */
253 /* Differential Mux */
260 /* Mono ADC Mux */
271 SND_SOC_DAPM_MUX("Differential Mux", SND_SOC_NOPM, 0, 0,
273 SND_SOC_DAPM_MUX("Left ADC Mux", SND_SOC_NOPM, 0, 0,
275 SND_SOC_DAPM_MUX("Right ADC Mux", SND_SOC_NOPM, 0, 0,
278 SND_SOC_DAPM_MUX("Left PGA Mux", WM8988_PWR1, 5, 0,
280 SND_SOC_DAPM_MUX("Right PGA Mux", WM8988_PWR1, 4, 0,
283 SND_SOC_DAPM_MUX("Left Line Mux", SND_SOC_NOPM, 0, 0,
285 SND_SOC_DAPM_MUX("Right Line Mux", SND_SOC_NOPM, 0, 0,
322 { "Left Line Mux", "Line 1", "LINPUT1" },
323 { "Left Line Mux", "Line 2", "LINPUT2" },
324 { "Left Line Mux", "PGA", "Left PGA Mux" },
325 { "Left Line Mux", "Differential", "Differential Mux" },
327 { "Right Line Mux", "Line 1", "RINPUT1" },
328 { "Right Line Mux", "Line 2", "RINPUT2" },
329 { "Right Line Mux", "PGA", "Right PGA Mux" },
330 { "Right Line Mux", "Differential", "Differential Mux" },
332 { "Left PGA Mux", "Line 1", "LINPUT1" },
333 { "Left PGA Mux", "Line 2", "LINPUT2" },
334 { "Left PGA Mux", "Differential", "Differential Mux" },
336 { "Right PGA Mux", "Line 1", "RINPUT1" },
337 { "Right PGA Mux", "Line 2", "RINPUT2" },
338 { "Right PGA Mux", "Differential", "Differential Mux" },
340 { "Differential Mux", "Line 1", "LINPUT1" },
341 { "Differential Mux", "Line 1", "RINPUT1" },
342 { "Differential Mux", "Line 2", "LINPUT2" },
343 { "Differential Mux", "Line 2", "RINPUT2" },
345 { "Left ADC Mux", "Stereo", "Left PGA Mux" },
346 { "Left ADC Mux", "Mono (Left)", "Left PGA Mux" },
347 { "Left ADC Mux", "Digital Mono", "Left PGA Mux" },
349 { "Right ADC Mux", "Stereo", "Right PGA Mux" },
350 { "Right ADC Mux", "Mono (Right)", "Right PGA Mux" },
351 { "Right ADC Mux", "Digital Mono", "Right PGA Mux" },
353 { "Left ADC", NULL, "Left ADC Mux" },
354 { "Right ADC", NULL, "Right ADC Mux" },
356 { "Left Line Mux", "Line 1", "LINPUT1" },
357 { "Left Line Mux", "Line 2", "LINPUT2" },
358 { "Left Line Mux", "PGA", "Left PGA Mux" },
359 { "Left Line Mux", "Differential", "Differential Mux" },
361 { "Right Line Mux", "Line 1", "RINPUT1" },
362 { "Right Line Mux", "Line 2", "RINPUT2" },
363 { "Right Line Mux", "PGA", "Right PGA Mux" },
364 { "Right Line Mux", "Differential", "Differential Mux" },
367 { "Left Mixer", "Left Bypass Switch", "Left Line Mux" },
369 { "Left Mixer", "Right Bypass Switch", "Right Line Mux" },
372 { "Right Mixer", "Left Bypass Switch", "Left Line Mux" },
374 { "Right Mixer", "Right Bypass Switch", "Right Line Mux" },
454 return -EINVAL; in get_coeff()
493 struct snd_soc_codec *codec = codec_dai->codec; in wm8988_set_dai_sysclk()
501 wm8988->sysclk_constraints = &constraints_112896; in wm8988_set_dai_sysclk()
502 wm8988->sysclk = freq; in wm8988_set_dai_sysclk()
509 wm8988->sysclk_constraints = &constraints_12288; in wm8988_set_dai_sysclk()
510 wm8988->sysclk = freq; in wm8988_set_dai_sysclk()
515 wm8988->sysclk_constraints = &constraints_12; in wm8988_set_dai_sysclk()
516 wm8988->sysclk = freq; in wm8988_set_dai_sysclk()
519 return -EINVAL; in wm8988_set_dai_sysclk()
525 struct snd_soc_codec *codec = codec_dai->codec; in wm8988_set_dai_fmt()
536 return -EINVAL; in wm8988_set_dai_fmt()
556 return -EINVAL; in wm8988_set_dai_fmt()
573 return -EINVAL; in wm8988_set_dai_fmt()
583 struct snd_soc_codec *codec = dai->codec; in wm8988_pcm_startup()
587 * MCLK supplied to the CODEC - enforce this. in wm8988_pcm_startup()
589 if (!wm8988->sysclk) { in wm8988_pcm_startup()
590 dev_err(codec->dev, in wm8988_pcm_startup()
592 return -EINVAL; in wm8988_pcm_startup()
595 snd_pcm_hw_constraint_list(substream->runtime, 0, in wm8988_pcm_startup()
597 wm8988->sysclk_constraints); in wm8988_pcm_startup()
606 struct snd_soc_pcm_runtime *rtd = substream->private_data; in wm8988_pcm_hw_params()
607 struct snd_soc_codec *codec = rtd->codec; in wm8988_pcm_hw_params()
613 coeff = get_coeff(wm8988->sysclk, params_rate(params)); in wm8988_pcm_hw_params()
615 coeff = get_coeff(wm8988->sysclk / 2, params_rate(params)); in wm8988_pcm_hw_params()
619 dev_err(codec->dev, in wm8988_pcm_hw_params()
621 params_rate(params), wm8988->sysclk); in wm8988_pcm_hw_params()
651 struct snd_soc_codec *codec = dai->codec; in wm8988_mute()
676 if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { in wm8988_set_bias_level()
694 codec->dapm.bias_level = level; in wm8988_set_bias_level()
712 .name = "wm8988-hifi",
746 struct snd_soc_dapm_context *dapm = &codec->dapm; in wm8988_probe()
749 ret = snd_soc_codec_set_cache_io(codec, 7, 9, wm8988->control_type); in wm8988_probe()
751 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); in wm8988_probe()
757 dev_err(codec->dev, "Failed to issue reset\n"); in wm8988_probe()
797 static int __devinit wm8988_spi_probe(struct spi_device *spi) in wm8988_spi_probe() argument
804 return -ENOMEM; in wm8988_spi_probe()
806 wm8988->control_type = SND_SOC_SPI; in wm8988_spi_probe()
807 spi_set_drvdata(spi, wm8988); in wm8988_spi_probe()
809 ret = snd_soc_register_codec(&spi->dev, in wm8988_spi_probe()
816 static int __devexit wm8988_spi_remove(struct spi_device *spi) in wm8988_spi_remove() argument
818 snd_soc_unregister_codec(&spi->dev); in wm8988_spi_remove()
819 kfree(spi_get_drvdata(spi)); in wm8988_spi_remove()
842 return -ENOMEM; in wm8988_i2c_probe()
845 wm8988->control_type = SND_SOC_I2C; in wm8988_i2c_probe()
847 ret = snd_soc_register_codec(&i2c->dev, in wm8988_i2c_probe()
856 snd_soc_unregister_codec(&client->dev); in wm8988_i2c_remove()
869 .name = "wm8988-codec",
891 printk(KERN_ERR "Failed to register WM8988 SPI driver: %d\n", in wm8988_modinit()