ASoC: atmel: atmel-wm8904: 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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
1199dd99dd
commit
079878be6f
|
@ -57,14 +57,19 @@ static const struct snd_soc_ops atmel_asoc_wm8904_ops = {
|
||||||
.hw_params = atmel_asoc_wm8904_hw_params,
|
.hw_params = atmel_asoc_wm8904_hw_params,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
SND_SOC_DAILINK_DEFS(pcm,
|
||||||
|
DAILINK_COMP_ARRAY(COMP_EMPTY()),
|
||||||
|
DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "wm8904-hifi")),
|
||||||
|
DAILINK_COMP_ARRAY(COMP_EMPTY()));
|
||||||
|
|
||||||
static struct snd_soc_dai_link atmel_asoc_wm8904_dailink = {
|
static struct snd_soc_dai_link atmel_asoc_wm8904_dailink = {
|
||||||
.name = "WM8904",
|
.name = "WM8904",
|
||||||
.stream_name = "WM8904 PCM",
|
.stream_name = "WM8904 PCM",
|
||||||
.codec_dai_name = "wm8904-hifi",
|
|
||||||
.dai_fmt = SND_SOC_DAIFMT_I2S
|
.dai_fmt = SND_SOC_DAIFMT_I2S
|
||||||
| SND_SOC_DAIFMT_NB_NF
|
| SND_SOC_DAIFMT_NB_NF
|
||||||
| SND_SOC_DAIFMT_CBM_CFM,
|
| SND_SOC_DAIFMT_CBM_CFM,
|
||||||
.ops = &atmel_asoc_wm8904_ops,
|
.ops = &atmel_asoc_wm8904_ops,
|
||||||
|
SND_SOC_DAILINK_REG(pcm),
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct snd_soc_card atmel_asoc_wm8904_card = {
|
static struct snd_soc_card atmel_asoc_wm8904_card = {
|
||||||
|
@ -108,8 +113,8 @@ static int atmel_asoc_wm8904_dt_init(struct platform_device *pdev)
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
dailink->cpu_of_node = cpu_np;
|
dailink->cpus->of_node = cpu_np;
|
||||||
dailink->platform_of_node = cpu_np;
|
dailink->platforms->of_node = cpu_np;
|
||||||
of_node_put(cpu_np);
|
of_node_put(cpu_np);
|
||||||
|
|
||||||
codec_np = of_parse_phandle(np, "atmel,audio-codec", 0);
|
codec_np = of_parse_phandle(np, "atmel,audio-codec", 0);
|
||||||
|
@ -118,7 +123,7 @@ static int atmel_asoc_wm8904_dt_init(struct platform_device *pdev)
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
dailink->codec_of_node = codec_np;
|
dailink->codecs->of_node = codec_np;
|
||||||
of_node_put(codec_np);
|
of_node_put(codec_np);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -137,7 +142,7 @@ static int atmel_asoc_wm8904_probe(struct platform_device *pdev)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
id = of_alias_get_id((struct device_node *)dailink->cpu_of_node, "ssc");
|
id = of_alias_get_id((struct device_node *)dailink->cpus->of_node, "ssc");
|
||||||
ret = atmel_ssc_set_audio(id);
|
ret = atmel_ssc_set_audio(id);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
dev_err(&pdev->dev, "failed to set SSC %d for audio\n", id);
|
dev_err(&pdev->dev, "failed to set SSC %d for audio\n", id);
|
||||||
|
@ -163,7 +168,7 @@ static int atmel_asoc_wm8904_remove(struct platform_device *pdev)
|
||||||
struct snd_soc_dai_link *dailink = &atmel_asoc_wm8904_dailink;
|
struct snd_soc_dai_link *dailink = &atmel_asoc_wm8904_dailink;
|
||||||
int id;
|
int id;
|
||||||
|
|
||||||
id = of_alias_get_id((struct device_node *)dailink->cpu_of_node, "ssc");
|
id = of_alias_get_id((struct device_node *)dailink->cpus->of_node, "ssc");
|
||||||
|
|
||||||
snd_soc_unregister_card(card);
|
snd_soc_unregister_card(card);
|
||||||
atmel_ssc_put_audio(id);
|
atmel_ssc_put_audio(id);
|
||||||
|
|
Loading…
Reference in New Issue