From 005e9f296325dad20a2fc34152e7a4aae047c342 Mon Sep 17 00:00:00 2001 From: Shengjiu Wang Date: Wed, 30 Oct 2019 18:09:09 +0800 Subject: ASoC: imx-pdm: Fix compile issue API change due to: adb76b5b9c47 ("ASoC: soc-core: remove legacy style dai_link") Signed-off-by: Shengjiu Wang --- sound/soc/fsl/imx-pdm.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'sound/soc/fsl/imx-pdm.c') diff --git a/sound/soc/fsl/imx-pdm.c b/sound/soc/fsl/imx-pdm.c index d69e27ec50c8..9e61689d0278 100644 --- a/sound/soc/fsl/imx-pdm.c +++ b/sound/soc/fsl/imx-pdm.c @@ -99,8 +99,13 @@ static int imx_pdm_mic_probe(struct platform_device *pdev) struct device_node *np = pdev->dev.of_node; struct platform_device *cpu_pdev; struct imx_pdm_data *data; + struct snd_soc_dai_link_component *dlc; int ret; + dlc = devm_kzalloc(&pdev->dev, 3 * sizeof(*dlc), GFP_KERNEL); + if (!dlc) + return -ENOMEM; + cpu_np = of_parse_phandle(np, "audio-cpu", 0); if (!cpu_np) { dev_err(&pdev->dev, "cpu dai phandle missing or invalid\n"); @@ -127,13 +132,20 @@ static int imx_pdm_mic_probe(struct platform_device *pdev) goto fail; } + data->dai.cpus = &dlc[0]; + data->dai.num_cpus = 1; + data->dai.platforms = &dlc[1]; + data->dai.num_platforms = 1; + data->dai.codecs = &dlc[2]; + data->dai.num_codecs = 1; + data->dai.name = "pdm hifi"; data->dai.stream_name = "pdm hifi"; - data->dai.codec_dai_name = "snd-soc-dummy-dai"; - data->dai.codec_name = "snd-soc-dummy"; - data->dai.cpu_dai_name = dev_name(&cpu_pdev->dev); - data->dai.platform_of_node = cpu_np; - data->dai.capture_only = "true"; + data->dai.codecs->dai_name = "snd-soc-dummy-dai"; + data->dai.codecs->name = "snd-soc-dummy"; + data->dai.cpus->dai_name = dev_name(&cpu_pdev->dev); + data->dai.platforms->of_node = cpu_np; + data->dai.capture_only = 1; data->dai.ops = &imx_pdm_mic_ops; data->card.dev = &pdev->dev; -- cgit v1.2.3