Lines Matching refs:component
52 static int wm8960_set_pll(struct snd_soc_component *component,
184 static int wm8960_set_deemph(struct snd_soc_component *component) in wm8960_set_deemph() argument
186 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_set_deemph()
205 dev_dbg(component->dev, "Set deemphasis %d\n", val); in wm8960_set_deemph()
207 return snd_soc_component_update_bits(component, WM8960_DACCTL1, in wm8960_set_deemph()
214 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8960_get_deemph() local
215 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_get_deemph()
224 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8960_put_deemph() local
225 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_put_deemph()
233 return wm8960_set_deemph(component); in wm8960_put_deemph()
487 static int wm8960_add_widgets(struct snd_soc_component *component) in wm8960_add_widgets() argument
489 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_add_widgets()
491 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8960_add_widgets()
521 list_for_each_entry(w, &component->card->widgets, list) { in wm8960_add_widgets()
538 struct snd_soc_component *component = codec_dai->component; in wm8960_set_dai_fmt() local
590 snd_soc_component_write(component, WM8960_IFACE1, iface); in wm8960_set_dai_fmt()
702 int wm8960_configure_pll(struct snd_soc_component *component, int freq_in, in wm8960_configure_pll() argument
705 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_configure_pll()
754 static int wm8960_configure_clocking(struct snd_soc_component *component) in wm8960_configure_clocking() argument
756 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_configure_clocking()
758 u16 iface1 = snd_soc_component_read(component, WM8960_IFACE1); in wm8960_configure_clocking()
770 dev_warn(component->dev, in wm8960_configure_clocking()
776 dev_err(component->dev, "No MCLK configured\n"); in wm8960_configure_clocking()
789 wm8960_set_pll(component, 0, 0); in wm8960_configure_clocking()
794 dev_err(component->dev, "No SYSCLK configured\n"); in wm8960_configure_clocking()
803 dev_err(component->dev, "failed to configure clock\n"); in wm8960_configure_clocking()
808 freq_out = wm8960_configure_pll(component, freq_in, &i, &j, &k); in wm8960_configure_clocking()
810 dev_err(component->dev, "failed to configure clock via PLL\n"); in wm8960_configure_clocking()
813 wm8960_set_pll(component, freq_in, freq_out); in wm8960_configure_clocking()
817 snd_soc_component_update_bits(component, WM8960_CLOCK1, 3 << 1, i << 1); in wm8960_configure_clocking()
820 snd_soc_component_update_bits(component, WM8960_CLOCK1, 0x7 << 3, j << 3); in wm8960_configure_clocking()
821 snd_soc_component_update_bits(component, WM8960_CLOCK1, 0x7 << 6, j << 6); in wm8960_configure_clocking()
824 snd_soc_component_update_bits(component, WM8960_CLOCK2, 0xf, k); in wm8960_configure_clocking()
833 struct snd_soc_component *component = dai->component; in wm8960_hw_params() local
834 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_hw_params()
835 u16 iface = snd_soc_component_read(component, WM8960_IFACE1) & 0xfff3; in wm8960_hw_params()
861 dev_err(component->dev, "unsupported width %d\n", in wm8960_hw_params()
869 wm8960_set_deemph(component); in wm8960_hw_params()
873 snd_soc_component_update_bits(component, in wm8960_hw_params()
879 snd_soc_component_write(component, WM8960_IFACE1, iface); in wm8960_hw_params()
884 return wm8960_configure_clocking(component); in wm8960_hw_params()
892 struct snd_soc_component *component = dai->component; in wm8960_hw_free() local
893 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_hw_free()
903 struct snd_soc_component *component = dai->component; in wm8960_mute() local
906 snd_soc_component_update_bits(component, WM8960_DACCTL1, 0x8, 0x8); in wm8960_mute()
908 snd_soc_component_update_bits(component, WM8960_DACCTL1, 0x8, 0); in wm8960_mute()
912 static int wm8960_set_bias_level_out3(struct snd_soc_component *component, in wm8960_set_bias_level_out3() argument
915 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_set_bias_level_out3()
916 u16 pm2 = snd_soc_component_read(component, WM8960_POWER2); in wm8960_set_bias_level_out3()
925 switch (snd_soc_component_get_bias_level(component)) { in wm8960_set_bias_level_out3()
930 dev_err(component->dev, in wm8960_set_bias_level_out3()
937 ret = wm8960_configure_clocking(component); in wm8960_set_bias_level_out3()
942 snd_soc_component_update_bits(component, WM8960_POWER1, 0x180, 0x80); in wm8960_set_bias_level_out3()
951 wm8960_set_pll(component, 0, 0); in wm8960_set_bias_level_out3()
964 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { in wm8960_set_bias_level_out3()
973 snd_soc_component_write(component, WM8960_APOP1, in wm8960_set_bias_level_out3()
978 snd_soc_component_update_bits(component, WM8960_POWER1, 0x80, 0x80); in wm8960_set_bias_level_out3()
982 snd_soc_component_update_bits(component, WM8960_POWER1, WM8960_VREF, in wm8960_set_bias_level_out3()
986 snd_soc_component_write(component, WM8960_APOP1, WM8960_BUFIOEN); in wm8960_set_bias_level_out3()
990 snd_soc_component_update_bits(component, WM8960_POWER1, 0x180, 0x100); in wm8960_set_bias_level_out3()
995 snd_soc_component_write(component, WM8960_APOP1, in wm8960_set_bias_level_out3()
1000 snd_soc_component_write(component, WM8960_POWER1, 0); in wm8960_set_bias_level_out3()
1008 static int wm8960_set_bias_level_capless(struct snd_soc_component *component, in wm8960_set_bias_level_capless() argument
1011 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_set_bias_level_capless()
1012 u16 pm2 = snd_soc_component_read(component, WM8960_POWER2); in wm8960_set_bias_level_capless()
1020 switch (snd_soc_component_get_bias_level(component)) { in wm8960_set_bias_level_capless()
1023 snd_soc_component_update_bits(component, WM8960_APOP1, in wm8960_set_bias_level_capless()
1037 snd_soc_component_update_bits(component, WM8960_POWER2, in wm8960_set_bias_level_capless()
1043 snd_soc_component_update_bits(component, WM8960_POWER1, in wm8960_set_bias_level_capless()
1050 snd_soc_component_update_bits(component, WM8960_POWER1, in wm8960_set_bias_level_capless()
1058 dev_err(component->dev, in wm8960_set_bias_level_capless()
1065 ret = wm8960_configure_clocking(component); in wm8960_set_bias_level_capless()
1077 wm8960_set_pll(component, 0, 0); in wm8960_set_bias_level_capless()
1083 snd_soc_component_update_bits(component, WM8960_APOP1, in wm8960_set_bias_level_capless()
1090 snd_soc_component_update_bits(component, WM8960_POWER1, in wm8960_set_bias_level_capless()
1103 switch (snd_soc_component_get_bias_level(component)) { in wm8960_set_bias_level_capless()
1106 snd_soc_component_update_bits(component, WM8960_APOP2, in wm8960_set_bias_level_capless()
1111 snd_soc_component_update_bits(component, WM8960_APOP1, in wm8960_set_bias_level_capless()
1210 static int wm8960_set_pll(struct snd_soc_component *component, in wm8960_set_pll() argument
1225 snd_soc_component_update_bits(component, WM8960_CLOCK1, 0x1, 0); in wm8960_set_pll()
1226 snd_soc_component_update_bits(component, WM8960_POWER2, 0x1, 0); in wm8960_set_pll()
1231 reg = snd_soc_component_read(component, WM8960_PLL1) & ~0x3f; in wm8960_set_pll()
1238 snd_soc_component_write(component, WM8960_PLL2, (pll_div.k >> 16) & 0xff); in wm8960_set_pll()
1239 snd_soc_component_write(component, WM8960_PLL3, (pll_div.k >> 8) & 0xff); in wm8960_set_pll()
1240 snd_soc_component_write(component, WM8960_PLL4, pll_div.k & 0xff); in wm8960_set_pll()
1242 snd_soc_component_write(component, WM8960_PLL1, reg); in wm8960_set_pll()
1245 snd_soc_component_update_bits(component, WM8960_POWER2, 0x1, 0x1); in wm8960_set_pll()
1247 snd_soc_component_update_bits(component, WM8960_CLOCK1, 0x1, 0x1); in wm8960_set_pll()
1255 struct snd_soc_component *component = codec_dai->component; in wm8960_set_dai_pll() local
1256 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_set_dai_pll()
1263 return wm8960_set_pll(component, freq_in, freq_out); in wm8960_set_dai_pll()
1269 struct snd_soc_component *component = codec_dai->component; in wm8960_set_dai_clkdiv() local
1274 reg = snd_soc_component_read(component, WM8960_CLOCK1) & 0x1f9; in wm8960_set_dai_clkdiv()
1275 snd_soc_component_write(component, WM8960_CLOCK1, reg | div); in wm8960_set_dai_clkdiv()
1278 reg = snd_soc_component_read(component, WM8960_CLOCK1) & 0x1c7; in wm8960_set_dai_clkdiv()
1279 snd_soc_component_write(component, WM8960_CLOCK1, reg | div); in wm8960_set_dai_clkdiv()
1282 reg = snd_soc_component_read(component, WM8960_PLL1) & 0x03f; in wm8960_set_dai_clkdiv()
1283 snd_soc_component_write(component, WM8960_PLL1, reg | div); in wm8960_set_dai_clkdiv()
1286 reg = snd_soc_component_read(component, WM8960_CLOCK2) & 0x03f; in wm8960_set_dai_clkdiv()
1287 snd_soc_component_write(component, WM8960_CLOCK2, reg | div); in wm8960_set_dai_clkdiv()
1290 reg = snd_soc_component_read(component, WM8960_ADDCTL1) & 0x1fd; in wm8960_set_dai_clkdiv()
1291 snd_soc_component_write(component, WM8960_ADDCTL1, reg | div); in wm8960_set_dai_clkdiv()
1300 static int wm8960_set_bias_level(struct snd_soc_component *component, in wm8960_set_bias_level() argument
1303 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_set_bias_level()
1305 return wm8960->set_bias_level(component, level); in wm8960_set_bias_level()
1311 struct snd_soc_component *component = dai->component; in wm8960_set_dai_sysclk() local
1312 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_set_dai_sysclk()
1316 snd_soc_component_update_bits(component, WM8960_CLOCK1, in wm8960_set_dai_sysclk()
1320 snd_soc_component_update_bits(component, WM8960_CLOCK1, in wm8960_set_dai_sysclk()
1370 static int wm8960_probe(struct snd_soc_component *component) in wm8960_probe() argument
1372 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_probe()
1380 snd_soc_add_component_controls(component, wm8960_snd_controls, in wm8960_probe()
1382 wm8960_add_widgets(component); in wm8960_probe()