All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: sgtl5000: Convert to table based DAPM and control init
@ 2012-01-22 16:49 Fabio Estevam
  2012-01-22 21:56 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2012-01-22 16:49 UTC (permalink / raw)
  To: alsa-devel; +Cc: Fabio Estevam, broonie

From: Fabio Estevam <fabio.estevam@freescale.com>

Convert to table based DAPM and control init.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 sound/soc/codecs/sgtl5000.c |   17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index 7f4ba81..d6f76cf 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -227,7 +227,7 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = {
 };
 
 /* routes for sgtl5000 */
-static const struct snd_soc_dapm_route audio_map[] = {
+static const struct snd_soc_dapm_route sgtl5000_dapm_routes[] = {
 	{"Capture Mux", "LINE_IN", "LINE_IN"},	/* line_in --> adc_mux */
 	{"Capture Mux", "MIC_IN", "MIC_IN"},	/* mic_in --> adc_mux */
 
@@ -1353,15 +1353,6 @@ static int sgtl5000_probe(struct snd_soc_codec *codec)
 	if (ret)
 		goto err;
 
-	snd_soc_add_controls(codec, sgtl5000_snd_controls,
-			     ARRAY_SIZE(sgtl5000_snd_controls));
-
-	snd_soc_dapm_new_controls(&codec->dapm, sgtl5000_dapm_widgets,
-				  ARRAY_SIZE(sgtl5000_dapm_widgets));
-
-	snd_soc_dapm_add_routes(&codec->dapm, audio_map,
-				ARRAY_SIZE(audio_map));
-
 	snd_soc_dapm_new_widgets(&codec->dapm);
 
 	return 0;
@@ -1402,6 +1393,12 @@ static struct snd_soc_codec_driver sgtl5000_driver = {
 	.reg_cache_step = 2,
 	.reg_cache_default = sgtl5000_regs,
 	.volatile_register = sgtl5000_volatile_register,
+	.controls = sgtl5000_snd_controls,
+	.num_controls = ARRAY_SIZE(sgtl5000_snd_controls),
+	.dapm_widgets = sgtl500_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(sgtl500_dapm_widgets),
+	.dapm_routes = sgtl500_dapm_routes,
+	.num_dapm_routes = ARRAY_SIZE(sgtl500_dapm_routes),
 };
 
 static __devinit int sgtl5000_i2c_probe(struct i2c_client *client,
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: sgtl5000: Convert to table based DAPM and control init
  2012-01-22 16:49 [PATCH] ASoC: sgtl5000: Convert to table based DAPM and control init Fabio Estevam
@ 2012-01-22 21:56 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2012-01-22 21:56 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: Fabio Estevam, alsa-devel

On Sun, Jan 22, 2012 at 02:49:42PM -0200, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> Convert to table based DAPM and control init.

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-22 21:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-22 16:49 [PATCH] ASoC: sgtl5000: Convert to table based DAPM and control init Fabio Estevam
2012-01-22 21:56 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.