Lines Matching full:rtd

11 #define soc_link_ret(rtd, ret) _soc_link_ret(rtd, __func__, ret)  argument
12 static inline int _soc_link_ret(struct snd_soc_pcm_runtime *rtd, in _soc_link_ret() argument
25 dev_err(rtd->dev, in _soc_link_ret()
27 func, rtd->dai_link->name, ret); in _soc_link_ret()
37 #define soc_link_mark_push(rtd, substream, tgt) ((rtd)->mark_##tgt = substream) argument
38 #define soc_link_mark_pop(rtd, substream, tgt) ((rtd)->mark_##tgt = NULL) argument
39 #define soc_link_mark_match(rtd, substream, tgt) ((rtd)->mark_##tgt == substream) argument
41 int snd_soc_link_init(struct snd_soc_pcm_runtime *rtd) in snd_soc_link_init() argument
45 if (rtd->dai_link->init) in snd_soc_link_init()
46 ret = rtd->dai_link->init(rtd); in snd_soc_link_init()
48 return soc_link_ret(rtd, ret); in snd_soc_link_init()
51 void snd_soc_link_exit(struct snd_soc_pcm_runtime *rtd) in snd_soc_link_exit() argument
53 if (rtd->dai_link->exit) in snd_soc_link_exit()
54 rtd->dai_link->exit(rtd); in snd_soc_link_exit()
57 int snd_soc_link_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, in snd_soc_link_be_hw_params_fixup() argument
62 if (rtd->dai_link->be_hw_params_fixup) in snd_soc_link_be_hw_params_fixup()
63 ret = rtd->dai_link->be_hw_params_fixup(rtd, params); in snd_soc_link_be_hw_params_fixup()
65 return soc_link_ret(rtd, ret); in snd_soc_link_be_hw_params_fixup()
70 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); in snd_soc_link_startup() local
73 if (rtd->dai_link->ops && in snd_soc_link_startup()
74 rtd->dai_link->ops->startup) in snd_soc_link_startup()
75 ret = rtd->dai_link->ops->startup(substream); in snd_soc_link_startup()
79 soc_link_mark_push(rtd, substream, startup); in snd_soc_link_startup()
81 return soc_link_ret(rtd, ret); in snd_soc_link_startup()
87 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); in snd_soc_link_shutdown() local
89 if (rollback && !soc_link_mark_match(rtd, substream, startup)) in snd_soc_link_shutdown()
92 if (rtd->dai_link->ops && in snd_soc_link_shutdown()
93 rtd->dai_link->ops->shutdown) in snd_soc_link_shutdown()
94 rtd->dai_link->ops->shutdown(substream); in snd_soc_link_shutdown()
97 soc_link_mark_pop(rtd, substream, startup); in snd_soc_link_shutdown()
102 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); in snd_soc_link_prepare() local
105 if (rtd->dai_link->ops && in snd_soc_link_prepare()
106 rtd->dai_link->ops->prepare) in snd_soc_link_prepare()
107 ret = rtd->dai_link->ops->prepare(substream); in snd_soc_link_prepare()
109 return soc_link_ret(rtd, ret); in snd_soc_link_prepare()
115 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); in snd_soc_link_hw_params() local
118 if (rtd->dai_link->ops && in snd_soc_link_hw_params()
119 rtd->dai_link->ops->hw_params) in snd_soc_link_hw_params()
120 ret = rtd->dai_link->ops->hw_params(substream, params); in snd_soc_link_hw_params()
124 soc_link_mark_push(rtd, substream, hw_params); in snd_soc_link_hw_params()
126 return soc_link_ret(rtd, ret); in snd_soc_link_hw_params()
131 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); in snd_soc_link_hw_free() local
133 if (rollback && !soc_link_mark_match(rtd, substream, hw_params)) in snd_soc_link_hw_free()
136 if (rtd->dai_link->ops && in snd_soc_link_hw_free()
137 rtd->dai_link->ops->hw_free) in snd_soc_link_hw_free()
138 rtd->dai_link->ops->hw_free(substream); in snd_soc_link_hw_free()
141 soc_link_mark_pop(rtd, substream, hw_params); in snd_soc_link_hw_free()
146 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); in soc_link_trigger() local
149 if (rtd->dai_link->ops && in soc_link_trigger()
150 rtd->dai_link->ops->trigger) in soc_link_trigger()
151 ret = rtd->dai_link->ops->trigger(substream, cmd); in soc_link_trigger()
153 return soc_link_ret(rtd, ret); in soc_link_trigger()
159 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); in snd_soc_link_trigger() local
169 soc_link_mark_push(rtd, substream, trigger); in snd_soc_link_trigger()
174 if (rollback && !soc_link_mark_match(rtd, substream, trigger)) in snd_soc_link_trigger()
178 soc_link_mark_pop(rtd, substream, startup); in snd_soc_link_trigger()
186 struct snd_soc_pcm_runtime *rtd = cstream->private_data; in snd_soc_link_compr_startup() local
189 if (rtd->dai_link->compr_ops && in snd_soc_link_compr_startup()
190 rtd->dai_link->compr_ops->startup) in snd_soc_link_compr_startup()
191 ret = rtd->dai_link->compr_ops->startup(cstream); in snd_soc_link_compr_startup()
194 soc_link_mark_push(rtd, cstream, compr_startup); in snd_soc_link_compr_startup()
196 return soc_link_ret(rtd, ret); in snd_soc_link_compr_startup()
203 struct snd_soc_pcm_runtime *rtd = cstream->private_data; in snd_soc_link_compr_shutdown() local
205 if (rollback && !soc_link_mark_match(rtd, cstream, compr_startup)) in snd_soc_link_compr_shutdown()
208 if (rtd->dai_link->compr_ops && in snd_soc_link_compr_shutdown()
209 rtd->dai_link->compr_ops->shutdown) in snd_soc_link_compr_shutdown()
210 rtd->dai_link->compr_ops->shutdown(cstream); in snd_soc_link_compr_shutdown()
212 soc_link_mark_pop(rtd, cstream, compr_startup); in snd_soc_link_compr_shutdown()
218 struct snd_soc_pcm_runtime *rtd = cstream->private_data; in snd_soc_link_compr_set_params() local
221 if (rtd->dai_link->compr_ops && in snd_soc_link_compr_set_params()
222 rtd->dai_link->compr_ops->set_params) in snd_soc_link_compr_set_params()
223 ret = rtd->dai_link->compr_ops->set_params(cstream); in snd_soc_link_compr_set_params()
225 return soc_link_ret(rtd, ret); in snd_soc_link_compr_set_params()