Lines Matching refs:codec
53 struct snd_soc_codec *codec; member
74 wm8770->codec->cache_sync = 1; \
277 struct snd_soc_codec *codec; in vout12supply_event() local
279 codec = w->codec; in vout12supply_event()
283 snd_soc_update_bits(codec, WM8770_OUTMUX1, 0x180, 0); in vout12supply_event()
286 snd_soc_update_bits(codec, WM8770_OUTMUX1, 0x180, 0x180); in vout12supply_event()
296 struct snd_soc_codec *codec; in vout34supply_event() local
298 codec = w->codec; in vout34supply_event()
302 snd_soc_update_bits(codec, WM8770_OUTMUX2, 0x180, 0); in vout34supply_event()
305 snd_soc_update_bits(codec, WM8770_OUTMUX2, 0x180, 0x180); in vout34supply_event()
312 static int wm8770_reset(struct snd_soc_codec *codec) in wm8770_reset() argument
314 return snd_soc_write(codec, WM8770_RESET, 0); in wm8770_reset()
319 struct snd_soc_codec *codec; in wm8770_set_fmt() local
322 codec = dai->codec; in wm8770_set_fmt()
365 snd_soc_update_bits(codec, WM8770_IFACECTRL, 0xf, iface); in wm8770_set_fmt()
366 snd_soc_update_bits(codec, WM8770_MSTRCTRL, 0x100, master); in wm8770_set_fmt()
384 struct snd_soc_codec *codec; in wm8770_hw_params() local
391 codec = dai->codec; in wm8770_hw_params()
392 wm8770 = snd_soc_codec_get_drvdata(codec); in wm8770_hw_params()
423 if (snd_soc_read(codec, WM8770_MSTRCTRL) & 0x100) { in wm8770_hw_params()
431 dev_err(codec->dev, in wm8770_hw_params()
437 dev_dbg(codec->dev, "MCLK is %dfs\n", mclk_ratios[i]); in wm8770_hw_params()
439 snd_soc_update_bits(codec, WM8770_MSTRCTRL, 0x7 << shift, in wm8770_hw_params()
443 snd_soc_update_bits(codec, WM8770_IFACECTRL, 0x30, iface); in wm8770_hw_params()
450 struct snd_soc_codec *codec; in wm8770_mute() local
452 codec = dai->codec; in wm8770_mute()
453 return snd_soc_update_bits(codec, WM8770_DACMUTE, 0x10, in wm8770_mute()
460 struct snd_soc_codec *codec; in wm8770_set_sysclk() local
463 codec = dai->codec; in wm8770_set_sysclk()
464 wm8770 = snd_soc_codec_get_drvdata(codec); in wm8770_set_sysclk()
469 static void wm8770_sync_cache(struct snd_soc_codec *codec) in wm8770_sync_cache() argument
474 if (!codec->cache_sync) in wm8770_sync_cache()
477 codec->cache_only = 0; in wm8770_sync_cache()
478 cache = codec->reg_cache; in wm8770_sync_cache()
479 for (i = 0; i < codec->driver->reg_cache_size; i++) { in wm8770_sync_cache()
482 snd_soc_write(codec, i, cache[i]); in wm8770_sync_cache()
484 codec->cache_sync = 0; in wm8770_sync_cache()
487 static int wm8770_set_bias_level(struct snd_soc_codec *codec, in wm8770_set_bias_level() argument
493 wm8770 = snd_soc_codec_get_drvdata(codec); in wm8770_set_bias_level()
501 if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { in wm8770_set_bias_level()
505 dev_err(codec->dev, in wm8770_set_bias_level()
510 wm8770_sync_cache(codec); in wm8770_set_bias_level()
512 snd_soc_write(codec, WM8770_PWDNCTRL, 0); in wm8770_set_bias_level()
517 snd_soc_write(codec, WM8770_PWDNCTRL, 1); in wm8770_set_bias_level()
523 codec->dapm.bias_level = level; in wm8770_set_bias_level()
558 static int wm8770_suspend(struct snd_soc_codec *codec, pm_message_t state) in wm8770_suspend() argument
560 wm8770_set_bias_level(codec, SND_SOC_BIAS_OFF); in wm8770_suspend()
564 static int wm8770_resume(struct snd_soc_codec *codec) in wm8770_resume() argument
566 wm8770_set_bias_level(codec, SND_SOC_BIAS_STANDBY); in wm8770_resume()
574 static int wm8770_probe(struct snd_soc_codec *codec) in wm8770_probe() argument
580 wm8770 = snd_soc_codec_get_drvdata(codec); in wm8770_probe()
581 wm8770->codec = codec; in wm8770_probe()
583 codec->dapm.idle_bias_off = 1; in wm8770_probe()
585 ret = snd_soc_codec_set_cache_io(codec, 7, 9, wm8770->control_type); in wm8770_probe()
587 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); in wm8770_probe()
594 ret = regulator_bulk_get(codec->dev, ARRAY_SIZE(wm8770->supplies), in wm8770_probe()
597 dev_err(codec->dev, "Failed to request supplies: %d\n", ret); in wm8770_probe()
610 dev_err(codec->dev, in wm8770_probe()
619 dev_err(codec->dev, "Failed to enable supplies: %d\n", ret); in wm8770_probe()
623 ret = wm8770_reset(codec); in wm8770_probe()
625 dev_err(codec->dev, "Failed to issue reset: %d\n", ret); in wm8770_probe()
629 wm8770_set_bias_level(codec, SND_SOC_BIAS_STANDBY); in wm8770_probe()
632 snd_soc_update_bits(codec, WM8770_MSDIGVOL, 0x100, 0x100); in wm8770_probe()
633 snd_soc_update_bits(codec, WM8770_MSALGVOL, 0x100, 0x100); in wm8770_probe()
634 snd_soc_update_bits(codec, WM8770_VOUT1RVOL, 0x100, 0x100); in wm8770_probe()
635 snd_soc_update_bits(codec, WM8770_VOUT2RVOL, 0x100, 0x100); in wm8770_probe()
636 snd_soc_update_bits(codec, WM8770_VOUT3RVOL, 0x100, 0x100); in wm8770_probe()
637 snd_soc_update_bits(codec, WM8770_VOUT4RVOL, 0x100, 0x100); in wm8770_probe()
638 snd_soc_update_bits(codec, WM8770_DAC1RVOL, 0x100, 0x100); in wm8770_probe()
639 snd_soc_update_bits(codec, WM8770_DAC2RVOL, 0x100, 0x100); in wm8770_probe()
640 snd_soc_update_bits(codec, WM8770_DAC3RVOL, 0x100, 0x100); in wm8770_probe()
641 snd_soc_update_bits(codec, WM8770_DAC4RVOL, 0x100, 0x100); in wm8770_probe()
644 snd_soc_update_bits(codec, WM8770_DACMUTE, 0x10, 0x10); in wm8770_probe()
646 snd_soc_add_controls(codec, wm8770_snd_controls, in wm8770_probe()
648 snd_soc_dapm_new_controls(&codec->dapm, wm8770_dapm_widgets, in wm8770_probe()
650 snd_soc_dapm_add_routes(&codec->dapm, wm8770_intercon, in wm8770_probe()
661 static int wm8770_remove(struct snd_soc_codec *codec) in wm8770_remove() argument
666 wm8770 = snd_soc_codec_get_drvdata(codec); in wm8770_remove()
667 wm8770_set_bias_level(codec, SND_SOC_BIAS_OFF); in wm8770_remove()