Lines Matching refs:wm9081

548 	struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component);  in wm9081_set_fll()  local
555 if (Fref == wm9081->fll_fref && Fout == wm9081->fll_fout) in wm9081_set_fll()
561 wm9081->fll_fref = 0; in wm9081_set_fll()
562 wm9081->fll_fout = 0; in wm9081_set_fll()
630 wm9081->fll_fref = Fref; in wm9081_set_fll()
631 wm9081->fll_fout = Fout; in wm9081_set_fll()
638 struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); in configure_clock() local
645 switch (wm9081->sysclk_source) { in configure_clock()
647 if (wm9081->mclk_rate > 12225000) { in configure_clock()
649 wm9081->sysclk_rate = wm9081->mclk_rate / 2; in configure_clock()
651 wm9081->sysclk_rate = wm9081->mclk_rate; in configure_clock()
664 if (wm9081->master && wm9081->bclk) { in configure_clock()
669 target = wm9081->fs * clk_sys_rates[i].ratio; in configure_clock()
671 if (target >= wm9081->bclk && in configure_clock()
679 } else if (wm9081->fs) { in configure_clock()
682 * wm9081->fs; in configure_clock()
695 wm9081->mclk_rate, new_sysclk); in configure_clock()
697 wm9081->sysclk_rate = new_sysclk; in configure_clock()
702 wm9081->sysclk_rate = wm9081->mclk_rate; in configure_clock()
724 dev_dbg(component->dev, "CLK_SYS is %dHz\n", wm9081->sysclk_rate); in configure_clock()
733 struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); in clk_sys_event() local
736 switch (wm9081->sysclk_source) { in clk_sys_event()
738 dev_dbg(component->dev, "Using %dHz MCLK\n", wm9081->mclk_rate); in clk_sys_event()
742 wm9081->mclk_rate); in clk_sys_event()
818 struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); in wm9081_set_bias_level() local
837 regcache_cache_only(wm9081->regmap, false); in wm9081_set_bias_level()
838 regcache_sync(wm9081->regmap); in wm9081_set_bias_level()
892 regcache_cache_only(wm9081->regmap, true); in wm9081_set_bias_level()
903 struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); in wm9081_set_dai_fmt() local
911 wm9081->master = 0; in wm9081_set_dai_fmt()
915 wm9081->master = 1; in wm9081_set_dai_fmt()
919 wm9081->master = 1; in wm9081_set_dai_fmt()
923 wm9081->master = 1; in wm9081_set_dai_fmt()
996 struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); in wm9081_hw_params() local
1014 wm9081->fs = params_rate(params); in wm9081_hw_params()
1016 if (wm9081->tdm_width) { in wm9081_hw_params()
1021 wm9081->bclk = wm9081->fs * wm9081->tdm_width * slots; in wm9081_hw_params()
1024 wm9081->bclk = 2 * wm9081->fs; in wm9081_hw_params()
1028 wm9081->bclk *= 16; in wm9081_hw_params()
1031 wm9081->bclk *= 20; in wm9081_hw_params()
1035 wm9081->bclk *= 24; in wm9081_hw_params()
1039 wm9081->bclk *= 32; in wm9081_hw_params()
1047 dev_dbg(component->dev, "Target BCLK is %dHz\n", wm9081->bclk); in wm9081_hw_params()
1055 best_val = abs((wm9081->sysclk_rate / clk_sys_rates[0].ratio) in wm9081_hw_params()
1056 - wm9081->fs); in wm9081_hw_params()
1058 cur_val = abs((wm9081->sysclk_rate / in wm9081_hw_params()
1059 clk_sys_rates[i].ratio) - wm9081->fs); in wm9081_hw_params()
1072 best_val = abs(wm9081->fs - sample_rates[0].rate); in wm9081_hw_params()
1075 cur_val = abs(wm9081->fs - sample_rates[i].rate); in wm9081_hw_params()
1090 cur_val = ((wm9081->sysclk_rate * 10) / bclk_divs[i].div) in wm9081_hw_params()
1091 - wm9081->bclk; in wm9081_hw_params()
1099 wm9081->bclk = (wm9081->sysclk_rate * 10) / bclk_divs[best].div; in wm9081_hw_params()
1101 bclk_divs[best].div, wm9081->bclk); in wm9081_hw_params()
1105 dev_dbg(component->dev, "LRCLK_RATE is %d\n", wm9081->bclk / wm9081->fs); in wm9081_hw_params()
1106 aif4 |= wm9081->bclk / wm9081->fs; in wm9081_hw_params()
1109 if (wm9081->pdata.num_retune_configs) { in wm9081_hw_params()
1110 struct wm9081_pdata *pdata = &wm9081->pdata; in wm9081_hw_params()
1115 best_val = abs(pdata->retune_configs[0].rate - wm9081->fs); in wm9081_hw_params()
1118 wm9081->fs); in wm9081_hw_params()
1170 struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); in wm9081_set_sysclk() local
1175 wm9081->sysclk_source = clk_id; in wm9081_set_sysclk()
1176 wm9081->mclk_rate = freq; in wm9081_set_sysclk()
1190 struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); in wm9081_set_tdm_slot() local
1198 wm9081->tdm_width = slot_width; in wm9081_set_tdm_slot()
1257 struct wm9081_priv *wm9081 = snd_soc_component_get_drvdata(component); in wm9081_probe() local
1265 if (!wm9081->pdata.num_retune_configs) { in wm9081_probe()
1303 struct wm9081_priv *wm9081; in wm9081_i2c_probe() local
1307 wm9081 = devm_kzalloc(&i2c->dev, sizeof(struct wm9081_priv), in wm9081_i2c_probe()
1309 if (wm9081 == NULL) in wm9081_i2c_probe()
1312 i2c_set_clientdata(i2c, wm9081); in wm9081_i2c_probe()
1314 wm9081->regmap = devm_regmap_init_i2c(i2c, &wm9081_regmap); in wm9081_i2c_probe()
1315 if (IS_ERR(wm9081->regmap)) { in wm9081_i2c_probe()
1316 ret = PTR_ERR(wm9081->regmap); in wm9081_i2c_probe()
1321 ret = regmap_read(wm9081->regmap, WM9081_SOFTWARE_RESET, &reg); in wm9081_i2c_probe()
1331 ret = wm9081_reset(wm9081->regmap); in wm9081_i2c_probe()
1338 memcpy(&wm9081->pdata, dev_get_platdata(&i2c->dev), in wm9081_i2c_probe()
1339 sizeof(wm9081->pdata)); in wm9081_i2c_probe()
1342 if (wm9081->pdata.irq_high) in wm9081_i2c_probe()
1344 if (!wm9081->pdata.irq_cmos) in wm9081_i2c_probe()
1346 regmap_update_bits(wm9081->regmap, WM9081_INTERRUPT_CONTROL, in wm9081_i2c_probe()
1349 regcache_cache_only(wm9081->regmap, true); in wm9081_i2c_probe()