aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/fsl
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2012-03-29 12:13:03 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-01 06:28:31 -0400
commit172b4c5c8afdb7471d9b03fc96a6b6455a49e19d (patch)
tree008a4ea4830412bb6197d3250338eb4a79fcb743 /sound/soc/fsl
parentaa0e25caafb7950e839db930649a65e8b7f70e1a (diff)
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')
-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)
45 return 0; 45 return 0;
46} 46}
47 47
48static const struct snd_soc_dapm_widget imx_sgtl5000_dapm_widgets[] = {
49 SND_SOC_DAPM_MIC("Mic Jack", NULL),
50 SND_SOC_DAPM_LINE("Line In Jack", NULL),
51 SND_SOC_DAPM_HP("Headphone Jack", NULL),
52 SND_SOC_DAPM_SPK("Line Out Jack", NULL),
53 SND_SOC_DAPM_SPK("Ext Spk", NULL),
54};
55
48static int __devinit imx_sgtl5000_probe(struct platform_device *pdev) 56static int __devinit imx_sgtl5000_probe(struct platform_device *pdev)
49{ 57{
50 struct device_node *np = pdev->dev.of_node; 58 struct device_node *np = pdev->dev.of_node;
@@ -129,8 +137,13 @@ static int __devinit imx_sgtl5000_probe(struct platform_device *pdev)
129 ret = snd_soc_of_parse_card_name(&data->card, "model"); 137 ret = snd_soc_of_parse_card_name(&data->card, "model");
130 if (ret) 138 if (ret)
131 return ret; 139 return ret;
140 ret = snd_soc_of_parse_audio_routing(&data->card, "audio-routing");
141 if (ret)
142 return ret;
132 data->card.num_links = 1; 143 data->card.num_links = 1;
133 data->card.dai_link = &data->dai; 144 data->card.dai_link = &data->dai;
145 data->card.dapm_widgets = imx_sgtl5000_dapm_widgets;
146 data->card.num_dapm_widgets = ARRAY_SIZE(imx_sgtl5000_dapm_widgets);
134 147
135 ret = snd_soc_register_card(&data->card); 148 ret = snd_soc_register_card(&data->card);
136 if (ret) { 149 if (ret) {