summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@nxp.com>2018-07-27 17:50:56 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commitb8052208ffb82a550ed5d2a02867ee0c9222a6b2 (patch)
treefa5831ecddf5ab0c5974722107706b124a13179f
parenta6b7031d6a9109ee6ade07ad778b7af1ad99a6bd (diff)
MLK-19067-1: ASoC: imx-rpmsg: differentiate input and output direction
Some platform the rpmsg device only support playback or record. So Add a property to differentiate them. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
-rw-r--r--sound/soc/fsl/imx-rpmsg.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/sound/soc/fsl/imx-rpmsg.c b/sound/soc/fsl/imx-rpmsg.c
index 844bdaceb472..a5bb68d7afb4 100644
--- a/sound/soc/fsl/imx-rpmsg.c
+++ b/sound/soc/fsl/imx-rpmsg.c
@@ -70,14 +70,26 @@ static int imx_rpmsg_probe(struct platform_device *pdev)
}
data->dai[0].cpu_dai_name = dev_name(&cpu_pdev->dev);
data->dai[0].platform_of_node = cpu_np;
- data->dai[0].playback_only = false;
- data->dai[0].capture_only = false;
+ data->dai[0].playback_only = true;
+ data->dai[0].capture_only = true;
data->dai[0].dai_fmt = SND_SOC_DAIFMT_I2S |
SND_SOC_DAIFMT_NB_NF |
SND_SOC_DAIFMT_CBM_CFM;
data->card.num_links = 1;
data->card.dai_link = data->dai;
+ if (of_property_read_bool(pdev->dev.of_node, "rpmsg-out"))
+ data->dai[0].capture_only = false;
+
+ if (of_property_read_bool(pdev->dev.of_node, "rpmsg-in"))
+ data->dai[0].playback_only = false;
+
+ if (data->dai[0].playback_only && data->dai[0].capture_only) {
+ dev_err(&pdev->dev, "no enabled rpmsg DAI link\n");
+ ret = -EINVAL;
+ goto fail;
+ }
+
data->card.dev = &pdev->dev;
data->card.owner = THIS_MODULE;
ret = snd_soc_of_parse_card_name(&data->card, "model");