Skip to contentSkip to conversation

ASoC: Convert WM9081 to table based control init

PATCH In review Mark Brown 2 participants 2 messages Oct 17, 2011 – Oct 18, 2011

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ASoC: Convert WM9081 to table based control init

At least for the core controls, the optionally selected controls are still added programatically.

---
 sound/soc/codecs/wm9081.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/wm9081.c +2 -2
index f4fc03b..93f794c 100644
@@ -1235,8 +1235,6 @@ static int wm9081_probe(struct snd_soc_codec *codec)
 	snd_soc_update_bits(codec, WM9081_ANALOGUE_SPEAKER_PGA,
 			    WM9081_SPKPGAZC, WM9081_SPKPGAZC);
 
-	snd_soc_add_controls(codec, wm9081_snd_controls,
-			     ARRAY_SIZE(wm9081_snd_controls));
 	if (!wm9081->pdata.num_retune_configs) {
 		dev_dbg(codec->dev,
 			"No ReTune Mobile data, using normal EQ\n");
@@ -1296,6 +1294,8 @@ static struct snd_soc_codec_driver soc_codec_dev_wm9081 = {
 	.reg_cache_default = wm9081_reg_defaults,
 	.volatile_register = wm9081_volatile_register,
 
+	.controls         = wm9081_snd_controls,
+	.num_controls     = ARRAY_SIZE(wm9081_snd_controls),
 	.dapm_widgets	  = wm9081_dapm_widgets,
 	.num_dapm_widgets = ARRAY_SIZE(wm9081_dapm_widgets),
 	.dapm_routes     = wm9081_audio_paths,
Signature · 1 line
1.7.6.3
Acked-by on v1 1/1
#1 lore raw
Quoted 22 lines · Mark Brown

At least for the core controls, the optionally selected controls are still added programatically.

---
 sound/soc/codecs/wm9081.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/wm9081.c +0 -2
index f4fc03b..93f794c 100644
@@ -1235,8 +1235,6 @@ static int wm9081_probe(struct snd_soc_codec *codec)
 	snd_soc_update_bits(codec, WM9081_ANALOGUE_SPEAKER_PGA,
 			    WM9081_SPKPGAZC, WM9081_SPKPGAZC);
 
-	snd_soc_add_controls(codec, wm9081_snd_controls,
-			     ARRAY_SIZE(wm9081_snd_controls));
 	if (!wm9081->pdata.num_retune_configs) {
 		dev_dbg(codec->dev,
 			"No ReTune Mobile data, using normal EQ\n");

sound/soc/codecs/wm9081.c static struct snd_soc_codec_driver soc_codec_dev_wm9081 = { · line 1301

Quoted 8 lines
sound/soc/codecs/wm9081.c +2 -0
@@ -1296,6 +1294,8 @@ static struct snd_soc_codec_driver soc_codec_dev_wm9081 = {
 	.reg_cache_default = wm9081_reg_defaults,
 	.volatile_register = wm9081_volatile_register,
 
+	.controls         = wm9081_snd_controls,
+	.num_controls     = ARRAY_SIZE(wm9081_snd_controls),
 	.dapm_widgets	  = wm9081_dapm_widgets,
 	.num_dapm_widgets = ARRAY_SIZE(wm9081_dapm_widgets),
 	.dapm_routes     = wm9081_audio_paths,