summaryrefslogtreecommitdiffstats
path: root/sound/soc/fsl/mpc8610_hpcd.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2019-06-06 06:15:25 +0200
committerMark Brown <broonie@kernel.org>2019-06-06 22:42:35 +0200
commit6aa7b4091d0bd3866d42e368ef32674aa1c155cc (patch)
tree9d584b3e978ac3d2696950bf89df01ba82d1683c /sound/soc/fsl/mpc8610_hpcd.c
parentASoC: fsl: fsl-asoc-card: use modern dai_link style (diff)
downloadlinux-6aa7b4091d0bd3866d42e368ef32674aa1c155cc.tar.xz
linux-6aa7b4091d0bd3866d42e368ef32674aa1c155cc.zip
ASoC: fsl: mpc8610_hpcd/p1022_ds/p1022_rdk: use modern dai_link style
ASoC is now supporting modern style dai_link (= snd_soc_dai_link_component) for CPU/Codec/Platform. This patch switches to use it. mpc8610_hpcd/p1022_ds/p1022_rdk are sharing fsl_asoc_get_dma_channel() which setups platform. We need to update these by 1 patch. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/fsl/mpc8610_hpcd.c')
-rw-r--r--sound/soc/fsl/mpc8610_hpcd.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/sound/soc/fsl/mpc8610_hpcd.c b/sound/soc/fsl/mpc8610_hpcd.c
index f6261a3eeb0f..23617eb09ba1 100644
--- a/sound/soc/fsl/mpc8610_hpcd.c
+++ b/sound/soc/fsl/mpc8610_hpcd.c
@@ -189,6 +189,7 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev)
struct device_node *np = ssi_pdev->dev.of_node;
struct device_node *codec_np = NULL;
struct mpc8610_hpcd_data *machine_data;
+ struct snd_soc_dai_link_component *comp;
int ret = -ENODEV;
const char *sprop;
const u32 *iprop;
@@ -206,14 +207,36 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev)
goto error_alloc;
}
- machine_data->dai[0].cpu_dai_name = dev_name(&ssi_pdev->dev);
+ comp = devm_kzalloc(&pdev->dev, 6 * sizeof(*comp), GFP_KERNEL);
+ if (!comp) {
+ ret = -ENOMEM;
+ goto error_alloc;
+ }
+
+ machine_data->dai[0].cpus = &comp[0];
+ machine_data->dai[0].codecs = &comp[1];
+ machine_data->dai[0].platforms = &comp[2];
+
+ machine_data->dai[0].num_cpus = 1;
+ machine_data->dai[0].num_codecs = 1;
+ machine_data->dai[0].num_platforms = 1;
+
+ machine_data->dai[1].cpus = &comp[3];
+ machine_data->dai[1].codecs = &comp[4];
+ machine_data->dai[1].platforms = &comp[5];
+
+ machine_data->dai[1].num_cpus = 1;
+ machine_data->dai[1].num_codecs = 1;
+ machine_data->dai[1].num_platforms = 1;
+
+ machine_data->dai[0].cpus->dai_name = dev_name(&ssi_pdev->dev);
machine_data->dai[0].ops = &mpc8610_hpcd_ops;
/* ASoC core can match codec with device node */
- machine_data->dai[0].codec_of_node = codec_np;
+ machine_data->dai[0].codecs->of_node = codec_np;
/* The DAI name from the codec (snd_soc_dai_driver.name) */
- machine_data->dai[0].codec_dai_name = "cs4270-hifi";
+ machine_data->dai[0].codecs->dai_name = "cs4270-hifi";
/* We register two DAIs per SSI, one for playback and the other for
* capture. Currently, we only support codecs that have one DAI for
@@ -306,7 +329,7 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev)
}
/* Find the playback DMA channel to use. */
- machine_data->dai[0].platform_name = machine_data->platform_name[0];
+ machine_data->dai[0].platforms->name = machine_data->platform_name[0];
ret = fsl_asoc_get_dma_channel(np, "fsl,playback-dma",
&machine_data->dai[0],
&machine_data->dma_channel_id[0],
@@ -317,7 +340,7 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev)
}
/* Find the capture DMA channel to use. */
- machine_data->dai[1].platform_name = machine_data->platform_name[1];
+ machine_data->dai[1].platforms->name = machine_data->platform_name[1];
ret = fsl_asoc_get_dma_channel(np, "fsl,capture-dma",
&machine_data->dai[1],
&machine_data->dma_channel_id[1],