diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-03 06:42:01 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-03 16:35:13 -0500 |
commit | f235c649c1301ae85d5c7e51e88b13adb30ed6a8 (patch) | |
tree | f1cc772b6a7002cb3c97f9da7aea9d3400b207e9 /sound/soc/codecs/wm8580.c | |
parent | b6709f3bbd7550fd4a10943513df72e7fa41c962 (diff) |
ASoC: Convert WM8580 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8580.c')
-rw-r--r-- | sound/soc/codecs/wm8580.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c index 764b2bf80a71..b1c8d3de08b2 100644 --- a/sound/soc/codecs/wm8580.c +++ b/sound/soc/codecs/wm8580.c | |||
@@ -272,7 +272,7 @@ SND_SOC_DAPM_INPUT("AINL"), | |||
272 | SND_SOC_DAPM_INPUT("AINR"), | 272 | SND_SOC_DAPM_INPUT("AINR"), |
273 | }; | 273 | }; |
274 | 274 | ||
275 | static const struct snd_soc_dapm_route audio_map[] = { | 275 | static const struct snd_soc_dapm_route wm8580_dapm_routes[] = { |
276 | { "VOUT1L", NULL, "DAC1" }, | 276 | { "VOUT1L", NULL, "DAC1" }, |
277 | { "VOUT1R", NULL, "DAC1" }, | 277 | { "VOUT1R", NULL, "DAC1" }, |
278 | 278 | ||
@@ -286,17 +286,6 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
286 | { "ADC", NULL, "AINR" }, | 286 | { "ADC", NULL, "AINR" }, |
287 | }; | 287 | }; |
288 | 288 | ||
289 | static int wm8580_add_widgets(struct snd_soc_codec *codec) | ||
290 | { | ||
291 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
292 | |||
293 | snd_soc_dapm_new_controls(dapm, wm8580_dapm_widgets, | ||
294 | ARRAY_SIZE(wm8580_dapm_widgets)); | ||
295 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
296 | |||
297 | return 0; | ||
298 | } | ||
299 | |||
300 | /* PLL divisors */ | 289 | /* PLL divisors */ |
301 | struct _pll_div { | 290 | struct _pll_div { |
302 | u32 prescale:1; | 291 | u32 prescale:1; |
@@ -856,10 +845,6 @@ static int wm8580_probe(struct snd_soc_codec *codec) | |||
856 | 845 | ||
857 | wm8580_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 846 | wm8580_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
858 | 847 | ||
859 | snd_soc_add_controls(codec, wm8580_snd_controls, | ||
860 | ARRAY_SIZE(wm8580_snd_controls)); | ||
861 | wm8580_add_widgets(codec); | ||
862 | |||
863 | return 0; | 848 | return 0; |
864 | 849 | ||
865 | err_regulator_enable: | 850 | err_regulator_enable: |
@@ -889,6 +874,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8580 = { | |||
889 | .reg_cache_size = ARRAY_SIZE(wm8580_reg), | 874 | .reg_cache_size = ARRAY_SIZE(wm8580_reg), |
890 | .reg_word_size = sizeof(u16), | 875 | .reg_word_size = sizeof(u16), |
891 | .reg_cache_default = wm8580_reg, | 876 | .reg_cache_default = wm8580_reg, |
877 | |||
878 | .controls = wm8580_snd_controls, | ||
879 | .num_controls = ARRAY_SIZE(wm8580_snd_controls), | ||
880 | .dapm_widgets = wm8580_dapm_widgets, | ||
881 | .num_dapm_widgets = ARRAY_SIZE(wm8580_dapm_widgets), | ||
882 | .dapm_routes = wm8580_dapm_routes, | ||
883 | .num_dapm_routes = ARRAY_SIZE(wm8580_dapm_routes), | ||
892 | }; | 884 | }; |
893 | 885 | ||
894 | static const struct of_device_id wm8580_of_match[] = { | 886 | static const struct of_device_id wm8580_of_match[] = { |