diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-03 06:41:45 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-03 16:35:12 -0500 |
commit | b6709f3bbd7550fd4a10943513df72e7fa41c962 (patch) | |
tree | c472f3c3819454fbce7fddf25a37f847bb34289b /sound/soc/codecs/wm8510.c | |
parent | b4505ab141a72f65bf7bb1f7c120411ab129181a (diff) |
ASoC: Convert WM8510 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8510.c')
-rw-r--r-- | sound/soc/codecs/wm8510.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/sound/soc/codecs/wm8510.c b/sound/soc/codecs/wm8510.c index 00f8dfa14b1c..9166126bd312 100644 --- a/sound/soc/codecs/wm8510.c +++ b/sound/soc/codecs/wm8510.c | |||
@@ -181,7 +181,7 @@ SND_SOC_DAPM_OUTPUT("SPKOUTP"), | |||
181 | SND_SOC_DAPM_OUTPUT("SPKOUTN"), | 181 | SND_SOC_DAPM_OUTPUT("SPKOUTN"), |
182 | }; | 182 | }; |
183 | 183 | ||
184 | static const struct snd_soc_dapm_route audio_map[] = { | 184 | static const struct snd_soc_dapm_route wm8510_dapm_routes[] = { |
185 | /* Mono output mixer */ | 185 | /* Mono output mixer */ |
186 | {"Mono Mixer", "PCM Playback Switch", "DAC"}, | 186 | {"Mono Mixer", "PCM Playback Switch", "DAC"}, |
187 | {"Mono Mixer", "Aux Playback Switch", "Aux Input"}, | 187 | {"Mono Mixer", "Aux Playback Switch", "Aux Input"}, |
@@ -213,17 +213,6 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
213 | {"ADC", NULL, "Boost Mixer"}, | 213 | {"ADC", NULL, "Boost Mixer"}, |
214 | }; | 214 | }; |
215 | 215 | ||
216 | static int wm8510_add_widgets(struct snd_soc_codec *codec) | ||
217 | { | ||
218 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
219 | |||
220 | snd_soc_dapm_new_controls(dapm, wm8510_dapm_widgets, | ||
221 | ARRAY_SIZE(wm8510_dapm_widgets)); | ||
222 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
223 | |||
224 | return 0; | ||
225 | } | ||
226 | |||
227 | struct pll_ { | 216 | struct pll_ { |
228 | unsigned int pre_div:4; /* prescale - 1 */ | 217 | unsigned int pre_div:4; /* prescale - 1 */ |
229 | unsigned int n:4; | 218 | unsigned int n:4; |
@@ -561,9 +550,6 @@ static int wm8510_probe(struct snd_soc_codec *codec) | |||
561 | 550 | ||
562 | /* power on device */ | 551 | /* power on device */ |
563 | wm8510_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 552 | wm8510_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
564 | snd_soc_add_controls(codec, wm8510_snd_controls, | ||
565 | ARRAY_SIZE(wm8510_snd_controls)); | ||
566 | wm8510_add_widgets(codec); | ||
567 | 553 | ||
568 | return ret; | 554 | return ret; |
569 | } | 555 | } |
@@ -587,6 +573,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8510 = { | |||
587 | .reg_cache_size = ARRAY_SIZE(wm8510_reg), | 573 | .reg_cache_size = ARRAY_SIZE(wm8510_reg), |
588 | .reg_word_size = sizeof(u16), | 574 | .reg_word_size = sizeof(u16), |
589 | .reg_cache_default =wm8510_reg, | 575 | .reg_cache_default =wm8510_reg, |
576 | |||
577 | .controls = wm8510_snd_controls, | ||
578 | .num_controls = ARRAY_SIZE(wm8510_snd_controls), | ||
579 | .dapm_widgets = wm8510_dapm_widgets, | ||
580 | .num_dapm_widgets = ARRAY_SIZE(wm8510_dapm_widgets), | ||
581 | .dapm_routes = wm8510_dapm_routes, | ||
582 | .num_dapm_routes = ARRAY_SIZE(wm8510_dapm_routes), | ||
590 | }; | 583 | }; |
591 | 584 | ||
592 | static const struct of_device_id wm8510_of_match[] = { | 585 | static const struct of_device_id wm8510_of_match[] = { |