diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-29 06:10:27 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-01-20 08:58:21 -0500 |
commit | a2bd691c64383ab290732d771a7404e26c0b9d53 (patch) | |
tree | 4c00d8745a02941ab00f4ca7d4e46136e4139302 /sound/soc/codecs/wm8974.c | |
parent | 7a389651bd88f884b46ddcada78730d294ccf1eb (diff) |
ASoC: Convert wm8974 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8974.c')
-rw-r--r-- | sound/soc/codecs/wm8974.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/sound/soc/codecs/wm8974.c b/sound/soc/codecs/wm8974.c index 80c264e3ef87..1e7a87a56168 100644 --- a/sound/soc/codecs/wm8974.c +++ b/sound/soc/codecs/wm8974.c | |||
@@ -235,7 +235,7 @@ SND_SOC_DAPM_OUTPUT("SPKOUTP"), | |||
235 | SND_SOC_DAPM_OUTPUT("SPKOUTN"), | 235 | SND_SOC_DAPM_OUTPUT("SPKOUTN"), |
236 | }; | 236 | }; |
237 | 237 | ||
238 | static const struct snd_soc_dapm_route audio_map[] = { | 238 | static const struct snd_soc_dapm_route wm8974_dapm_routes[] = { |
239 | /* Mono output mixer */ | 239 | /* Mono output mixer */ |
240 | {"Mono Mixer", "PCM Playback Switch", "DAC"}, | 240 | {"Mono Mixer", "PCM Playback Switch", "DAC"}, |
241 | {"Mono Mixer", "Aux Playback Switch", "Aux Input"}, | 241 | {"Mono Mixer", "Aux Playback Switch", "Aux Input"}, |
@@ -269,17 +269,6 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
269 | {"Aux Input", NULL, "AUX"}, | 269 | {"Aux Input", NULL, "AUX"}, |
270 | }; | 270 | }; |
271 | 271 | ||
272 | static int wm8974_add_widgets(struct snd_soc_codec *codec) | ||
273 | { | ||
274 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
275 | |||
276 | snd_soc_dapm_new_controls(dapm, wm8974_dapm_widgets, | ||
277 | ARRAY_SIZE(wm8974_dapm_widgets)); | ||
278 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
279 | |||
280 | return 0; | ||
281 | } | ||
282 | |||
283 | struct pll_ { | 272 | struct pll_ { |
284 | unsigned int pre_div:1; | 273 | unsigned int pre_div:1; |
285 | unsigned int n:4; | 274 | unsigned int n:4; |
@@ -611,9 +600,6 @@ static int wm8974_probe(struct snd_soc_codec *codec) | |||
611 | } | 600 | } |
612 | 601 | ||
613 | wm8974_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 602 | wm8974_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
614 | snd_soc_add_controls(codec, wm8974_snd_controls, | ||
615 | ARRAY_SIZE(wm8974_snd_controls)); | ||
616 | wm8974_add_widgets(codec); | ||
617 | 603 | ||
618 | return ret; | 604 | return ret; |
619 | } | 605 | } |
@@ -634,6 +620,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8974 = { | |||
634 | .reg_cache_size = ARRAY_SIZE(wm8974_reg), | 620 | .reg_cache_size = ARRAY_SIZE(wm8974_reg), |
635 | .reg_word_size = sizeof(u16), | 621 | .reg_word_size = sizeof(u16), |
636 | .reg_cache_default = wm8974_reg, | 622 | .reg_cache_default = wm8974_reg, |
623 | |||
624 | .controls = wm8974_snd_controls, | ||
625 | .num_controls = ARRAY_SIZE(wm8974_snd_controls), | ||
626 | .dapm_widgets = wm8974_dapm_widgets, | ||
627 | .num_dapm_widgets = ARRAY_SIZE(wm8974_dapm_widgets), | ||
628 | .dapm_routes = wm8974_dapm_routes, | ||
629 | .num_dapm_routes = ARRAY_SIZE(wm8974_dapm_routes), | ||
637 | }; | 630 | }; |
638 | 631 | ||
639 | static __devinit int wm8974_i2c_probe(struct i2c_client *i2c, | 632 | static __devinit int wm8974_i2c_probe(struct i2c_client *i2c, |