aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8971.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-29 06:03:08 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-01-20 08:58:21 -0500
commitc4850644ceaeb4fb6be3bd3305afc995a0f46a6c (patch)
treea6a510c3174cd86eb6b199e56a6aa63aa52956c0 /sound/soc/codecs/wm8971.c
parent542cc361de509798b311999ada07ebf2bd5673cf (diff)
ASoC: Convert wm8971 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8971.c')
-rw-r--r--sound/soc/codecs/wm8971.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/sound/soc/codecs/wm8971.c b/sound/soc/codecs/wm8971.c
index a1db1509dcf2..3a5d67c59a2d 100644
--- a/sound/soc/codecs/wm8971.c
+++ b/sound/soc/codecs/wm8971.c
@@ -252,7 +252,7 @@ static const struct snd_soc_dapm_widget wm8971_dapm_widgets[] = {
252 SND_SOC_DAPM_INPUT("MIC"), 252 SND_SOC_DAPM_INPUT("MIC"),
253}; 253};
254 254
255static const struct snd_soc_dapm_route audio_map[] = { 255static const struct snd_soc_dapm_route wm8971_dapm_routes[] = {
256 /* left mixer */ 256 /* left mixer */
257 {"Left Mixer", "Playback Switch", "Left DAC"}, 257 {"Left Mixer", "Playback Switch", "Left DAC"},
258 {"Left Mixer", "Left Bypass Switch", "Left Line Mux"}, 258 {"Left Mixer", "Left Bypass Switch", "Left Line Mux"},
@@ -329,17 +329,6 @@ static const struct snd_soc_dapm_route audio_map[] = {
329 {"Right ADC", NULL, "Right ADC Mux"}, 329 {"Right ADC", NULL, "Right ADC Mux"},
330}; 330};
331 331
332static int wm8971_add_widgets(struct snd_soc_codec *codec)
333{
334 struct snd_soc_dapm_context *dapm = &codec->dapm;
335
336 snd_soc_dapm_new_controls(dapm, wm8971_dapm_widgets,
337 ARRAY_SIZE(wm8971_dapm_widgets));
338 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
339
340 return 0;
341}
342
343struct _coeff_div { 332struct _coeff_div {
344 u32 mclk; 333 u32 mclk;
345 u32 rate; 334 u32 rate;
@@ -659,10 +648,6 @@ static int wm8971_probe(struct snd_soc_codec *codec)
659 snd_soc_update_bits(codec, WM8971_LINVOL, 0x0100, 0x0100); 648 snd_soc_update_bits(codec, WM8971_LINVOL, 0x0100, 0x0100);
660 snd_soc_update_bits(codec, WM8971_RINVOL, 0x0100, 0x0100); 649 snd_soc_update_bits(codec, WM8971_RINVOL, 0x0100, 0x0100);
661 650
662 snd_soc_add_controls(codec, wm8971_snd_controls,
663 ARRAY_SIZE(wm8971_snd_controls));
664 wm8971_add_widgets(codec);
665
666 return ret; 651 return ret;
667} 652}
668 653
@@ -686,6 +671,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8971 = {
686 .reg_cache_size = ARRAY_SIZE(wm8971_reg), 671 .reg_cache_size = ARRAY_SIZE(wm8971_reg),
687 .reg_word_size = sizeof(u16), 672 .reg_word_size = sizeof(u16),
688 .reg_cache_default = wm8971_reg, 673 .reg_cache_default = wm8971_reg,
674
675 .controls = wm8971_snd_controls,
676 .num_controls = ARRAY_SIZE(wm8971_snd_controls),
677 .dapm_widgets = wm8971_dapm_widgets,
678 .num_dapm_widgets = ARRAY_SIZE(wm8971_dapm_widgets),
679 .dapm_routes = wm8971_dapm_routes,
680 .num_dapm_routes = ARRAY_SIZE(wm8971_dapm_routes),
689}; 681};
690 682
691static __devinit int wm8971_i2c_probe(struct i2c_client *i2c, 683static __devinit int wm8971_i2c_probe(struct i2c_client *i2c,