• 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 defs:wm8993

2  * wm8993.c -- WM8993 ALSA SoC audio driver
29 #include <sound/wm8993.h>
31 #include "wm8993.h"
374 struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec);
380 if (Fref == wm8993->fll_fref && Fout == wm8993->fll_fout)
386 wm8993->fll_fref = 0;
387 wm8993->fll_fout = 0;
452 wm8993->fll_fref = Fref;
453 wm8993->fll_fout = Fout;
454 wm8993->fll_src = source;
461 struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec);
465 switch (wm8993->sysclk_source) {
467 dev_dbg(codec->dev, "Using %dHz MCLK\n", wm8993->mclk_rate);
471 if (wm8993->mclk_rate > 13500000) {
473 wm8993->sysclk_rate = wm8993->mclk_rate / 2;
476 wm8993->sysclk_rate = wm8993->mclk_rate;
483 wm8993->fll_fout);
487 if (wm8993->fll_fout > 13500000) {
489 wm8993->sysclk_rate = wm8993->fll_fout / 2;
492 wm8993->sysclk_rate = wm8993->fll_fout;
502 dev_dbg(codec->dev, "CLK_SYS is %dHz\n", wm8993->sysclk_rate);
720 struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec);
725 if (wm8993->class_w_users == 0) {
732 wm8993->class_w_users++;
740 if (wm8993->class_w_users == 1) {
748 wm8993->class_w_users--;
752 wm8993->class_w_users);
952 struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec);
967 ret = regulator_bulk_enable(ARRAY_SIZE(wm8993->supplies),
968 wm8993->supplies);
992 if (!wm8993->pdata.lineout1_diff ||
993 !wm8993->pdata.lineout2_diff)
1036 regulator_bulk_disable(ARRAY_SIZE(wm8993->supplies),
1037 wm8993->supplies);
1050 struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec);
1054 wm8993->mclk_rate = freq;
1056 wm8993->sysclk_source = clk_id;
1070 struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec);
1080 wm8993->master = 0;
1084 wm8993->master = 1;
1088 wm8993->master = 1;
1093 wm8993->master = 1;
1166 struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec);
1183 wm8993->fs = params_rate(params);
1184 wm8993->bclk = 2 * wm8993->fs;
1185 if (wm8993->tdm_slots) {
1187 wm8993->tdm_slots, wm8993->tdm_width);
1188 wm8993->bclk *= wm8993->tdm_width * wm8993->tdm_slots;
1192 wm8993->bclk *= 16;
1195 wm8993->bclk *= 20;
1199 wm8993->bclk *= 24;
1203 wm8993->bclk *= 32;
1211 dev_dbg(codec->dev, "Target BCLK is %dHz\n", wm8993->bclk);
1219 best_val = abs((wm8993->sysclk_rate / clk_sys_rates[0].ratio)
1220 - wm8993->fs);
1222 cur_val = abs((wm8993->sysclk_rate /
1223 clk_sys_rates[i].ratio) - wm8993->fs);;
1236 best_val = abs(wm8993->fs - sample_rates[0].rate);
1239 cur_val = abs(wm8993->fs - sample_rates[i].rate);
1254 cur_val = ((wm8993->sysclk_rate * 10) / bclk_divs[i].div)
1255 - wm8993->bclk;
1263 wm8993->bclk = (wm8993->sysclk_rate * 10) / bclk_divs[best].div;
1265 bclk_divs[best].div, wm8993->bclk);
1269 dev_dbg(codec->dev, "LRCLK_RATE is %d\n", wm8993->bclk / wm8993->fs);
1270 aif4 |= wm8993->bclk / wm8993->fs;
1278 if (wm8993->pdata.num_retune_configs) {
1283 best_val = abs(wm8993->pdata.retune_configs[0].rate
1284 - wm8993->fs);
1285 for (i = 0; i < wm8993->pdata.num_retune_configs; i++) {
1286 cur_val = abs(wm8993->pdata.retune_configs[i].rate
1287 - wm8993->fs);
1293 s = &wm8993->pdata.retune_configs[best];
1331 struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec);
1337 wm8993->tdm_slots = 0;
1370 wm8993->tdm_width = slot_width;
1371 wm8993->tdm_slots = slots / 2;
1424 struct wm8993_priv *wm8993;
1434 wm8993 = snd_soc_codec_get_drvdata(codec);
1444 if (wm8993->pdata.num_retune_configs != 0) {
1457 wm_hubs_add_analogue_routes(codec, wm8993->pdata.lineout1_diff,
1458 wm8993->pdata.lineout2_diff);
1481 struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec);
1482 int fll_fout = wm8993->fll_fout;
1483 int fll_fref = wm8993->fll_fref;
1493 wm8993->fll_fout = fll_fout;
1494 wm8993->fll_fref = fll_fref;
1505 struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec);
1511 if (wm8993->fll_fout) {
1512 int fll_fout = wm8993->fll_fout;
1513 int fll_fref = wm8993->fll_fref;
1515 wm8993->fll_fref = 0;
1516 wm8993->fll_fout = 0;
1518 ret = wm8993_set_fll(codec->dai, 0, wm8993->fll_src,
1542 struct wm8993_priv *wm8993;
1553 wm8993 = kzalloc(sizeof(struct wm8993_priv), GFP_KERNEL);
1554 if (wm8993 == NULL)
1557 codec = &wm8993->codec;
1559 memcpy(&wm8993->pdata, i2c->dev.platform_data,
1560 sizeof(wm8993->pdata));
1568 codec->reg_cache = wm8993->reg_cache;
1569 codec->reg_cache_size = ARRAY_SIZE(wm8993->reg_cache);
1574 snd_soc_codec_set_drvdata(codec, wm8993);
1576 wm8993->hubs_data.hp_startup_mode = 1;
1577 wm8993->hubs_data.dcs_codes = -2;
1579 memcpy(wm8993->reg_cache, wm8993_reg_defaults,
1580 sizeof(wm8993->reg_cache));
1588 i2c_set_clientdata(i2c, wm8993);
1594 for (i = 0; i < ARRAY_SIZE(wm8993->supplies); i++)
1595 wm8993->supplies[i].supply = wm8993_supply_names[i];
1597 ret = regulator_bulk_get(codec->dev, ARRAY_SIZE(wm8993->supplies),
1598 wm8993->supplies);
1604 ret = regulator_bulk_enable(ARRAY_SIZE(wm8993->supplies),
1605 wm8993->supplies);
1625 wm8993->class_w_users = 2;
1641 wm_hubs_handle_analogue_pdata(codec, wm8993->pdata.lineout1_diff,
1642 wm8993->pdata.lineout2_diff,
1643 wm8993->pdata.lineout1fb,
1644 wm8993->pdata.lineout2fb,
1645 wm8993->pdata.jd_scthr,
1646 wm8993->pdata.jd_thr,
1647 wm8993->pdata.micbias1_lvl,
1648 wm8993->pdata.micbias2_lvl);
1667 regulator_bulk_disable(ARRAY_SIZE(wm8993->supplies), wm8993->supplies);
1669 regulator_bulk_free(ARRAY_SIZE(wm8993->supplies), wm8993->supplies);
1672 kfree(wm8993);
1678 struct wm8993_priv *wm8993 = i2c_get_clientdata(client);
1680 snd_soc_unregister_codec(&wm8993->codec);
1683 wm8993_set_bias_level(&wm8993->codec, SND_SOC_BIAS_OFF);
1684 regulator_bulk_free(ARRAY_SIZE(wm8993->supplies), wm8993->supplies);
1685 kfree(wm8993);
1691 { "wm8993", 0 },