Lines Matching refs:qmc_dai

20 struct qmc_dai {
32 struct qmc_dai *dais;
37 struct qmc_dai *qmc_dai;
91 ret = qmc_chan_write_submit(prtd->qmc_dai->qmc_chan,
95 dev_err(prtd->qmc_dai->dev, "write_submit failed %d\n",
108 dev_err(prtd->qmc_dai->dev, "read complete length = %zu, exp %zu\n",
120 ret = qmc_chan_read_submit(prtd->qmc_dai->qmc_chan,
124 dev_err(prtd->qmc_dai->dev, "read_submit failed %d\n",
137 if (!prtd->qmc_dai) {
138 dev_err(component->dev, "qmc_dai is not set\n");
146 ret = qmc_chan_write_submit(prtd->qmc_dai->qmc_chan,
161 ret = qmc_chan_write_submit(prtd->qmc_dai->qmc_chan,
171 ret = qmc_chan_read_submit(prtd->qmc_dai->qmc_chan,
186 ret = qmc_chan_read_submit(prtd->qmc_dai->qmc_chan,
303 static struct qmc_dai *qmc_dai_get_data(struct snd_soc_dai *dai)
319 static int qmc_dai_hw_rule_channels_by_format(struct qmc_dai *qmc_dai,
341 dev_err(qmc_dai->dev, "format physical width %u not supported\n",
354 struct qmc_dai *qmc_dai = rule->private;
356 return qmc_dai_hw_rule_channels_by_format(qmc_dai, params, qmc_dai->nb_tx_ts);
363 struct qmc_dai *qmc_dai = rule->private;
365 return qmc_dai_hw_rule_channels_by_format(qmc_dai, params, qmc_dai->nb_rx_ts);
368 static int qmc_dai_hw_rule_format_by_channels(struct qmc_dai *qmc_dai,
379 dev_err(qmc_dai->dev, "channels %u not supported\n",
401 struct qmc_dai *qmc_dai = rule->private;
403 return qmc_dai_hw_rule_format_by_channels(qmc_dai, params, qmc_dai->nb_tx_ts);
410 struct qmc_dai *qmc_dai = rule->private;
412 return qmc_dai_hw_rule_format_by_channels(qmc_dai, params, qmc_dai->nb_rx_ts);
421 struct qmc_dai *qmc_dai;
425 qmc_dai = qmc_dai_get_data(dai);
426 if (!qmc_dai) {
431 prtd->qmc_dai = qmc_dai;
436 frame_bits = qmc_dai->nb_rx_ts * 8;
440 frame_bits = qmc_dai->nb_tx_ts * 8;
444 hw_rule_channels_by_format, qmc_dai,
452 hw_rule_format_by_channels, qmc_dai,
475 struct qmc_dai *qmc_dai;
478 qmc_dai = qmc_dai_get_data(dai);
479 if (!qmc_dai) {
487 ret = qmc_chan_set_param(qmc_dai->qmc_chan, &chan_param);
501 struct qmc_dai *qmc_dai;
505 qmc_dai = qmc_dai_get_data(dai);
506 if (!qmc_dai) {
518 ret = qmc_chan_start(qmc_dai->qmc_chan, direction);
524 ret = qmc_chan_stop(qmc_dai->qmc_chan, direction);
527 ret = qmc_chan_reset(qmc_dai->qmc_chan, direction);
534 ret = qmc_chan_stop(qmc_dai->qmc_chan, direction);
590 struct qmc_dai *qmc_dai, struct snd_soc_dai_driver *qmc_soc_dai_driver)
596 qmc_dai->dev = qmc_audio->dev;
603 qmc_dai->id = val;
605 qmc_dai->name = devm_kasprintf(qmc_audio->dev, GFP_KERNEL, "%s.%d",
606 np->parent->name, qmc_dai->id);
607 if (!qmc_dai->name)
610 qmc_dai->qmc_chan = devm_qmc_chan_get_byphandle(qmc_audio->dev, np,
612 if (IS_ERR(qmc_dai->qmc_chan)) {
613 ret = PTR_ERR(qmc_dai->qmc_chan);
615 "dai %d get QMC channel failed\n", qmc_dai->id);
618 qmc_soc_dai_driver->id = qmc_dai->id;
619 qmc_soc_dai_driver->name = qmc_dai->name;
621 ret = qmc_chan_get_info(qmc_dai->qmc_chan, &info);
624 qmc_dai->id, ret);
628 qmc_dai->id, info.mode, info.nb_tx_ts, info.nb_rx_ts);
632 qmc_dai->id, info.mode);
635 qmc_dai->nb_tx_ts = info.nb_tx_ts;
636 qmc_dai->nb_rx_ts = info.nb_rx_ts;
640 if (qmc_dai->nb_tx_ts) {
642 qmc_soc_dai_driver->playback.channels_max = qmc_dai->nb_tx_ts;
644 qmc_soc_dai_driver->playback.formats = qmc_audio_formats(qmc_dai->nb_tx_ts);
648 if (qmc_dai->nb_rx_ts) {
650 qmc_soc_dai_driver->capture.channels_max = qmc_dai->nb_rx_ts;
652 qmc_soc_dai_driver->capture.formats = qmc_audio_formats(qmc_dai->nb_rx_ts);