diff options
-rw-r--r-- | sound/soc/fsl/imx-rpmsg.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sound/soc/fsl/imx-rpmsg.c b/sound/soc/fsl/imx-rpmsg.c index c782fb9de042..47aeffa3d15f 100644 --- a/sound/soc/fsl/imx-rpmsg.c +++ b/sound/soc/fsl/imx-rpmsg.c @@ -29,6 +29,13 @@ struct imx_rpmsg_data { struct snd_soc_card card; }; +static const struct snd_soc_dapm_widget imx_wm8960_dapm_widgets[] = { + SND_SOC_DAPM_HP("Headphone Jack", NULL), + SND_SOC_DAPM_SPK("Ext Spk", NULL), + SND_SOC_DAPM_MIC("Mic Jack", NULL), + SND_SOC_DAPM_MIC("Main MIC", NULL), +}; + static int imx_rpmsg_probe(struct platform_device *pdev) { struct device_node *cpu_np; @@ -116,6 +123,17 @@ static int imx_rpmsg_probe(struct platform_device *pdev) if (ret) goto fail; + if (rpmsg_i2s->codec_wm8960) { + ret = snd_soc_of_parse_audio_routing(&data->card, + "audio-routing"); + if (ret) + goto fail; + + data->card.dapm_widgets = imx_wm8960_dapm_widgets; + data->card.num_dapm_widgets = + ARRAY_SIZE(imx_wm8960_dapm_widgets); + } + platform_set_drvdata(pdev, &data->card); snd_soc_card_set_drvdata(&data->card, data); ret = devm_snd_soc_register_card(&pdev->dev, &data->card); |