Lines Matching full:dai

11 #include <sound/soc-dai.h>
38 int axg_tdm_set_tdm_slots(struct snd_soc_dai *dai, u32 *tx_mask, in axg_tdm_set_tdm_slots() argument
42 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_set_tdm_slots()
43 struct axg_tdm_stream *tx = snd_soc_dai_dma_data_get_playback(dai); in axg_tdm_set_tdm_slots()
44 struct axg_tdm_stream *rx = snd_soc_dai_dma_data_get_capture(dai); in axg_tdm_set_tdm_slots()
53 dev_err(dai->dev, "interface has no slot\n"); in axg_tdm_set_tdm_slots()
77 dev_err(dai->dev, "unsupported slot width: %d\n", slot_width); in axg_tdm_set_tdm_slots()
83 /* Amend the dai driver and let dpcm merge do its job */ in axg_tdm_set_tdm_slots()
86 dai->driver->playback.channels_max = tx_slots; in axg_tdm_set_tdm_slots()
87 dai->driver->playback.formats = fmt; in axg_tdm_set_tdm_slots()
92 dai->driver->capture.channels_max = rx_slots; in axg_tdm_set_tdm_slots()
93 dai->driver->capture.formats = fmt; in axg_tdm_set_tdm_slots()
100 static int axg_tdm_iface_set_sysclk(struct snd_soc_dai *dai, int clk_id, in axg_tdm_iface_set_sysclk() argument
103 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_set_sysclk()
108 dev_warn(dai->dev, "master clock not provided\n"); in axg_tdm_iface_set_sysclk()
119 static int axg_tdm_iface_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) in axg_tdm_iface_set_fmt() argument
121 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_set_fmt()
126 dev_err(dai->dev, "cpu clock master: mclk missing\n"); in axg_tdm_iface_set_fmt()
136 dev_err(dai->dev, "only CBS_CFS and CBM_CFM are supported\n"); in axg_tdm_iface_set_fmt()
147 struct snd_soc_dai *dai) in axg_tdm_iface_startup() argument
149 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_startup()
151 snd_soc_dai_get_dma_data(dai, substream); in axg_tdm_iface_startup()
155 dev_err(dai->dev, "interface has not slots\n"); in axg_tdm_iface_startup()
159 if (snd_soc_component_active(dai->component)) { in axg_tdm_iface_startup()
175 dev_err(dai->dev, "can't set iface rate constraint\n"); in axg_tdm_iface_startup()
184 struct snd_soc_dai *dai) in axg_tdm_iface_set_stream() argument
186 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_set_stream()
187 struct axg_tdm_stream *ts = snd_soc_dai_get_dma_data(dai, substream); in axg_tdm_iface_set_stream()
196 dev_err(dai->dev, "not enough slots for channels\n"); in axg_tdm_iface_set_stream()
201 dev_err(dai->dev, "incompatible slots width for stream\n"); in axg_tdm_iface_set_stream()
213 static int axg_tdm_iface_set_lrclk(struct snd_soc_dai *dai, in axg_tdm_iface_set_lrclk() argument
216 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_set_lrclk()
222 dev_err(dai->dev, "setting sample clock failed: %d\n", ret); in axg_tdm_iface_set_lrclk()
251 dev_err(dai->dev, in axg_tdm_iface_set_lrclk()
260 dev_err(dai->dev, in axg_tdm_iface_set_lrclk()
268 static int axg_tdm_iface_set_sclk(struct snd_soc_dai *dai, in axg_tdm_iface_set_sclk() argument
271 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_set_sclk()
283 dev_err(dai->dev, in axg_tdm_iface_set_sclk()
292 dev_err(dai->dev, "setting bit clock failed: %d\n", ret); in axg_tdm_iface_set_sclk()
300 dev_err(dai->dev, "setting bit clock phase failed: %d\n", ret); in axg_tdm_iface_set_sclk()
309 struct snd_soc_dai *dai) in axg_tdm_iface_hw_params() argument
311 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_hw_params()
319 dev_err(dai->dev, "bad slot number for format: %d\n", in axg_tdm_iface_hw_params()
330 dev_err(dai->dev, "unsupported dai format\n"); in axg_tdm_iface_hw_params()
334 ret = axg_tdm_iface_set_stream(substream, params, dai); in axg_tdm_iface_hw_params()
340 ret = axg_tdm_iface_set_sclk(dai, params); in axg_tdm_iface_hw_params()
344 ret = axg_tdm_iface_set_lrclk(dai, params); in axg_tdm_iface_hw_params()
354 struct snd_soc_dai *dai) in axg_tdm_iface_trigger() argument
357 snd_soc_dai_get_dma_data(dai, substream); in axg_tdm_iface_trigger()
377 static int axg_tdm_iface_remove_dai(struct snd_soc_dai *dai) in axg_tdm_iface_remove_dai() argument
382 struct axg_tdm_stream *ts = snd_soc_dai_dma_data_get(dai, stream); in axg_tdm_iface_remove_dai()
391 static int axg_tdm_iface_probe_dai(struct snd_soc_dai *dai) in axg_tdm_iface_probe_dai() argument
393 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_probe_dai()
399 if (!snd_soc_dai_get_widget(dai, stream)) in axg_tdm_iface_probe_dai()
404 axg_tdm_iface_remove_dai(dai); in axg_tdm_iface_probe_dai()
407 snd_soc_dai_dma_data_set(dai, stream, ts); in axg_tdm_iface_probe_dai()
520 * Duplicate dai driver: depending on the slot masks configuration in axg_tdm_iface_probe()
521 * We'll change the number of channel provided by DAI stream, so dpcm in axg_tdm_iface_probe()
544 * mclk maybe be missing when the cpu dai is in slave mode and in axg_tdm_iface_probe()
547 * throw an error if the cpu dai is master and mclk is missing in axg_tdm_iface_probe()