aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/pxa/poodle.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-12-29 20:19:32 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-29 21:00:22 -0500
commitfe366d067409d7633ca1186b533289828e5f4161 (patch)
tree0b26352aef174f11bb44138cd18998d2aa50e192 /sound/soc/pxa/poodle.c
parent2445ecc3c036ae5f1cc0c3dfed4731d9519a3811 (diff)
ASoC: Convert poodle to table based DAPM and control init
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/pxa/poodle.c')
-rw-r--r--sound/soc/pxa/poodle.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/sound/soc/pxa/poodle.c b/sound/soc/pxa/poodle.c
index c9e24bf51763..a321b4df534c 100644
--- a/sound/soc/pxa/poodle.c
+++ b/sound/soc/pxa/poodle.c
@@ -214,7 +214,7 @@ SND_SOC_DAPM_SPK("Ext Spk", poodle_amp_event),
214}; 214};
215 215
216/* Corgi machine connections to the codec pins */ 216/* Corgi machine connections to the codec pins */
217static const struct snd_soc_dapm_route audio_map[] = { 217static const struct snd_soc_dapm_route poodle_audio_map[] = {
218 218
219 /* headphone connected to LHPOUT1, RHPOUT1 */ 219 /* headphone connected to LHPOUT1, RHPOUT1 */
220 {"Headphone Jack", NULL, "LHPOUT"}, 220 {"Headphone Jack", NULL, "LHPOUT"},
@@ -246,25 +246,11 @@ static int poodle_wm8731_init(struct snd_soc_pcm_runtime *rtd)
246{ 246{
247 struct snd_soc_codec *codec = rtd->codec; 247 struct snd_soc_codec *codec = rtd->codec;
248 struct snd_soc_dapm_context *dapm = &codec->dapm; 248 struct snd_soc_dapm_context *dapm = &codec->dapm;
249 int err;
250 249
251 snd_soc_dapm_nc_pin(dapm, "LLINEIN"); 250 snd_soc_dapm_nc_pin(dapm, "LLINEIN");
252 snd_soc_dapm_nc_pin(dapm, "RLINEIN"); 251 snd_soc_dapm_nc_pin(dapm, "RLINEIN");
253 snd_soc_dapm_enable_pin(dapm, "MICIN"); 252 snd_soc_dapm_enable_pin(dapm, "MICIN");
254 253
255 /* Add poodle specific controls */
256 err = snd_soc_add_controls(codec, wm8731_poodle_controls,
257 ARRAY_SIZE(wm8731_poodle_controls));
258 if (err < 0)
259 return err;
260
261 /* Add poodle specific widgets */
262 snd_soc_dapm_new_controls(dapm, wm8731_dapm_widgets,
263 ARRAY_SIZE(wm8731_dapm_widgets));
264
265 /* Set up poodle specific audio path audio_map */
266 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
267
268 return 0; 254 return 0;
269} 255}
270 256
@@ -286,6 +272,13 @@ static struct snd_soc_card poodle = {
286 .dai_link = &poodle_dai, 272 .dai_link = &poodle_dai,
287 .num_links = 1, 273 .num_links = 1,
288 .owner = THIS_MODULE, 274 .owner = THIS_MODULE,
275
276 .controls = wm8731_poodle_controls,
277 .num_controls = ARRAY_SIZE(wm8731_poodle_controls),
278 .dapm_widgets = wm8731_dapm_widgets,
279 .num_dapm_widgets = ARRAY_SIZE(wm8731_dapm_widgets),
280 .dapm_routes = poodle_audio_map,
281 .num_dapm_routes = ARRAY_SIZE(poodle_audio_map),
289}; 282};
290 283
291static int __devinit poodle_probe(struct platform_device *pdev) 284static int __devinit poodle_probe(struct platform_device *pdev)