diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-03 11:41:45 (GMT) |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-03 21:35:12 (GMT) |
commit | b6709f3bbd7550fd4a10943513df72e7fa41c962 (patch) | |
tree | c472f3c3819454fbce7fddf25a37f847bb34289b | |
parent | b4505ab141a72f65bf7bb1f7c120411ab129181a (diff) | |
download | linux-fsl-qoriq-b6709f3bbd7550fd4a10943513df72e7fa41c962.tar.xz |
ASoC: Convert WM8510 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-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 00f8dfa..9166126 100644 --- a/sound/soc/codecs/wm8510.c +++ b/sound/soc/codecs/wm8510.c @@ -181,7 +181,7 @@ SND_SOC_DAPM_OUTPUT("SPKOUTP"), SND_SOC_DAPM_OUTPUT("SPKOUTN"), }; -static const struct snd_soc_dapm_route audio_map[] = { +static const struct snd_soc_dapm_route wm8510_dapm_routes[] = { /* Mono output mixer */ {"Mono Mixer", "PCM Playback Switch", "DAC"}, {"Mono Mixer", "Aux Playback Switch", "Aux Input"}, @@ -213,17 +213,6 @@ static const struct snd_soc_dapm_route audio_map[] = { {"ADC", NULL, "Boost Mixer"}, }; -static int wm8510_add_widgets(struct snd_soc_codec *codec) -{ - struct snd_soc_dapm_context *dapm = &codec->dapm; - - snd_soc_dapm_new_controls(dapm, wm8510_dapm_widgets, - ARRAY_SIZE(wm8510_dapm_widgets)); - snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); - - return 0; -} - struct pll_ { unsigned int pre_div:4; /* prescale - 1 */ unsigned int n:4; @@ -561,9 +550,6 @@ static int wm8510_probe(struct snd_soc_codec *codec) /* power on device */ wm8510_set_bias_level(codec, SND_SOC_BIAS_STANDBY); - snd_soc_add_controls(codec, wm8510_snd_controls, - ARRAY_SIZE(wm8510_snd_controls)); - wm8510_add_widgets(codec); return ret; } @@ -587,6 +573,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8510 = { .reg_cache_size = ARRAY_SIZE(wm8510_reg), .reg_word_size = sizeof(u16), .reg_cache_default =wm8510_reg, + + .controls = wm8510_snd_controls, + .num_controls = ARRAY_SIZE(wm8510_snd_controls), + .dapm_widgets = wm8510_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(wm8510_dapm_widgets), + .dapm_routes = wm8510_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(wm8510_dapm_routes), }; static const struct of_device_id wm8510_of_match[] = { |