diff options
author | Lu Guanqun <guanqun.lu@intel.com> | 2011-03-30 09:53:11 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-03-30 17:21:52 -0400 |
commit | 7ad7dd125ae936719205672565ef48df018731c4 (patch) | |
tree | df6e9603aa8c0ae89e503975dfdda7d9cb0fa102 /sound/soc/codecs/wm9713.c | |
parent | dc6fc49b141ed14256e1319ccb9797e9825f1734 (diff) |
ASoC: Use data based init for wm9713 DAPM
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm9713.c')
-rw-r--r-- | sound/soc/codecs/wm9713.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c index 38ed98558718..7167cb6787db 100644 --- a/sound/soc/codecs/wm9713.c +++ b/sound/soc/codecs/wm9713.c | |||
@@ -487,7 +487,7 @@ SND_SOC_DAPM_INPUT("MIC2B"), | |||
487 | SND_SOC_DAPM_VMID("VMID"), | 487 | SND_SOC_DAPM_VMID("VMID"), |
488 | }; | 488 | }; |
489 | 489 | ||
490 | static const struct snd_soc_dapm_route audio_map[] = { | 490 | static const struct snd_soc_dapm_route wm9713_audio_map[] = { |
491 | /* left HP mixer */ | 491 | /* left HP mixer */ |
492 | {"Left HP Mixer", "Beep Playback Switch", "PCBEEP"}, | 492 | {"Left HP Mixer", "Beep Playback Switch", "PCBEEP"}, |
493 | {"Left HP Mixer", "Voice Playback Switch", "Voice DAC"}, | 493 | {"Left HP Mixer", "Voice Playback Switch", "Voice DAC"}, |
@@ -644,18 +644,6 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
644 | {"Capture Mono Mux", "Right", "Right Capture Source"}, | 644 | {"Capture Mono Mux", "Right", "Right Capture Source"}, |
645 | }; | 645 | }; |
646 | 646 | ||
647 | static int wm9713_add_widgets(struct snd_soc_codec *codec) | ||
648 | { | ||
649 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
650 | |||
651 | snd_soc_dapm_new_controls(dapm, wm9713_dapm_widgets, | ||
652 | ARRAY_SIZE(wm9713_dapm_widgets)); | ||
653 | |||
654 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
655 | |||
656 | return 0; | ||
657 | } | ||
658 | |||
659 | static unsigned int ac97_read(struct snd_soc_codec *codec, | 647 | static unsigned int ac97_read(struct snd_soc_codec *codec, |
660 | unsigned int reg) | 648 | unsigned int reg) |
661 | { | 649 | { |
@@ -1231,7 +1219,6 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec) | |||
1231 | 1219 | ||
1232 | snd_soc_add_controls(codec, wm9713_snd_ac97_controls, | 1220 | snd_soc_add_controls(codec, wm9713_snd_ac97_controls, |
1233 | ARRAY_SIZE(wm9713_snd_ac97_controls)); | 1221 | ARRAY_SIZE(wm9713_snd_ac97_controls)); |
1234 | wm9713_add_widgets(codec); | ||
1235 | 1222 | ||
1236 | return 0; | 1223 | return 0; |
1237 | 1224 | ||
@@ -1262,6 +1249,10 @@ static struct snd_soc_codec_driver soc_codec_dev_wm9713 = { | |||
1262 | .reg_word_size = sizeof(u16), | 1249 | .reg_word_size = sizeof(u16), |
1263 | .reg_cache_step = 2, | 1250 | .reg_cache_step = 2, |
1264 | .reg_cache_default = wm9713_reg, | 1251 | .reg_cache_default = wm9713_reg, |
1252 | .dapm_widgets = wm9713_dapm_widgets, | ||
1253 | .num_dapm_widgets = ARRAY_SIZE(wm9713_dapm_widgets), | ||
1254 | .dapm_routes = wm9713_audio_map, | ||
1255 | .num_dapm_routes = ARRAY_SIZE(wm9713_audio_map), | ||
1265 | }; | 1256 | }; |
1266 | 1257 | ||
1267 | static __devinit int wm9713_probe(struct platform_device *pdev) | 1258 | static __devinit int wm9713_probe(struct platform_device *pdev) |