Lines Matching full:dai

11 #include <sound/soc-dai.h>
35 int axg_tdm_set_tdm_slots(struct snd_soc_dai *dai, u32 *tx_mask, in axg_tdm_set_tdm_slots() argument
39 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_set_tdm_slots()
41 dai->playback_dma_data; in axg_tdm_set_tdm_slots()
43 dai->capture_dma_data; in axg_tdm_set_tdm_slots()
52 dev_err(dai->dev, "interface has no slot\n"); in axg_tdm_set_tdm_slots()
76 dev_err(dai->dev, "unsupported slot width: %d\n", slot_width); in axg_tdm_set_tdm_slots()
82 /* Amend the dai driver and let dpcm merge do its job */ in axg_tdm_set_tdm_slots()
85 dai->driver->playback.channels_max = tx_slots; in axg_tdm_set_tdm_slots()
86 dai->driver->playback.formats = fmt; in axg_tdm_set_tdm_slots()
91 dai->driver->capture.channels_max = rx_slots; in axg_tdm_set_tdm_slots()
92 dai->driver->capture.formats = fmt; in axg_tdm_set_tdm_slots()
99 static int axg_tdm_iface_set_sysclk(struct snd_soc_dai *dai, int clk_id, in axg_tdm_iface_set_sysclk() argument
102 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_set_sysclk()
107 dev_warn(dai->dev, "master clock not provided\n"); in axg_tdm_iface_set_sysclk()
118 static int axg_tdm_iface_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) in axg_tdm_iface_set_fmt() argument
120 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_set_fmt()
125 dev_err(dai->dev, "cpu clock master: mclk missing\n"); in axg_tdm_iface_set_fmt()
135 dev_err(dai->dev, "only CBS_CFS and CBM_CFM are supported\n"); in axg_tdm_iface_set_fmt()
146 struct snd_soc_dai *dai) in axg_tdm_iface_startup() argument
148 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_startup()
150 snd_soc_dai_get_dma_data(dai, substream); in axg_tdm_iface_startup()
154 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()
164 dev_err(dai->dev, in axg_tdm_iface_startup()
175 struct snd_soc_dai *dai) in axg_tdm_iface_set_stream() argument
177 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_set_stream()
178 struct axg_tdm_stream *ts = snd_soc_dai_get_dma_data(dai, substream); in axg_tdm_iface_set_stream()
187 dev_err(dai->dev, "not enough slots for channels\n"); in axg_tdm_iface_set_stream()
192 dev_err(dai->dev, "incompatible slots width for stream\n"); in axg_tdm_iface_set_stream()
204 static int axg_tdm_iface_set_lrclk(struct snd_soc_dai *dai, in axg_tdm_iface_set_lrclk() argument
207 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_set_lrclk()
213 dev_err(dai->dev, "setting sample clock failed: %d\n", ret); in axg_tdm_iface_set_lrclk()
242 dev_err(dai->dev, in axg_tdm_iface_set_lrclk()
251 dev_err(dai->dev, in axg_tdm_iface_set_lrclk()
259 static int axg_tdm_iface_set_sclk(struct snd_soc_dai *dai, in axg_tdm_iface_set_sclk() argument
262 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_set_sclk()
274 dev_err(dai->dev, in axg_tdm_iface_set_sclk()
283 dev_err(dai->dev, "setting bit clock failed: %d\n", ret); in axg_tdm_iface_set_sclk()
291 dev_err(dai->dev, "setting bit clock phase failed: %d\n", ret); in axg_tdm_iface_set_sclk()
300 struct snd_soc_dai *dai) in axg_tdm_iface_hw_params() argument
302 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_hw_params()
310 dev_err(dai->dev, "bad slot number for format: %d\n", in axg_tdm_iface_hw_params()
321 dev_err(dai->dev, "unsupported dai format\n"); in axg_tdm_iface_hw_params()
325 ret = axg_tdm_iface_set_stream(substream, params, dai); in axg_tdm_iface_hw_params()
331 ret = axg_tdm_iface_set_sclk(dai, params); in axg_tdm_iface_hw_params()
335 ret = axg_tdm_iface_set_lrclk(dai, params); in axg_tdm_iface_hw_params()
344 struct snd_soc_dai *dai) in axg_tdm_iface_hw_free() argument
346 struct axg_tdm_stream *ts = snd_soc_dai_get_dma_data(dai, substream); in axg_tdm_iface_hw_free()
355 struct snd_soc_dai *dai) in axg_tdm_iface_prepare() argument
357 struct axg_tdm_stream *ts = snd_soc_dai_get_dma_data(dai, substream); in axg_tdm_iface_prepare()
363 static int axg_tdm_iface_remove_dai(struct snd_soc_dai *dai) in axg_tdm_iface_remove_dai() argument
365 if (dai->capture_dma_data) in axg_tdm_iface_remove_dai()
366 axg_tdm_stream_free(dai->capture_dma_data); in axg_tdm_iface_remove_dai()
368 if (dai->playback_dma_data) in axg_tdm_iface_remove_dai()
369 axg_tdm_stream_free(dai->playback_dma_data); in axg_tdm_iface_remove_dai()
374 static int axg_tdm_iface_probe_dai(struct snd_soc_dai *dai) in axg_tdm_iface_probe_dai() argument
376 struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); in axg_tdm_iface_probe_dai()
378 if (dai->capture_widget) { in axg_tdm_iface_probe_dai()
379 dai->capture_dma_data = axg_tdm_stream_alloc(iface); in axg_tdm_iface_probe_dai()
380 if (!dai->capture_dma_data) in axg_tdm_iface_probe_dai()
384 if (dai->playback_widget) { in axg_tdm_iface_probe_dai()
385 dai->playback_dma_data = axg_tdm_stream_alloc(iface); in axg_tdm_iface_probe_dai()
386 if (!dai->playback_dma_data) { in axg_tdm_iface_probe_dai()
387 axg_tdm_iface_remove_dai(dai); in axg_tdm_iface_probe_dai()
505 * Duplicate dai driver: depending on the slot masks configuration in axg_tdm_iface_probe()
506 * We'll change the number of channel provided by DAI stream, so dpcm in axg_tdm_iface_probe()
529 * mclk maybe be missing when the cpu dai is in slave mode and in axg_tdm_iface_probe()
532 * throw an error if the cpu dai is master and mclk is missing in axg_tdm_iface_probe()