1
0
Fork 0

MLK-18691: ASoC: imx-xtor: don't add ASRC audio routes if node is missing

ASRC audio routes introduce aditional log noise if ASRC
OF node is missing in DTS, so add them if ASRC node is present only.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
pull/10/head
Viorel Suman 2018-02-23 14:13:20 +02:00 committed by Jason Liu
parent b8e022fb03
commit 4911bb5938
1 changed files with 6 additions and 7 deletions

View File

@ -148,14 +148,12 @@ static int be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
}
static const struct snd_soc_dapm_route audio_map[] = {
/* Line out jack */
{"CPU-Playback", NULL, "ASRC-Playback"},
{"Playback", NULL, "CPU-Playback"},/* dai route for be and fe */
{"ASRC-Capture", NULL, "CPU-Capture"},
{"Playback", NULL, "CPU-Playback"},
{"CPU-Capture", NULL, "Capture"},
{"CPU-Playback", NULL, "ASRC-Playback"},
{"ASRC-Capture", NULL, "CPU-Capture"},
};
static struct snd_soc_ops imx_xtor_ops = {
.startup = imx_xtor_startup,
.shutdown = imx_xtor_shutdown,
@ -224,6 +222,8 @@ static int imx_xtor_probe(struct platform_device *pdev)
data->dai[0].capture_only = false;
data->card.num_links = 1;
data->card.dai_link = data->dai;
data->card.dapm_routes = audio_map;
data->card.num_dapm_routes = 2;
/*if there is no asrc controller, we only enable one device*/
if (asrc_pdev) {
@ -250,6 +250,7 @@ static int imx_xtor_probe(struct platform_device *pdev)
data->dai[2].be_hw_params_fixup = be_hw_params_fixup,
data->card.num_links = 3;
data->card.dai_link = &data->dai[0];
data->card.num_dapm_routes += 2;
ret = of_property_read_u32(asrc_np, "fsl,asrc-rate",
&data->asrc_rate);
@ -272,8 +273,6 @@ static int imx_xtor_probe(struct platform_device *pdev)
data->asrc_format = SNDRV_PCM_FORMAT_S16_LE;
}
data->card.dapm_routes = audio_map,
data->card.num_dapm_routes = ARRAY_SIZE(audio_map),
data->card.dev = &pdev->dev;
data->card.owner = THIS_MODULE;
ret = snd_soc_of_parse_card_name(&data->card, "model");