Lines Matching refs:iface

42 	struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai);  in axg_tdm_set_tdm_slots()  local
57 iface->slots = slots; in axg_tdm_set_tdm_slots()
81 iface->slot_width = slot_width; in axg_tdm_set_tdm_slots()
103 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_set_sysclk() local
107 if (!iface->mclk) { in axg_tdm_iface_set_sysclk()
110 ret = clk_set_rate(iface->mclk, freq); in axg_tdm_iface_set_sysclk()
112 iface->mclk_rate = freq; in axg_tdm_iface_set_sysclk()
121 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_set_fmt() local
125 if (!iface->mclk) { in axg_tdm_iface_set_fmt()
142 iface->fmt = fmt; in axg_tdm_iface_set_fmt()
149 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_startup() local
163 iface->rate); in axg_tdm_iface_startup()
168 MAX_SCLK / (iface->slots * iface->slot_width); in axg_tdm_iface_startup()
186 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_set_stream() local
192 iface->rate = params_rate(params); in axg_tdm_iface_set_stream()
200 if (iface->slot_width < width) { in axg_tdm_iface_set_stream()
216 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_set_lrclk() local
220 ret = clk_set_rate(iface->lrclk, params_rate(params)); in axg_tdm_iface_set_lrclk()
226 switch (iface->fmt & SND_SOC_DAIFMT_FORMAT_MASK) { in axg_tdm_iface_set_lrclk()
249 ret = clk_set_duty_cycle(iface->lrclk, ratio_num, 2); in axg_tdm_iface_set_lrclk()
257 ret = clk_set_phase(iface->lrclk, in axg_tdm_iface_set_lrclk()
258 axg_tdm_lrclk_invert(iface->fmt) ? 180 : 0); in axg_tdm_iface_set_lrclk()
271 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_set_sclk() local
275 srate = iface->slots * iface->slot_width * params_rate(params); in axg_tdm_iface_set_sclk()
277 if (!iface->mclk_rate) { in axg_tdm_iface_set_sclk()
279 clk_set_rate(iface->mclk, 2 * srate); in axg_tdm_iface_set_sclk()
282 if (iface->mclk_rate % srate) { in axg_tdm_iface_set_sclk()
285 srate, iface->mclk_rate); in axg_tdm_iface_set_sclk()
290 ret = clk_set_rate(iface->sclk, srate); in axg_tdm_iface_set_sclk()
297 ret = clk_set_phase(iface->sclk, in axg_tdm_iface_set_sclk()
298 axg_tdm_sclk_invert(iface->fmt) ? 0 : 180); in axg_tdm_iface_set_sclk()
311 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_hw_params() local
315 switch (iface->fmt & SND_SOC_DAIFMT_FORMAT_MASK) { in axg_tdm_iface_hw_params()
319 if (iface->slots > 2) { in axg_tdm_iface_hw_params()
321 iface->slots); in axg_tdm_iface_hw_params()
339 if ((iface->fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) == in axg_tdm_iface_hw_params()
350 ret = axg_tdm_stream_set_cont_clocks(ts, iface->fmt); in axg_tdm_iface_hw_params()
406 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_probe_dai() local
415 ts = axg_tdm_stream_alloc(iface); in axg_tdm_iface_probe_dai()
475 struct axg_tdm_iface *iface = snd_soc_component_get_drvdata(component); in axg_tdm_iface_set_bias_level() local
483 ret = clk_prepare_enable(iface->mclk); in axg_tdm_iface_set_bias_level()
488 clk_disable_unprepare(iface->mclk); in axg_tdm_iface_set_bias_level()
525 struct axg_tdm_iface *iface; in axg_tdm_iface_probe() local
528 iface = devm_kzalloc(dev, sizeof(*iface), GFP_KERNEL); in axg_tdm_iface_probe()
529 if (!iface) in axg_tdm_iface_probe()
531 platform_set_drvdata(pdev, iface); in axg_tdm_iface_probe()
548 iface->sclk = devm_clk_get(dev, "sclk"); in axg_tdm_iface_probe()
549 if (IS_ERR(iface->sclk)) in axg_tdm_iface_probe()
550 return dev_err_probe(dev, PTR_ERR(iface->sclk), "failed to get sclk\n"); in axg_tdm_iface_probe()
553 iface->lrclk = devm_clk_get(dev, "lrclk"); in axg_tdm_iface_probe()
554 if (IS_ERR(iface->lrclk)) in axg_tdm_iface_probe()
555 return dev_err_probe(dev, PTR_ERR(iface->lrclk), "failed to get lrclk\n"); in axg_tdm_iface_probe()
563 iface->mclk = devm_clk_get_optional(dev, "mclk"); in axg_tdm_iface_probe()
564 if (IS_ERR(iface->mclk)) in axg_tdm_iface_probe()
565 return dev_err_probe(dev, PTR_ERR(iface->mclk), "failed to get mclk\n"); in axg_tdm_iface_probe()