Lines Matching full:dai
26 static int q6dma_set_channel_map(struct snd_soc_dai *dai, in q6dma_set_channel_map() argument
31 struct q6apm_lpass_dai_data *dai_data = dev_get_drvdata(dai->dev); in q6dma_set_channel_map()
32 struct audioreach_module_config *cfg = &dai_data->module_config[dai->id]; in q6dma_set_channel_map()
35 switch (dai->id) { in q6dma_set_channel_map()
49 dev_err(dai->dev, "tx slot not found\n"); in q6dma_set_channel_map()
54 dev_err(dai->dev, "invalid tx num %d\n", in q6dma_set_channel_map()
73 dev_err(dai->dev, "rx slot not found\n"); in q6dma_set_channel_map()
77 dev_err(dai->dev, "invalid rx num %d\n", in q6dma_set_channel_map()
85 dev_err(dai->dev, "%s: invalid dai id 0x%x\n", in q6dma_set_channel_map()
86 __func__, dai->id); in q6dma_set_channel_map()
96 struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) in q6hdmi_hw_params() argument
98 struct q6apm_lpass_dai_data *dai_data = dev_get_drvdata(dai->dev); in q6hdmi_hw_params()
99 struct audioreach_module_config *cfg = &dai_data->module_config[dai->id]; in q6hdmi_hw_params()
107 switch (dai->id) { in q6hdmi_hw_params()
112 cfg->dp_idx = dai->id - DISPLAY_PORT_RX_1 + 1; in q6hdmi_hw_params()
126 struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) in q6dma_hw_params() argument
128 struct q6apm_lpass_dai_data *dai_data = dev_get_drvdata(dai->dev); in q6dma_hw_params()
129 struct audioreach_module_config *cfg = &dai_data->module_config[dai->id]; in q6dma_hw_params()
138 static void q6apm_lpass_dai_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) in q6apm_lpass_dai_shutdown() argument
140 struct q6apm_lpass_dai_data *dai_data = dev_get_drvdata(dai->dev); in q6apm_lpass_dai_shutdown()
143 if (dai_data->is_port_started[dai->id]) { in q6apm_lpass_dai_shutdown()
144 rc = q6apm_graph_stop(dai_data->graph[dai->id]); in q6apm_lpass_dai_shutdown()
145 dai_data->is_port_started[dai->id] = false; in q6apm_lpass_dai_shutdown()
147 dev_err(dai->dev, "fail to close APM port (%d)\n", rc); in q6apm_lpass_dai_shutdown()
150 if (dai_data->graph[dai->id]) { in q6apm_lpass_dai_shutdown()
151 q6apm_graph_close(dai_data->graph[dai->id]); in q6apm_lpass_dai_shutdown()
152 dai_data->graph[dai->id] = NULL; in q6apm_lpass_dai_shutdown()
156 static int q6apm_lpass_dai_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) in q6apm_lpass_dai_prepare() argument
158 struct q6apm_lpass_dai_data *dai_data = dev_get_drvdata(dai->dev); in q6apm_lpass_dai_prepare()
159 struct audioreach_module_config *cfg = &dai_data->module_config[dai->id]; in q6apm_lpass_dai_prepare()
161 int graph_id = dai->id; in q6apm_lpass_dai_prepare()
164 if (dai_data->is_port_started[dai->id]) { in q6apm_lpass_dai_prepare()
165 q6apm_graph_stop(dai_data->graph[dai->id]); in q6apm_lpass_dai_prepare()
166 dai_data->is_port_started[dai->id] = false; in q6apm_lpass_dai_prepare()
169 q6apm_graph_close(dai_data->graph[dai->id]); in q6apm_lpass_dai_prepare()
170 dai_data->graph[dai->id] = NULL; in q6apm_lpass_dai_prepare()
179 graph = q6apm_graph_open(dai->dev, NULL, dai->dev, graph_id); in q6apm_lpass_dai_prepare()
181 dev_err(dai->dev, "Failed to open graph (%d)\n", graph_id); in q6apm_lpass_dai_prepare()
189 rc = q6apm_graph_media_format_pcm(dai_data->graph[dai->id], cfg); in q6apm_lpass_dai_prepare()
191 dev_err(dai->dev, "Failed to set media format %d\n", rc); in q6apm_lpass_dai_prepare()
195 rc = q6apm_graph_prepare(dai_data->graph[dai->id]); in q6apm_lpass_dai_prepare()
197 dev_err(dai->dev, "Failed to prepare Graph %d\n", rc); in q6apm_lpass_dai_prepare()
201 rc = q6apm_graph_start(dai_data->graph[dai->id]); in q6apm_lpass_dai_prepare()
203 dev_err(dai->dev, "fail to start APM port %x\n", dai->id); in q6apm_lpass_dai_prepare()
206 dai_data->is_port_started[dai->id] = true; in q6apm_lpass_dai_prepare()
210 q6apm_graph_close(dai_data->graph[dai->id]); in q6apm_lpass_dai_prepare()
211 dai_data->graph[dai->id] = NULL; in q6apm_lpass_dai_prepare()
215 static int q6apm_lpass_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) in q6apm_lpass_dai_startup() argument
217 struct q6apm_lpass_dai_data *dai_data = dev_get_drvdata(dai->dev); in q6apm_lpass_dai_startup()
219 int graph_id = dai->id; in q6apm_lpass_dai_startup()
222 graph = q6apm_graph_open(dai->dev, NULL, dai->dev, graph_id); in q6apm_lpass_dai_startup()
224 dev_err(dai->dev, "Failed to open graph (%d)\n", graph_id); in q6apm_lpass_dai_startup()
233 static int q6i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) in q6i2s_set_fmt() argument
235 struct q6apm_lpass_dai_data *dai_data = dev_get_drvdata(dai->dev); in q6i2s_set_fmt()
236 struct audioreach_module_config *cfg = &dai_data->module_config[dai->id]; in q6i2s_set_fmt()
268 .name = "q6apm-be-dai-component",
314 MODULE_DESCRIPTION("AUDIOREACH APM LPASS dai driver");