aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8978.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-29 06:15:43 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-01-20 08:58:19 -0500
commit803b37885d355438192516d73ba3565e744a8b90 (patch)
tree2c0557ccd5479f63a17cacb6879a89045e6d110d /sound/soc/codecs/wm8978.c
parentad6cdec507d877189c9813655dfa30579256a2fc (diff)
ASoC: Convert wm8978 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8978.c')
-rw-r--r--sound/soc/codecs/wm8978.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/sound/soc/codecs/wm8978.c b/sound/soc/codecs/wm8978.c
index 2ba8f8c88ba6..36468f85f301 100644
--- a/sound/soc/codecs/wm8978.c
+++ b/sound/soc/codecs/wm8978.c
@@ -302,7 +302,7 @@ static const struct snd_soc_dapm_widget wm8978_dapm_widgets[] = {
302 SND_SOC_DAPM_OUTPUT("RSPK"), 302 SND_SOC_DAPM_OUTPUT("RSPK"),
303}; 303};
304 304
305static const struct snd_soc_dapm_route audio_map[] = { 305static const struct snd_soc_dapm_route wm8978_dapm_routes[] = {
306 /* Output mixer */ 306 /* Output mixer */
307 {"Right Output Mixer", "PCM Playback Switch", "Right DAC"}, 307 {"Right Output Mixer", "PCM Playback Switch", "Right DAC"},
308 {"Right Output Mixer", "Aux Playback Switch", "RAUX"}, 308 {"Right Output Mixer", "Aux Playback Switch", "RAUX"},
@@ -351,18 +351,6 @@ static const struct snd_soc_dapm_route audio_map[] = {
351 {"Left Input Mixer", "MicP Switch", "LMICP"}, 351 {"Left Input Mixer", "MicP Switch", "LMICP"},
352}; 352};
353 353
354static int wm8978_add_widgets(struct snd_soc_codec *codec)
355{
356 struct snd_soc_dapm_context *dapm = &codec->dapm;
357
358 snd_soc_dapm_new_controls(dapm, wm8978_dapm_widgets,
359 ARRAY_SIZE(wm8978_dapm_widgets));
360 /* set up the WM8978 audio map */
361 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
362
363 return 0;
364}
365
366/* PLL divisors */ 354/* PLL divisors */
367struct wm8978_pll_div { 355struct wm8978_pll_div {
368 u32 k; 356 u32 k;
@@ -975,10 +963,6 @@ static int wm8978_probe(struct snd_soc_codec *codec)
975 963
976 wm8978_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 964 wm8978_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
977 965
978 snd_soc_add_controls(codec, wm8978_snd_controls,
979 ARRAY_SIZE(wm8978_snd_controls));
980 wm8978_add_widgets(codec);
981
982 return 0; 966 return 0;
983} 967}
984 968
@@ -998,6 +982,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8978 = {
998 .reg_cache_size = ARRAY_SIZE(wm8978_reg), 982 .reg_cache_size = ARRAY_SIZE(wm8978_reg),
999 .reg_word_size = sizeof(u16), 983 .reg_word_size = sizeof(u16),
1000 .reg_cache_default = wm8978_reg, 984 .reg_cache_default = wm8978_reg,
985
986 .controls = wm8978_snd_controls,
987 .num_controls = ARRAY_SIZE(wm8978_snd_controls),
988 .dapm_widgets = wm8978_dapm_widgets,
989 .num_dapm_widgets = ARRAY_SIZE(wm8978_dapm_widgets),
990 .dapm_routes = wm8978_dapm_routes,
991 .num_dapm_routes = ARRAY_SIZE(wm8978_dapm_routes),
1001}; 992};
1002 993
1003static __devinit int wm8978_i2c_probe(struct i2c_client *i2c, 994static __devinit int wm8978_i2c_probe(struct i2c_client *i2c,