ASoC: wm8961: Use table based DAPM and control setup

Makes the code a bit cleaner.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Lars-Peter Clausen 2014-11-05 10:46:35 +01:00 committed by Mark Brown
parent f114040e3e
commit c4f50dbc56
1 changed files with 7 additions and 7 deletions

View File

@ -835,7 +835,6 @@ static struct snd_soc_dai_driver wm8961_dai = {
static int wm8961_probe(struct snd_soc_codec *codec) static int wm8961_probe(struct snd_soc_codec *codec)
{ {
struct snd_soc_dapm_context *dapm = &codec->dapm;
u16 reg; u16 reg;
/* Enable class W */ /* Enable class W */
@ -873,12 +872,6 @@ static int wm8961_probe(struct snd_soc_codec *codec)
wm8961_set_bias_level(codec, SND_SOC_BIAS_STANDBY); wm8961_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
snd_soc_add_codec_controls(codec, wm8961_snd_controls,
ARRAY_SIZE(wm8961_snd_controls));
snd_soc_dapm_new_controls(dapm, wm8961_dapm_widgets,
ARRAY_SIZE(wm8961_dapm_widgets));
snd_soc_dapm_add_routes(dapm, audio_paths, ARRAY_SIZE(audio_paths));
return 0; return 0;
} }
@ -915,6 +908,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8961 = {
.suspend = wm8961_suspend, .suspend = wm8961_suspend,
.resume = wm8961_resume, .resume = wm8961_resume,
.set_bias_level = wm8961_set_bias_level, .set_bias_level = wm8961_set_bias_level,
.controls = wm8961_snd_controls,
.num_controls = ARRAY_SIZE(wm8961_snd_controls),
.dapm_widgets = wm8961_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(wm8961_dapm_widgets),
.dapm_routes = audio_paths,
.num_dapm_routes = ARRAY_SIZE(audio_paths),
}; };
static const struct regmap_config wm8961_regmap = { static const struct regmap_config wm8961_regmap = {