diff options
-rw-r--r-- | Documentation/devicetree/bindings/sound/imx-audio-sgtl5000.txt | 25 | ||||
-rw-r--r-- | sound/soc/fsl/imx-sgtl5000.c | 13 |
2 files changed, 38 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/sound/imx-audio-sgtl5000.txt b/Documentation/devicetree/bindings/sound/imx-audio-sgtl5000.txt index 421a374790b3..d09b4e31461c 100644 --- a/Documentation/devicetree/bindings/sound/imx-audio-sgtl5000.txt +++ b/Documentation/devicetree/bindings/sound/imx-audio-sgtl5000.txt | |||
@@ -5,6 +5,27 @@ Required properties: | |||
5 | - model : The user-visible name of this sound complex | 5 | - model : The user-visible name of this sound complex |
6 | - ssi-controller : The phandle of the i.MX SSI controller | 6 | - ssi-controller : The phandle of the i.MX SSI controller |
7 | - audio-codec : The phandle of the SGTL5000 audio codec | 7 | - audio-codec : The phandle of the SGTL5000 audio codec |
8 | - audio-routing : A list of the connections between audio components. | ||
9 | Each entry is a pair of strings, the first being the connection's sink, | ||
10 | the second being the connection's source. Valid names could be power | ||
11 | supplies, SGTL5000 pins, and the jacks on the board: | ||
12 | |||
13 | Power supplies: | ||
14 | * Mic Bias | ||
15 | |||
16 | SGTL5000 pins: | ||
17 | * MIC_IN | ||
18 | * LINE_IN | ||
19 | * HP_OUT | ||
20 | * LINE_OUT | ||
21 | |||
22 | Board connectors: | ||
23 | * Mic Jack | ||
24 | * Line In Jack | ||
25 | * Headphone Jack | ||
26 | * Line Out Jack | ||
27 | * Ext Spk | ||
28 | |||
8 | - mux-int-port : The internal port of the i.MX audio muxer (AUDMUX) | 29 | - mux-int-port : The internal port of the i.MX audio muxer (AUDMUX) |
9 | - mux-ext-port : The external port of the i.MX audio muxer | 30 | - mux-ext-port : The external port of the i.MX audio muxer |
10 | 31 | ||
@@ -19,6 +40,10 @@ sound { | |||
19 | model = "imx51-babbage-sgtl5000"; | 40 | model = "imx51-babbage-sgtl5000"; |
20 | ssi-controller = <&ssi1>; | 41 | ssi-controller = <&ssi1>; |
21 | audio-codec = <&sgtl5000>; | 42 | audio-codec = <&sgtl5000>; |
43 | audio-routing = | ||
44 | "Mic Jack", "Mic Bias", | ||
45 | "MIC_IN", "Mic Bias", | ||
46 | "Headphone Jack", "HP_OUT"; | ||
22 | mux-int-port = <1>; | 47 | mux-int-port = <1>; |
23 | mux-ext-port = <3>; | 48 | mux-ext-port = <3>; |
24 | }; | 49 | }; |
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 | ||
48 | static 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 | |||
48 | static int __devinit imx_sgtl5000_probe(struct platform_device *pdev) | 56 | static 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) { |