1
0
Fork 0

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>
(cherry picked from commit aa8b9304d207e5f00cca8a41772c130dd4c6944b)
pull/10/head
Shengjiu Wang 2018-07-27 17:50:56 +08:00 committed by Jason Liu
parent f30a02522e
commit 38f079dd2c
1 changed files with 14 additions and 2 deletions

View File

@ -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");