wm9081 548 sound/soc/codecs/wm9081.c struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); wm9081 555 sound/soc/codecs/wm9081.c if (Fref == wm9081->fll_fref && Fout == wm9081->fll_fout) wm9081 561 sound/soc/codecs/wm9081.c wm9081->fll_fref = 0; wm9081 562 sound/soc/codecs/wm9081.c wm9081->fll_fout = 0; wm9081 630 sound/soc/codecs/wm9081.c wm9081->fll_fref = Fref; wm9081 631 sound/soc/codecs/wm9081.c wm9081->fll_fout = Fout; wm9081 638 sound/soc/codecs/wm9081.c struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); wm9081 645 sound/soc/codecs/wm9081.c switch (wm9081->sysclk_source) { wm9081 647 sound/soc/codecs/wm9081.c if (wm9081->mclk_rate > 12225000) { wm9081 649 sound/soc/codecs/wm9081.c wm9081->sysclk_rate = wm9081->mclk_rate / 2; wm9081 651 sound/soc/codecs/wm9081.c wm9081->sysclk_rate = wm9081->mclk_rate; wm9081 664 sound/soc/codecs/wm9081.c if (wm9081->master && wm9081->bclk) { wm9081 669 sound/soc/codecs/wm9081.c target = wm9081->fs * clk_sys_rates[i].ratio; wm9081 671 sound/soc/codecs/wm9081.c if (target >= wm9081->bclk && wm9081 679 sound/soc/codecs/wm9081.c } else if (wm9081->fs) { wm9081 682 sound/soc/codecs/wm9081.c * wm9081->fs; wm9081 695 sound/soc/codecs/wm9081.c wm9081->mclk_rate, new_sysclk); wm9081 697 sound/soc/codecs/wm9081.c wm9081->sysclk_rate = new_sysclk; wm9081 702 sound/soc/codecs/wm9081.c wm9081->sysclk_rate = wm9081->mclk_rate; wm9081 724 sound/soc/codecs/wm9081.c dev_dbg(component->dev, "CLK_SYS is %dHz\n", wm9081->sysclk_rate); wm9081 733 sound/soc/codecs/wm9081.c struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); wm9081 736 sound/soc/codecs/wm9081.c switch (wm9081->sysclk_source) { wm9081 738 sound/soc/codecs/wm9081.c dev_dbg(component->dev, "Using %dHz MCLK\n", wm9081->mclk_rate); wm9081 742 sound/soc/codecs/wm9081.c wm9081->mclk_rate); wm9081 818 sound/soc/codecs/wm9081.c struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); wm9081 837 sound/soc/codecs/wm9081.c regcache_cache_only(wm9081->regmap, false); wm9081 838 sound/soc/codecs/wm9081.c regcache_sync(wm9081->regmap); wm9081 892 sound/soc/codecs/wm9081.c regcache_cache_only(wm9081->regmap, true); wm9081 903 sound/soc/codecs/wm9081.c struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); wm9081 911 sound/soc/codecs/wm9081.c wm9081->master = 0; wm9081 915 sound/soc/codecs/wm9081.c wm9081->master = 1; wm9081 919 sound/soc/codecs/wm9081.c wm9081->master = 1; wm9081 923 sound/soc/codecs/wm9081.c wm9081->master = 1; wm9081 996 sound/soc/codecs/wm9081.c struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); wm9081 1014 sound/soc/codecs/wm9081.c wm9081->fs = params_rate(params); wm9081 1016 sound/soc/codecs/wm9081.c if (wm9081->tdm_width) { wm9081 1021 sound/soc/codecs/wm9081.c wm9081->bclk = wm9081->fs * wm9081->tdm_width * slots; wm9081 1024 sound/soc/codecs/wm9081.c wm9081->bclk = 2 * wm9081->fs; wm9081 1028 sound/soc/codecs/wm9081.c wm9081->bclk *= 16; wm9081 1031 sound/soc/codecs/wm9081.c wm9081->bclk *= 20; wm9081 1035 sound/soc/codecs/wm9081.c wm9081->bclk *= 24; wm9081 1039 sound/soc/codecs/wm9081.c wm9081->bclk *= 32; wm9081 1047 sound/soc/codecs/wm9081.c dev_dbg(component->dev, "Target BCLK is %dHz\n", wm9081->bclk); wm9081 1055 sound/soc/codecs/wm9081.c best_val = abs((wm9081->sysclk_rate / clk_sys_rates[0].ratio) wm9081 1056 sound/soc/codecs/wm9081.c - wm9081->fs); wm9081 1058 sound/soc/codecs/wm9081.c cur_val = abs((wm9081->sysclk_rate / wm9081 1059 sound/soc/codecs/wm9081.c clk_sys_rates[i].ratio) - wm9081->fs); wm9081 1072 sound/soc/codecs/wm9081.c best_val = abs(wm9081->fs - sample_rates[0].rate); wm9081 1075 sound/soc/codecs/wm9081.c cur_val = abs(wm9081->fs - sample_rates[i].rate); wm9081 1090 sound/soc/codecs/wm9081.c cur_val = ((wm9081->sysclk_rate * 10) / bclk_divs[i].div) wm9081 1091 sound/soc/codecs/wm9081.c - wm9081->bclk; wm9081 1099 sound/soc/codecs/wm9081.c wm9081->bclk = (wm9081->sysclk_rate * 10) / bclk_divs[best].div; wm9081 1101 sound/soc/codecs/wm9081.c bclk_divs[best].div, wm9081->bclk); wm9081 1105 sound/soc/codecs/wm9081.c dev_dbg(component->dev, "LRCLK_RATE is %d\n", wm9081->bclk / wm9081->fs); wm9081 1106 sound/soc/codecs/wm9081.c aif4 |= wm9081->bclk / wm9081->fs; wm9081 1109 sound/soc/codecs/wm9081.c if (wm9081->pdata.num_retune_configs) { wm9081 1110 sound/soc/codecs/wm9081.c struct wm9081_pdata *pdata = &wm9081->pdata; wm9081 1115 sound/soc/codecs/wm9081.c best_val = abs(pdata->retune_configs[0].rate - wm9081->fs); wm9081 1118 sound/soc/codecs/wm9081.c wm9081->fs); wm9081 1170 sound/soc/codecs/wm9081.c struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); wm9081 1175 sound/soc/codecs/wm9081.c wm9081->sysclk_source = clk_id; wm9081 1176 sound/soc/codecs/wm9081.c wm9081->mclk_rate = freq; wm9081 1190 sound/soc/codecs/wm9081.c struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); wm9081 1198 sound/soc/codecs/wm9081.c wm9081->tdm_width = slot_width; wm9081 1256 sound/soc/codecs/wm9081.c struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); wm9081 1264 sound/soc/codecs/wm9081.c if (!wm9081->pdata.num_retune_configs) { wm9081 1304 sound/soc/codecs/wm9081.c struct wm9081_priv *wm9081; wm9081 1308 sound/soc/codecs/wm9081.c wm9081 = devm_kzalloc(&i2c->dev, sizeof(struct wm9081_priv), wm9081 1310 sound/soc/codecs/wm9081.c if (wm9081 == NULL) wm9081 1313 sound/soc/codecs/wm9081.c i2c_set_clientdata(i2c, wm9081); wm9081 1315 sound/soc/codecs/wm9081.c wm9081->regmap = devm_regmap_init_i2c(i2c, &wm9081_regmap); wm9081 1316 sound/soc/codecs/wm9081.c if (IS_ERR(wm9081->regmap)) { wm9081 1317 sound/soc/codecs/wm9081.c ret = PTR_ERR(wm9081->regmap); wm9081 1322 sound/soc/codecs/wm9081.c ret = regmap_read(wm9081->regmap, WM9081_SOFTWARE_RESET, ®); wm9081 1332 sound/soc/codecs/wm9081.c ret = wm9081_reset(wm9081->regmap); wm9081 1339 sound/soc/codecs/wm9081.c memcpy(&wm9081->pdata, dev_get_platdata(&i2c->dev), wm9081 1340 sound/soc/codecs/wm9081.c sizeof(wm9081->pdata)); wm9081 1343 sound/soc/codecs/wm9081.c if (wm9081->pdata.irq_high) wm9081 1345 sound/soc/codecs/wm9081.c if (!wm9081->pdata.irq_cmos) wm9081 1347 sound/soc/codecs/wm9081.c regmap_update_bits(wm9081->regmap, WM9081_INTERRUPT_CONTROL, wm9081 1350 sound/soc/codecs/wm9081.c regcache_cache_only(wm9081->regmap, true);