summaryrefslogtreecommitdiffstats
path: root/sound/soc/fsl/imx-sgtl5000.c
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2012-03-30 00:13:03 +0800
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-01 11:28:31 +0100
commit172b4c5c8afdb7471d9b03fc96a6b6455a49e19d (patch)
tree008a4ea4830412bb6197d3250338eb4a79fcb743 /sound/soc/fsl/imx-sgtl5000.c
parentaa0e25caafb7950e839db930649a65e8b7f70e1a (diff)
downloadlinux-172b4c5c8afdb7471d9b03fc96a6b6455a49e19d.tar.gz
linux-172b4c5c8afdb7471d9b03fc96a6b6455a49e19d.tar.bz2
linux-172b4c5c8afdb7471d9b03fc96a6b6455a49e19d.zip
ASoC: fsl: add audio routing for imx-sgtl5000
Add DAPM widgets and audio routing support for imx-sgtl5000 machine driver. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/fsl/imx-sgtl5000.c')
-rw-r--r--sound/soc/fsl/imx-sgtl5000.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c
index 3786b61b4fea..e1a7441ec133 100644
--- a/sound/soc/fsl/imx-sgtl5000.c
+++ b/sound/soc/fsl/imx-sgtl5000.c
@@ -45,6 +45,14 @@ static int imx_sgtl5000_dai_init(struct snd_soc_pcm_runtime *rtd)
return 0;
}
+static const struct snd_soc_dapm_widget imx_sgtl5000_dapm_widgets[] = {
+ SND_SOC_DAPM_MIC("Mic Jack", NULL),
+ SND_SOC_DAPM_LINE("Line In Jack", NULL),
+ SND_SOC_DAPM_HP("Headphone Jack", NULL),
+ SND_SOC_DAPM_SPK("Line Out Jack", NULL),
+ SND_SOC_DAPM_SPK("Ext Spk", NULL),
+};
+
static int __devinit imx_sgtl5000_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
@@ -129,8 +137,13 @@ static int __devinit imx_sgtl5000_probe(struct platform_device *pdev)
ret = snd_soc_of_parse_card_name(&data->card, "model");
if (ret)
return ret;
+ ret = snd_soc_of_parse_audio_routing(&data->card, "audio-routing");
+ if (ret)
+ return ret;
data->card.num_links = 1;
data->card.dai_link = &data->dai;
+ data->card.dapm_widgets = imx_sgtl5000_dapm_widgets;
+ data->card.num_dapm_widgets = ARRAY_SIZE(imx_sgtl5000_dapm_widgets);
ret = snd_soc_register_card(&data->card);
if (ret) {