Commit 35617d82 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: atmel: sam9x5_wm8731: 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.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent ed00d6cc
...@@ -82,6 +82,7 @@ static int sam9x5_wm8731_driver_probe(struct platform_device *pdev) ...@@ -82,6 +82,7 @@ static int sam9x5_wm8731_driver_probe(struct platform_device *pdev)
struct snd_soc_card *card; struct snd_soc_card *card;
struct snd_soc_dai_link *dai; struct snd_soc_dai_link *dai;
struct sam9x5_drvdata *priv; struct sam9x5_drvdata *priv;
struct snd_soc_dai_link_component *comp;
int ret; int ret;
if (!np) { if (!np) {
...@@ -92,7 +93,8 @@ static int sam9x5_wm8731_driver_probe(struct platform_device *pdev) ...@@ -92,7 +93,8 @@ static int sam9x5_wm8731_driver_probe(struct platform_device *pdev)
card = devm_kzalloc(&pdev->dev, sizeof(*card), GFP_KERNEL); card = devm_kzalloc(&pdev->dev, sizeof(*card), GFP_KERNEL);
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
dai = devm_kzalloc(&pdev->dev, sizeof(*dai), GFP_KERNEL); dai = devm_kzalloc(&pdev->dev, sizeof(*dai), GFP_KERNEL);
if (!dai || !card || !priv) { comp = devm_kzalloc(&pdev->dev, 3 * sizeof(*comp), GFP_KERNEL);
if (!dai || !card || !priv || !comp) {
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
} }
...@@ -105,9 +107,17 @@ static int sam9x5_wm8731_driver_probe(struct platform_device *pdev) ...@@ -105,9 +107,17 @@ static int sam9x5_wm8731_driver_probe(struct platform_device *pdev)
card->num_links = 1; card->num_links = 1;
card->dapm_widgets = sam9x5_dapm_widgets; card->dapm_widgets = sam9x5_dapm_widgets;
card->num_dapm_widgets = ARRAY_SIZE(sam9x5_dapm_widgets); card->num_dapm_widgets = ARRAY_SIZE(sam9x5_dapm_widgets);
dai->cpus = &comp[0];
dai->num_cpus = 1;
dai->codecs = &comp[1];
dai->num_codecs = 1;
dai->platforms = &comp[2];
dai->num_platforms = 1;
dai->name = "WM8731"; dai->name = "WM8731";
dai->stream_name = "WM8731 PCM"; dai->stream_name = "WM8731 PCM";
dai->codec_dai_name = "wm8731-hifi"; dai->codecs->dai_name = "wm8731-hifi";
dai->init = sam9x5_wm8731_init; dai->init = sam9x5_wm8731_init;
dai->dai_fmt = SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_NB_NF dai->dai_fmt = SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_NB_NF
| SND_SOC_DAIFMT_CBM_CFM; | SND_SOC_DAIFMT_CBM_CFM;
...@@ -131,7 +141,7 @@ static int sam9x5_wm8731_driver_probe(struct platform_device *pdev) ...@@ -131,7 +141,7 @@ static int sam9x5_wm8731_driver_probe(struct platform_device *pdev)
goto out; goto out;
} }
dai->codec_of_node = codec_np; dai->codecs->of_node = codec_np;
cpu_np = of_parse_phandle(np, "atmel,ssc-controller", 0); cpu_np = of_parse_phandle(np, "atmel,ssc-controller", 0);
if (!cpu_np) { if (!cpu_np) {
...@@ -139,8 +149,8 @@ static int sam9x5_wm8731_driver_probe(struct platform_device *pdev) ...@@ -139,8 +149,8 @@ static int sam9x5_wm8731_driver_probe(struct platform_device *pdev)
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
dai->cpu_of_node = cpu_np; dai->cpus->of_node = cpu_np;
dai->platform_of_node = cpu_np; dai->platforms->of_node = cpu_np;
priv->ssc_id = of_alias_get_id(cpu_np, "ssc"); priv->ssc_id = of_alias_get_id(cpu_np, "ssc");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment