Lines Matching refs:simple_dai
244 struct simple_util_dai *simple_dai, in simple_util_parse_clk() argument
257 simple_dai->clk_fixed = of_property_read_bool( in simple_util_parse_clk()
260 simple_dai->sysclk = clk_get_rate(clk); in simple_util_parse_clk()
262 simple_dai->clk = clk; in simple_util_parse_clk()
264 simple_dai->sysclk = val; in simple_util_parse_clk()
265 simple_dai->clk_fixed = true; in simple_util_parse_clk()
269 simple_dai->sysclk = clk_get_rate(clk); in simple_util_parse_clk()
273 simple_dai->clk_direction = SND_SOC_CLOCK_OUT; in simple_util_parse_clk()
386 struct simple_util_dai *simple_dai, in simple_set_clk_rate() argument
389 if (!simple_dai) in simple_set_clk_rate()
392 if (simple_dai->clk_fixed && rate != simple_dai->sysclk) { in simple_set_clk_rate()
393 dev_err(dev, "dai %s invalid clock rate %lu\n", simple_dai->name, rate); in simple_set_clk_rate()
397 if (!simple_dai->clk) in simple_set_clk_rate()
400 if (clk_get_rate(simple_dai->clk) == rate) in simple_set_clk_rate()
403 return clk_set_rate(simple_dai->clk, rate); in simple_set_clk_rate()
407 struct simple_util_dai *simple_dai, in simple_set_tdm() argument
414 if (!simple_dai || !simple_dai->tdm_width_map) in simple_set_tdm()
417 slot_width = simple_dai->slot_width; in simple_set_tdm()
418 slot_count = simple_dai->slots; in simple_set_tdm()
423 for (i = 0; i < simple_dai->n_tdm_widths; ++i) { in simple_set_tdm()
424 if (simple_dai->tdm_width_map[i].sample_bits == sample_bits) { in simple_set_tdm()
425 slot_width = simple_dai->tdm_width_map[i].slot_width; in simple_set_tdm()
426 slot_count = simple_dai->tdm_width_map[i].slot_count; in simple_set_tdm()
432 simple_dai->tx_slot_mask, in simple_set_tdm()
433 simple_dai->rx_slot_mask, in simple_set_tdm()
540 static int simple_init_dai(struct snd_soc_dai *dai, struct simple_util_dai *simple_dai) in simple_init_dai() argument
544 if (!simple_dai) in simple_init_dai()
547 if (simple_dai->sysclk) { in simple_init_dai()
548 ret = snd_soc_dai_set_sysclk(dai, 0, simple_dai->sysclk, in simple_init_dai()
549 simple_dai->clk_direction); in simple_init_dai()
556 if (simple_dai->slots) { in simple_init_dai()
558 simple_dai->tx_slot_mask, in simple_init_dai()
559 simple_dai->rx_slot_mask, in simple_init_dai()
560 simple_dai->slots, in simple_init_dai()
561 simple_dai->slot_width); in simple_init_dai()