Lines Matching full:dai
20 #include <sound/soc-dai.h>
27 static int setup_pcm_multichan(struct snd_soc_dai *dai, in setup_pcm_multichan() argument
30 struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(dai->dev); in setup_pcm_multichan()
51 dev_dbg(dai->dev, in setup_pcm_multichan()
60 static int setup_frameper(struct snd_soc_dai *dai, unsigned int rate, in setup_frameper() argument
63 struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(dai->dev); in setup_frameper()
89 dev_err(dai->dev, in setup_frameper()
108 dev_err(dai->dev, in setup_frameper()
117 dev_dbg(dai->dev, "%s: Clocks per frame: %u\n", in setup_frameper()
124 static int setup_pcm_framing(struct snd_soc_dai *dai, unsigned int rate, in setup_pcm_framing() argument
127 struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(dai->dev); in setup_pcm_framing()
150 dev_err(dai->dev, in setup_pcm_framing()
166 return setup_frameper(dai, rate, prot_desc); in setup_pcm_framing()
169 static int setup_clocking(struct snd_soc_dai *dai, in setup_clocking() argument
184 dev_err(dai->dev, in setup_clocking()
193 dev_dbg(dai->dev, "%s: Codec is master.\n", __func__); in setup_clocking()
205 dev_dbg(dai->dev, "%s: Codec is slave.\n", __func__); in setup_clocking()
216 dev_err(dai->dev, "%s: Error: Unsupported master (fmt = 0x%x)!\n", in setup_clocking()
225 static int setup_pcm_protdesc(struct snd_soc_dai *dai, in setup_pcm_protdesc() argument
239 dev_dbg(dai->dev, "%s: DSP_A.\n", __func__); in setup_pcm_protdesc()
246 dev_dbg(dai->dev, "%s: DSP_B.\n", __func__); in setup_pcm_protdesc()
299 struct snd_soc_dai *dai, in setup_msp_config() argument
302 struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(dai->dev); in setup_msp_config()
320 dev_dbg(dai->dev, "%s: f_inputclk = %u, frame_freq = %u.\n", in setup_msp_config()
325 dev_dbg(dai->dev, "%s: rate: %u, channels: %d.\n", __func__, in setup_msp_config()
330 dev_dbg(dai->dev, "%s: SND_SOC_DAIFMT_I2S.\n", __func__); in setup_msp_config()
337 dev_dbg(dai->dev, "%s: SND_SOC_DAIFMT_I2S.\n", __func__); in setup_msp_config()
352 dev_dbg(dai->dev, "%s: PCM format.\n", __func__); in setup_msp_config()
357 ret = setup_pcm_protdesc(dai, fmt, prot_desc); in setup_msp_config()
361 ret = setup_pcm_multichan(dai, msp_config); in setup_msp_config()
365 ret = setup_pcm_framing(dai, runtime->rate, prot_desc); in setup_msp_config()
372 dev_err(dai->dev, "%s: Error: Unsupported format (%d)!\n", in setup_msp_config()
377 return setup_clocking(dai, fmt, msp_config); in setup_msp_config()
381 struct snd_soc_dai *dai) in ux500_msp_dai_startup() argument
384 struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(dai->dev); in ux500_msp_dai_startup()
386 dev_dbg(dai->dev, "%s: MSP %d (%s): Enter.\n", __func__, dai->id, in ux500_msp_dai_startup()
398 dev_dbg(dai->dev, "%s: Enabling MSP-clocks.\n", __func__); in ux500_msp_dai_startup()
422 struct snd_soc_dai *dai) in ux500_msp_dai_shutdown() argument
425 struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(dai->dev); in ux500_msp_dai_shutdown()
428 dev_dbg(dai->dev, "%s: MSP %d (%s): Enter.\n", __func__, dai->id, in ux500_msp_dai_shutdown()
439 dev_err(dai->dev, in ux500_msp_dai_shutdown()
441 __func__, dai->id, snd_pcm_stream_str(substream)); in ux500_msp_dai_shutdown()
451 dev_err(dai->dev, in ux500_msp_dai_shutdown()
457 struct snd_soc_dai *dai) in ux500_msp_dai_prepare() argument
460 struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(dai->dev); in ux500_msp_dai_prepare()
464 dev_dbg(dai->dev, "%s: MSP %d (%s): Enter (rate = %d).\n", __func__, in ux500_msp_dai_prepare()
465 dai->id, snd_pcm_stream_str(substream), runtime->rate); in ux500_msp_dai_prepare()
467 setup_msp_config(substream, dai, &msp_config); in ux500_msp_dai_prepare()
471 dev_err(dai->dev, "%s: Error: msp_setup failed (ret = %d)!\n", in ux500_msp_dai_prepare()
496 struct snd_soc_dai *dai) in ux500_msp_dai_hw_params() argument
500 struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(dai->dev); in ux500_msp_dai_hw_params()
502 dev_dbg(dai->dev, "%s: MSP %d (%s): Enter.\n", in ux500_msp_dai_hw_params()
503 __func__, dai->id, snd_pcm_stream_str(substream)); in ux500_msp_dai_hw_params()
519 dev_dbg(dai->dev, "TDM-slots active: %d", slots_active); in ux500_msp_dai_hw_params()
527 dev_err(dai->dev, in ux500_msp_dai_hw_params()
536 static int ux500_msp_dai_set_dai_fmt(struct snd_soc_dai *dai, in ux500_msp_dai_set_dai_fmt() argument
539 struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(dai->dev); in ux500_msp_dai_set_dai_fmt()
541 dev_dbg(dai->dev, "%s: MSP %d: Enter.\n", __func__, dai->id); in ux500_msp_dai_set_dai_fmt()
554 dev_err(dai->dev, in ux500_msp_dai_set_dai_fmt()
567 dev_err(dai->dev, in ux500_msp_dai_set_dai_fmt()
577 static int ux500_msp_dai_set_tdm_slot(struct snd_soc_dai *dai, in ux500_msp_dai_set_tdm_slot() argument
582 struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(dai->dev); in ux500_msp_dai_set_tdm_slot()
599 dev_err(dai->dev, "%s: Error: Unsupported slot-count (%d)!\n", in ux500_msp_dai_set_tdm_slot()
606 dev_err(dai->dev, "%s: Error: Unsupported slot-width (%d)!\n", in ux500_msp_dai_set_tdm_slot()
618 static int ux500_msp_dai_set_dai_sysclk(struct snd_soc_dai *dai, in ux500_msp_dai_set_dai_sysclk() argument
621 struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(dai->dev); in ux500_msp_dai_set_dai_sysclk()
623 dev_dbg(dai->dev, "%s: MSP %d: Enter. clk-id: %d, freq: %u.\n", in ux500_msp_dai_set_dai_sysclk()
624 __func__, dai->id, clk_id, freq); in ux500_msp_dai_set_dai_sysclk()
632 dev_err(dai->dev, "%s: MSP %d: Invalid clk-id (%d)!\n", in ux500_msp_dai_set_dai_sysclk()
633 __func__, dai->id, clk_id); in ux500_msp_dai_set_dai_sysclk()
641 int cmd, struct snd_soc_dai *dai) in ux500_msp_dai_trigger() argument
644 struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(dai->dev); in ux500_msp_dai_trigger()
646 dev_dbg(dai->dev, "%s: MSP %d (%s): Enter (msp->id = %d, cmd = %d).\n", in ux500_msp_dai_trigger()
647 __func__, dai->id, snd_pcm_stream_str(substream), in ux500_msp_dai_trigger()
655 static int ux500_msp_dai_of_probe(struct snd_soc_dai *dai) in ux500_msp_dai_of_probe() argument
657 struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(dai->dev); in ux500_msp_dai_of_probe()
661 playback_dma_data = devm_kzalloc(dai->dev, in ux500_msp_dai_of_probe()
667 capture_dma_data = devm_kzalloc(dai->dev, in ux500_msp_dai_of_probe()
679 snd_soc_dai_init_dma_data(dai, playback_dma_data, capture_dma_data); in ux500_msp_dai_of_probe()