• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/sound/soc/codecs/

Lines Matching refs:wm8978

2  * wm8978.c  --  WM8978 ALSA SoC Audio Codec driver
32 #include "wm8978.h"
36 /* wm8978 register cache. Note that register 0 is not included in the cache. */
442 struct wm8978_priv *wm8978 = snd_soc_codec_get_drvdata(codec);
444 unsigned int f_opclk = wm8978->f_opclk, f_mclk = wm8978->f_mclk,
445 f_256fs = wm8978->f_256fs;
454 wm8978->mclk_idx = -1;
479 wm8978->f_pllout = f_opclk * opclk_div;
491 int idx = wm8978_enum_mclk(f_256fs, f_mclk, &wm8978->f_pllout);
495 wm8978->mclk_idx = idx;
503 f2 = wm8978->f_pllout * 4;
506 wm8978->f_mclk, wm8978->f_pllout);
508 pll_factors(&pll_div, f2, wm8978->f_mclk);
538 struct wm8978_priv *wm8978 = snd_soc_codec_get_drvdata(codec);
543 wm8978->f_opclk = div;
545 if (wm8978->f_mclk)
583 struct wm8978_priv *wm8978 = snd_soc_codec_get_drvdata(codec);
589 wm8978->f_mclk = freq;
592 if (wm8978->f_opclk)
598 wm8978->sysclk = clk_id;
601 if (wm8978->sysclk == WM8978_PLL && (!freq || clk_id == WM8978_MCLK)) {
610 wm8978->sysclk = WM8978_MCLK;
611 wm8978->f_pllout = 0;
612 wm8978->f_opclk = 0;
695 struct wm8978_priv *wm8978 = snd_soc_codec_get_drvdata(codec);
706 if (!wm8978->f_mclk)
747 wm8978->f_256fs = params_rate(params) * 256;
749 if (wm8978->sysclk == WM8978_MCLK) {
750 wm8978->mclk_idx = -1;
751 f_sel = wm8978->f_mclk;
753 if (!wm8978->f_pllout) {
759 f_sel = wm8978->f_pllout;
762 if (wm8978->mclk_idx < 0) {
764 if (f_sel < wm8978->f_256fs || f_sel > 12 * wm8978->f_256fs)
768 diff = abs(wm8978->f_256fs * 3 -
781 best = wm8978->mclk_idx;
788 wm8978->sysclk == WM8978_MCLK ?
800 if (wm8978->sysclk != current_clk_id) {
801 if (wm8978->sysclk == WM8978_PLL)
915 struct wm8978_priv *wm8978 = snd_soc_codec_get_drvdata(codec);
929 if (wm8978->f_pllout)
1003 static __devinit int wm8978_register(struct wm8978_priv *wm8978)
1006 struct snd_soc_codec *codec = &wm8978->codec;
1017 wm8978->sysclk = WM8978_PLL;
1023 snd_soc_codec_set_drvdata(codec, wm8978);
1031 codec->reg_cache = &wm8978->reg_cache;
1082 static __devexit void wm8978_unregister(struct wm8978_priv *wm8978)
1084 wm8978_set_bias_level(&wm8978->codec, SND_SOC_BIAS_OFF);
1086 snd_soc_unregister_codec(&wm8978->codec);
1094 struct wm8978_priv *wm8978;
1097 wm8978 = kzalloc(sizeof(struct wm8978_priv), GFP_KERNEL);
1098 if (wm8978 == NULL)
1101 codec = &wm8978->codec;
1104 i2c_set_clientdata(i2c, wm8978);
1109 ret = wm8978_register(wm8978);
1111 kfree(wm8978);
1118 struct wm8978_priv *wm8978 = i2c_get_clientdata(client);
1119 wm8978_unregister(wm8978);
1120 kfree(wm8978);
1125 { "wm8978", 0 },