Lines Matching refs:dai
13 #define soc_dai_ret(dai, ret) _soc_dai_ret(dai, __func__, ret) argument
14 static inline int _soc_dai_ret(struct snd_soc_dai *dai, in _soc_dai_ret() argument
27 dev_err(dai->dev, in _soc_dai_ret()
29 func, dai->name, ret); in _soc_dai_ret()
39 #define soc_dai_mark_push(dai, substream, tgt) ((dai)->mark_##tgt = substream) argument
40 #define soc_dai_mark_pop(dai, substream, tgt) ((dai)->mark_##tgt = NULL) argument
41 #define soc_dai_mark_match(dai, substream, tgt) ((dai)->mark_##tgt == substream) argument
52 int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id, in snd_soc_dai_set_sysclk() argument
57 if (dai->driver->ops && in snd_soc_dai_set_sysclk()
58 dai->driver->ops->set_sysclk) in snd_soc_dai_set_sysclk()
59 ret = dai->driver->ops->set_sysclk(dai, clk_id, freq, dir); in snd_soc_dai_set_sysclk()
61 ret = snd_soc_component_set_sysclk(dai->component, clk_id, 0, in snd_soc_dai_set_sysclk()
64 return soc_dai_ret(dai, ret); in snd_soc_dai_set_sysclk()
78 int snd_soc_dai_set_clkdiv(struct snd_soc_dai *dai, in snd_soc_dai_set_clkdiv() argument
83 if (dai->driver->ops && in snd_soc_dai_set_clkdiv()
84 dai->driver->ops->set_clkdiv) in snd_soc_dai_set_clkdiv()
85 ret = dai->driver->ops->set_clkdiv(dai, div_id, div); in snd_soc_dai_set_clkdiv()
87 return soc_dai_ret(dai, ret); in snd_soc_dai_set_clkdiv()
101 int snd_soc_dai_set_pll(struct snd_soc_dai *dai, int pll_id, int source, in snd_soc_dai_set_pll() argument
106 if (dai->driver->ops && in snd_soc_dai_set_pll()
107 dai->driver->ops->set_pll) in snd_soc_dai_set_pll()
108 ret = dai->driver->ops->set_pll(dai, pll_id, source, in snd_soc_dai_set_pll()
111 ret = snd_soc_component_set_pll(dai->component, pll_id, source, in snd_soc_dai_set_pll()
114 return soc_dai_ret(dai, ret); in snd_soc_dai_set_pll()
125 int snd_soc_dai_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio) in snd_soc_dai_set_bclk_ratio() argument
129 if (dai->driver->ops && in snd_soc_dai_set_bclk_ratio()
130 dai->driver->ops->set_bclk_ratio) in snd_soc_dai_set_bclk_ratio()
131 ret = dai->driver->ops->set_bclk_ratio(dai, ratio); in snd_soc_dai_set_bclk_ratio()
133 return soc_dai_ret(dai, ret); in snd_soc_dai_set_bclk_ratio()
144 int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) in snd_soc_dai_set_fmt() argument
148 if (dai->driver->ops && in snd_soc_dai_set_fmt()
149 dai->driver->ops->set_fmt) in snd_soc_dai_set_fmt()
150 ret = dai->driver->ops->set_fmt(dai, fmt); in snd_soc_dai_set_fmt()
152 return soc_dai_ret(dai, ret); in snd_soc_dai_set_fmt()
203 int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, in snd_soc_dai_set_tdm_slot() argument
209 if (dai->driver->ops && in snd_soc_dai_set_tdm_slot()
210 dai->driver->ops->xlate_tdm_slot_mask) in snd_soc_dai_set_tdm_slot()
211 dai->driver->ops->xlate_tdm_slot_mask(slots, in snd_soc_dai_set_tdm_slot()
216 dai->tx_mask = tx_mask; in snd_soc_dai_set_tdm_slot()
217 dai->rx_mask = rx_mask; in snd_soc_dai_set_tdm_slot()
219 if (dai->driver->ops && in snd_soc_dai_set_tdm_slot()
220 dai->driver->ops->set_tdm_slot) in snd_soc_dai_set_tdm_slot()
221 ret = dai->driver->ops->set_tdm_slot(dai, tx_mask, rx_mask, in snd_soc_dai_set_tdm_slot()
223 return soc_dai_ret(dai, ret); in snd_soc_dai_set_tdm_slot()
239 int snd_soc_dai_set_channel_map(struct snd_soc_dai *dai, in snd_soc_dai_set_channel_map() argument
245 if (dai->driver->ops && in snd_soc_dai_set_channel_map()
246 dai->driver->ops->set_channel_map) in snd_soc_dai_set_channel_map()
247 ret = dai->driver->ops->set_channel_map(dai, tx_num, tx_slot, in snd_soc_dai_set_channel_map()
249 return soc_dai_ret(dai, ret); in snd_soc_dai_set_channel_map()
263 int snd_soc_dai_get_channel_map(struct snd_soc_dai *dai, in snd_soc_dai_get_channel_map() argument
269 if (dai->driver->ops && in snd_soc_dai_get_channel_map()
270 dai->driver->ops->get_channel_map) in snd_soc_dai_get_channel_map()
271 ret = dai->driver->ops->get_channel_map(dai, tx_num, tx_slot, in snd_soc_dai_get_channel_map()
273 return soc_dai_ret(dai, ret); in snd_soc_dai_get_channel_map()
284 int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate) in snd_soc_dai_set_tristate() argument
288 if (dai->driver->ops && in snd_soc_dai_set_tristate()
289 dai->driver->ops->set_tristate) in snd_soc_dai_set_tristate()
290 ret = dai->driver->ops->set_tristate(dai, tristate); in snd_soc_dai_set_tristate()
292 return soc_dai_ret(dai, ret); in snd_soc_dai_set_tristate()
304 int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute, in snd_soc_dai_digital_mute() argument
313 if (dai->driver->ops && in snd_soc_dai_digital_mute()
314 dai->driver->ops->mute_stream && in snd_soc_dai_digital_mute()
316 !dai->driver->ops->no_capture_mute)) in snd_soc_dai_digital_mute()
317 ret = dai->driver->ops->mute_stream(dai, mute, direction); in snd_soc_dai_digital_mute()
319 return soc_dai_ret(dai, ret); in snd_soc_dai_digital_mute()
323 int snd_soc_dai_hw_params(struct snd_soc_dai *dai, in snd_soc_dai_hw_params() argument
335 if (dai->driver->ops && in snd_soc_dai_hw_params()
336 dai->driver->ops->hw_params) in snd_soc_dai_hw_params()
337 ret = dai->driver->ops->hw_params(substream, params, dai); in snd_soc_dai_hw_params()
339 return soc_dai_ret(dai, ret); in snd_soc_dai_hw_params()
342 void snd_soc_dai_hw_free(struct snd_soc_dai *dai, in snd_soc_dai_hw_free() argument
345 if (dai->driver->ops && in snd_soc_dai_hw_free()
346 dai->driver->ops->hw_free) in snd_soc_dai_hw_free()
347 dai->driver->ops->hw_free(substream, dai); in snd_soc_dai_hw_free()
350 int snd_soc_dai_startup(struct snd_soc_dai *dai, in snd_soc_dai_startup() argument
355 if (dai->driver->ops && in snd_soc_dai_startup()
356 dai->driver->ops->startup) in snd_soc_dai_startup()
357 ret = dai->driver->ops->startup(substream, dai); in snd_soc_dai_startup()
361 soc_dai_mark_push(dai, substream, startup); in snd_soc_dai_startup()
363 return soc_dai_ret(dai, ret); in snd_soc_dai_startup()
366 void snd_soc_dai_shutdown(struct snd_soc_dai *dai, in snd_soc_dai_shutdown() argument
370 if (rollback && !soc_dai_mark_match(dai, substream, startup)) in snd_soc_dai_shutdown()
373 if (dai->driver->ops && in snd_soc_dai_shutdown()
374 dai->driver->ops->shutdown) in snd_soc_dai_shutdown()
375 dai->driver->ops->shutdown(substream, dai); in snd_soc_dai_shutdown()
378 soc_dai_mark_pop(dai, substream, startup); in snd_soc_dai_shutdown()
381 snd_pcm_sframes_t snd_soc_dai_delay(struct snd_soc_dai *dai, in snd_soc_dai_delay() argument
386 if (dai->driver->ops && in snd_soc_dai_delay()
387 dai->driver->ops->delay) in snd_soc_dai_delay()
388 delay = dai->driver->ops->delay(substream, dai); in snd_soc_dai_delay()
393 int snd_soc_dai_compress_new(struct snd_soc_dai *dai, in snd_soc_dai_compress_new() argument
397 if (dai->driver->compress_new) in snd_soc_dai_compress_new()
398 ret = dai->driver->compress_new(rtd, num); in snd_soc_dai_compress_new()
399 return soc_dai_ret(dai, ret); in snd_soc_dai_compress_new()
407 bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int dir) in snd_soc_dai_stream_valid() argument
409 struct snd_soc_pcm_stream *stream = snd_soc_dai_get_pcm_stream(dai, dir); in snd_soc_dai_stream_valid()
422 struct snd_soc_dai *dai; in snd_soc_dai_link_set_capabilities() local
434 dai = snd_soc_find_dai_with_mutex(cpu); in snd_soc_dai_link_set_capabilities()
435 if (dai && snd_soc_dai_stream_valid(dai, direction)) { in snd_soc_dai_link_set_capabilities()
441 dai = snd_soc_find_dai_with_mutex(codec); in snd_soc_dai_link_set_capabilities()
442 if (dai && snd_soc_dai_stream_valid(dai, direction)) { in snd_soc_dai_link_set_capabilities()
455 void snd_soc_dai_action(struct snd_soc_dai *dai, in snd_soc_dai_action() argument
459 dai->stream_active[stream] += action; in snd_soc_dai_action()
462 dai->component->active += action; in snd_soc_dai_action()
466 int snd_soc_dai_active(struct snd_soc_dai *dai) in snd_soc_dai_active() argument
472 active += dai->stream_active[stream]; in snd_soc_dai_active()
480 struct snd_soc_dai *dai; in snd_soc_pcm_dai_probe() local
483 for_each_rtd_dais(rtd, i, dai) { in snd_soc_pcm_dai_probe()
484 if (dai->driver->probe_order != order) in snd_soc_pcm_dai_probe()
487 if (dai->driver->probe) { in snd_soc_pcm_dai_probe()
488 int ret = dai->driver->probe(dai); in snd_soc_pcm_dai_probe()
491 return soc_dai_ret(dai, ret); in snd_soc_pcm_dai_probe()
494 dai->probed = 1; in snd_soc_pcm_dai_probe()
502 struct snd_soc_dai *dai; in snd_soc_pcm_dai_remove() local
505 for_each_rtd_dais(rtd, i, dai) { in snd_soc_pcm_dai_remove()
506 if (dai->driver->remove_order != order) in snd_soc_pcm_dai_remove()
509 if (dai->probed && in snd_soc_pcm_dai_remove()
510 dai->driver->remove) { in snd_soc_pcm_dai_remove()
511 r = dai->driver->remove(dai); in snd_soc_pcm_dai_remove()
516 dai->probed = 0; in snd_soc_pcm_dai_remove()
524 struct snd_soc_dai *dai; in snd_soc_pcm_dai_new() local
527 for_each_rtd_dais(rtd, i, dai) { in snd_soc_pcm_dai_new()
528 if (dai->driver->pcm_new) { in snd_soc_pcm_dai_new()
529 ret = dai->driver->pcm_new(rtd, dai); in snd_soc_pcm_dai_new()
531 return soc_dai_ret(dai, ret); in snd_soc_pcm_dai_new()
541 struct snd_soc_dai *dai; in snd_soc_pcm_dai_prepare() local
544 for_each_rtd_dais(rtd, i, dai) { in snd_soc_pcm_dai_prepare()
545 if (dai->driver->ops && in snd_soc_pcm_dai_prepare()
546 dai->driver->ops->prepare) { in snd_soc_pcm_dai_prepare()
547 ret = dai->driver->ops->prepare(substream, dai); in snd_soc_pcm_dai_prepare()
549 return soc_dai_ret(dai, ret); in snd_soc_pcm_dai_prepare()
560 struct snd_soc_dai *dai; in snd_soc_pcm_dai_trigger() local
563 for_each_rtd_dais(rtd, i, dai) { in snd_soc_pcm_dai_trigger()
564 if (dai->driver->ops && in snd_soc_pcm_dai_trigger()
565 dai->driver->ops->trigger) { in snd_soc_pcm_dai_trigger()
566 ret = dai->driver->ops->trigger(substream, cmd, dai); in snd_soc_pcm_dai_trigger()
568 return soc_dai_ret(dai, ret); in snd_soc_pcm_dai_trigger()
579 struct snd_soc_dai *dai; in snd_soc_pcm_dai_bespoke_trigger() local
582 for_each_rtd_dais(rtd, i, dai) { in snd_soc_pcm_dai_bespoke_trigger()
583 if (dai->driver->ops && in snd_soc_pcm_dai_bespoke_trigger()
584 dai->driver->ops->bespoke_trigger) { in snd_soc_pcm_dai_bespoke_trigger()
585 ret = dai->driver->ops->bespoke_trigger(substream, in snd_soc_pcm_dai_bespoke_trigger()
586 cmd, dai); in snd_soc_pcm_dai_bespoke_trigger()
588 return soc_dai_ret(dai, ret); in snd_soc_pcm_dai_bespoke_trigger()
595 int snd_soc_dai_compr_startup(struct snd_soc_dai *dai, in snd_soc_dai_compr_startup() argument
600 if (dai->driver->cops && in snd_soc_dai_compr_startup()
601 dai->driver->cops->startup) in snd_soc_dai_compr_startup()
602 ret = dai->driver->cops->startup(cstream, dai); in snd_soc_dai_compr_startup()
604 return soc_dai_ret(dai, ret); in snd_soc_dai_compr_startup()
608 void snd_soc_dai_compr_shutdown(struct snd_soc_dai *dai, in snd_soc_dai_compr_shutdown() argument
611 if (dai->driver->cops && in snd_soc_dai_compr_shutdown()
612 dai->driver->cops->shutdown) in snd_soc_dai_compr_shutdown()
613 dai->driver->cops->shutdown(cstream, dai); in snd_soc_dai_compr_shutdown()
617 int snd_soc_dai_compr_trigger(struct snd_soc_dai *dai, in snd_soc_dai_compr_trigger() argument
622 if (dai->driver->cops && in snd_soc_dai_compr_trigger()
623 dai->driver->cops->trigger) in snd_soc_dai_compr_trigger()
624 ret = dai->driver->cops->trigger(cstream, cmd, dai); in snd_soc_dai_compr_trigger()
626 return soc_dai_ret(dai, ret); in snd_soc_dai_compr_trigger()
630 int snd_soc_dai_compr_set_params(struct snd_soc_dai *dai, in snd_soc_dai_compr_set_params() argument
636 if (dai->driver->cops && in snd_soc_dai_compr_set_params()
637 dai->driver->cops->set_params) in snd_soc_dai_compr_set_params()
638 ret = dai->driver->cops->set_params(cstream, params, dai); in snd_soc_dai_compr_set_params()
640 return soc_dai_ret(dai, ret); in snd_soc_dai_compr_set_params()
644 int snd_soc_dai_compr_get_params(struct snd_soc_dai *dai, in snd_soc_dai_compr_get_params() argument
650 if (dai->driver->cops && in snd_soc_dai_compr_get_params()
651 dai->driver->cops->get_params) in snd_soc_dai_compr_get_params()
652 ret = dai->driver->cops->get_params(cstream, params, dai); in snd_soc_dai_compr_get_params()
654 return soc_dai_ret(dai, ret); in snd_soc_dai_compr_get_params()
658 int snd_soc_dai_compr_ack(struct snd_soc_dai *dai, in snd_soc_dai_compr_ack() argument
664 if (dai->driver->cops && in snd_soc_dai_compr_ack()
665 dai->driver->cops->ack) in snd_soc_dai_compr_ack()
666 ret = dai->driver->cops->ack(cstream, bytes, dai); in snd_soc_dai_compr_ack()
668 return soc_dai_ret(dai, ret); in snd_soc_dai_compr_ack()
672 int snd_soc_dai_compr_pointer(struct snd_soc_dai *dai, in snd_soc_dai_compr_pointer() argument
678 if (dai->driver->cops && in snd_soc_dai_compr_pointer()
679 dai->driver->cops->pointer) in snd_soc_dai_compr_pointer()
680 ret = dai->driver->cops->pointer(cstream, tstamp, dai); in snd_soc_dai_compr_pointer()
682 return soc_dai_ret(dai, ret); in snd_soc_dai_compr_pointer()
686 int snd_soc_dai_compr_set_metadata(struct snd_soc_dai *dai, in snd_soc_dai_compr_set_metadata() argument
692 if (dai->driver->cops && in snd_soc_dai_compr_set_metadata()
693 dai->driver->cops->set_metadata) in snd_soc_dai_compr_set_metadata()
694 ret = dai->driver->cops->set_metadata(cstream, metadata, dai); in snd_soc_dai_compr_set_metadata()
696 return soc_dai_ret(dai, ret); in snd_soc_dai_compr_set_metadata()
700 int snd_soc_dai_compr_get_metadata(struct snd_soc_dai *dai, in snd_soc_dai_compr_get_metadata() argument
706 if (dai->driver->cops && in snd_soc_dai_compr_get_metadata()
707 dai->driver->cops->get_metadata) in snd_soc_dai_compr_get_metadata()
708 ret = dai->driver->cops->get_metadata(cstream, metadata, dai); in snd_soc_dai_compr_get_metadata()
710 return soc_dai_ret(dai, ret); in snd_soc_dai_compr_get_metadata()