diff options
Diffstat (limited to 'sound/soc/samsung/smdk_wm8580.c')
-rw-r--r-- | sound/soc/samsung/smdk_wm8580.c | 52 |
1 files changed, 11 insertions, 41 deletions
diff --git a/sound/soc/samsung/smdk_wm8580.c b/sound/soc/samsung/smdk_wm8580.c index 3d26f6607aa..81b44782399 100644 --- a/sound/soc/samsung/smdk_wm8580.c +++ b/sound/soc/samsung/smdk_wm8580.c | |||
@@ -10,6 +10,7 @@ | |||
10 | * option) any later version. | 10 | * option) any later version. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/module.h> | ||
13 | #include <sound/soc.h> | 14 | #include <sound/soc.h> |
14 | #include <sound/pcm_params.h> | 15 | #include <sound/pcm_params.h> |
15 | 16 | ||
@@ -119,30 +120,24 @@ static struct snd_soc_ops smdk_ops = { | |||
119 | }; | 120 | }; |
120 | 121 | ||
121 | /* SMDK Playback widgets */ | 122 | /* SMDK Playback widgets */ |
122 | static const struct snd_soc_dapm_widget wm8580_dapm_widgets_pbk[] = { | 123 | static const struct snd_soc_dapm_widget smdk_wm8580_dapm_widgets[] = { |
123 | SND_SOC_DAPM_HP("Front", NULL), | 124 | SND_SOC_DAPM_HP("Front", NULL), |
124 | SND_SOC_DAPM_HP("Center+Sub", NULL), | 125 | SND_SOC_DAPM_HP("Center+Sub", NULL), |
125 | SND_SOC_DAPM_HP("Rear", NULL), | 126 | SND_SOC_DAPM_HP("Rear", NULL), |
126 | }; | ||
127 | 127 | ||
128 | /* SMDK Capture widgets */ | ||
129 | static const struct snd_soc_dapm_widget wm8580_dapm_widgets_cpt[] = { | ||
130 | SND_SOC_DAPM_MIC("MicIn", NULL), | 128 | SND_SOC_DAPM_MIC("MicIn", NULL), |
131 | SND_SOC_DAPM_LINE("LineIn", NULL), | 129 | SND_SOC_DAPM_LINE("LineIn", NULL), |
132 | }; | 130 | }; |
133 | 131 | ||
134 | /* SMDK-PAIFTX connections */ | 132 | /* SMDK-PAIFTX connections */ |
135 | static const struct snd_soc_dapm_route audio_map_tx[] = { | 133 | static const struct snd_soc_dapm_route smdk_wm8580_audio_map[] = { |
136 | /* MicIn feeds AINL */ | 134 | /* MicIn feeds AINL */ |
137 | {"AINL", NULL, "MicIn"}, | 135 | {"AINL", NULL, "MicIn"}, |
138 | 136 | ||
139 | /* LineIn feeds AINL/R */ | 137 | /* LineIn feeds AINL/R */ |
140 | {"AINL", NULL, "LineIn"}, | 138 | {"AINL", NULL, "LineIn"}, |
141 | {"AINR", NULL, "LineIn"}, | 139 | {"AINR", NULL, "LineIn"}, |
142 | }; | ||
143 | 140 | ||
144 | /* SMDK-PAIFRX connections */ | ||
145 | static const struct snd_soc_dapm_route audio_map_rx[] = { | ||
146 | /* Front Left/Right are fed VOUT1L/R */ | 141 | /* Front Left/Right are fed VOUT1L/R */ |
147 | {"Front", NULL, "VOUT1L"}, | 142 | {"Front", NULL, "VOUT1L"}, |
148 | {"Front", NULL, "VOUT1R"}, | 143 | {"Front", NULL, "VOUT1R"}, |
@@ -161,39 +156,11 @@ static int smdk_wm8580_init_paiftx(struct snd_soc_pcm_runtime *rtd) | |||
161 | struct snd_soc_codec *codec = rtd->codec; | 156 | struct snd_soc_codec *codec = rtd->codec; |
162 | struct snd_soc_dapm_context *dapm = &codec->dapm; | 157 | struct snd_soc_dapm_context *dapm = &codec->dapm; |
163 | 158 | ||
164 | /* Add smdk specific Capture widgets */ | ||
165 | snd_soc_dapm_new_controls(dapm, wm8580_dapm_widgets_cpt, | ||
166 | ARRAY_SIZE(wm8580_dapm_widgets_cpt)); | ||
167 | |||
168 | /* Set up PAIFTX audio path */ | ||
169 | snd_soc_dapm_add_routes(dapm, audio_map_tx, ARRAY_SIZE(audio_map_tx)); | ||
170 | |||
171 | /* Enabling the microphone requires the fitting of a 0R | 159 | /* Enabling the microphone requires the fitting of a 0R |
172 | * resistor to connect the line from the microphone jack. | 160 | * resistor to connect the line from the microphone jack. |
173 | */ | 161 | */ |
174 | snd_soc_dapm_disable_pin(dapm, "MicIn"); | 162 | snd_soc_dapm_disable_pin(dapm, "MicIn"); |
175 | 163 | ||
176 | /* signal a DAPM event */ | ||
177 | snd_soc_dapm_sync(dapm); | ||
178 | |||
179 | return 0; | ||
180 | } | ||
181 | |||
182 | static int smdk_wm8580_init_paifrx(struct snd_soc_pcm_runtime *rtd) | ||
183 | { | ||
184 | struct snd_soc_codec *codec = rtd->codec; | ||
185 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
186 | |||
187 | /* Add smdk specific Playback widgets */ | ||
188 | snd_soc_dapm_new_controls(dapm, wm8580_dapm_widgets_pbk, | ||
189 | ARRAY_SIZE(wm8580_dapm_widgets_pbk)); | ||
190 | |||
191 | /* Set up PAIFRX audio path */ | ||
192 | snd_soc_dapm_add_routes(dapm, audio_map_rx, ARRAY_SIZE(audio_map_rx)); | ||
193 | |||
194 | /* signal a DAPM event */ | ||
195 | snd_soc_dapm_sync(dapm); | ||
196 | |||
197 | return 0; | 164 | return 0; |
198 | } | 165 | } |
199 | 166 | ||
@@ -210,8 +177,7 @@ static struct snd_soc_dai_link smdk_dai[] = { | |||
210 | .cpu_dai_name = "samsung-i2s.0", | 177 | .cpu_dai_name = "samsung-i2s.0", |
211 | .codec_dai_name = "wm8580-hifi-playback", | 178 | .codec_dai_name = "wm8580-hifi-playback", |
212 | .platform_name = "samsung-audio", | 179 | .platform_name = "samsung-audio", |
213 | .codec_name = "wm8580-codec.0-001b", | 180 | .codec_name = "wm8580.0-001b", |
214 | .init = smdk_wm8580_init_paifrx, | ||
215 | .ops = &smdk_ops, | 181 | .ops = &smdk_ops, |
216 | }, | 182 | }, |
217 | [PRI_CAPTURE] = { /* Primary Capture i/f */ | 183 | [PRI_CAPTURE] = { /* Primary Capture i/f */ |
@@ -220,7 +186,7 @@ static struct snd_soc_dai_link smdk_dai[] = { | |||
220 | .cpu_dai_name = "samsung-i2s.0", | 186 | .cpu_dai_name = "samsung-i2s.0", |
221 | .codec_dai_name = "wm8580-hifi-capture", | 187 | .codec_dai_name = "wm8580-hifi-capture", |
222 | .platform_name = "samsung-audio", | 188 | .platform_name = "samsung-audio", |
223 | .codec_name = "wm8580-codec.0-001b", | 189 | .codec_name = "wm8580.0-001b", |
224 | .init = smdk_wm8580_init_paiftx, | 190 | .init = smdk_wm8580_init_paiftx, |
225 | .ops = &smdk_ops, | 191 | .ops = &smdk_ops, |
226 | }, | 192 | }, |
@@ -230,8 +196,7 @@ static struct snd_soc_dai_link smdk_dai[] = { | |||
230 | .cpu_dai_name = "samsung-i2s.x", | 196 | .cpu_dai_name = "samsung-i2s.x", |
231 | .codec_dai_name = "wm8580-hifi-playback", | 197 | .codec_dai_name = "wm8580-hifi-playback", |
232 | .platform_name = "samsung-audio", | 198 | .platform_name = "samsung-audio", |
233 | .codec_name = "wm8580-codec.0-001b", | 199 | .codec_name = "wm8580.0-001b", |
234 | .init = smdk_wm8580_init_paifrx, | ||
235 | .ops = &smdk_ops, | 200 | .ops = &smdk_ops, |
236 | }, | 201 | }, |
237 | }; | 202 | }; |
@@ -240,6 +205,11 @@ static struct snd_soc_card smdk = { | |||
240 | .name = "SMDK-I2S", | 205 | .name = "SMDK-I2S", |
241 | .dai_link = smdk_dai, | 206 | .dai_link = smdk_dai, |
242 | .num_links = 2, | 207 | .num_links = 2, |
208 | |||
209 | .dapm_widgets = smdk_wm8580_dapm_widgets, | ||
210 | .num_dapm_widgets = ARRAY_SIZE(smdk_wm8580_dapm_widgets), | ||
211 | .dapm_routes = smdk_wm8580_audio_map, | ||
212 | .num_dapm_routes = ARRAY_SIZE(smdk_wm8580_audio_map), | ||
243 | }; | 213 | }; |
244 | 214 | ||
245 | static struct platform_device *smdk_snd_device; | 215 | static struct platform_device *smdk_snd_device; |