All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/11] ASoC: Use data based init for ak4535 DAPM
@ 2011-03-30 13:53 Lu Guanqun
  2011-03-30 13:53 ` [PATCH 02/11] ASoC: Use data based init for ak4671 DAPM Lu Guanqun
                   ` (10 more replies)
  0 siblings, 11 replies; 13+ messages in thread
From: Lu Guanqun @ 2011-03-30 13:53 UTC (permalink / raw)
  To: alsa-devel
  Cc: Mark Brown, Takashi Iwai, Sascha Hauer, Lu Guanqun, Timur Tabi,
	Liam Girdwood

CC: Liam Girdwood <lrg@slimlogic.co.uk>
CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
CC: Jaroslav Kysela <perex@perex.cz>
CC: Takashi Iwai <tiwai@suse.de>
CC: Jarkko Nikula <jhnikula@gmail.com>
CC: Timur Tabi <timur@freescale.com>
CC: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
---
 sound/soc/codecs/ak4535.c |   19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/sound/soc/codecs/ak4535.c b/sound/soc/codecs/ak4535.c
index 8b38739..e1a214e 100644
--- a/sound/soc/codecs/ak4535.c
+++ b/sound/soc/codecs/ak4535.c
@@ -230,7 +230,7 @@ static const struct snd_soc_dapm_widget ak4535_dapm_widgets[] = {
 	SND_SOC_DAPM_INPUT("AIN"),
 };
 
-static const struct snd_soc_dapm_route audio_map[] = {
+static const struct snd_soc_dapm_route ak4535_audio_map[] = {
 	/*stereo mixer */
 	{"Stereo Mixer", "Playback Switch", "DAC"},
 	{"Stereo Mixer", "Mic Sidetone Switch", "Mic"},
@@ -287,17 +287,6 @@ static const struct snd_soc_dapm_route audio_map[] = {
 	{"Input Mixer", "Aux Capture Switch", "Aux In"},
 };
 
-static int ak4535_add_widgets(struct snd_soc_codec *codec)
-{
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-	snd_soc_dapm_new_controls(dapm, ak4535_dapm_widgets,
-				  ARRAY_SIZE(ak4535_dapm_widgets));
-	snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
-
-	return 0;
-}
-
 static int ak4535_set_dai_sysclk(struct snd_soc_dai *codec_dai,
 	int clk_id, unsigned int freq, int dir)
 {
@@ -457,8 +446,6 @@ static int ak4535_probe(struct snd_soc_codec *codec)
 
 	snd_soc_add_controls(codec, ak4535_snd_controls,
 				ARRAY_SIZE(ak4535_snd_controls));
-	ak4535_add_widgets(codec);
-
 	return 0;
 }
 
@@ -480,6 +467,10 @@ static struct snd_soc_codec_driver soc_codec_dev_ak4535 = {
 	.reg_cache_size = ARRAY_SIZE(ak4535_reg),
 	.reg_word_size = sizeof(u8),
 	.reg_cache_default = ak4535_reg,
+	.dapm_widgets = ak4535_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(ak4535_dapm_widgets),
+	.dapm_routes = ak4535_audio_map,
+	.num_dapm_routes = ARRAY_SIZE(ak4535_audio_map),
 };
 
 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
-- 
1.7.2.3

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

* [PATCH 02/11] ASoC: Use data based init for ak4671 DAPM
  2011-03-30 13:53 [PATCH 01/11] ASoC: Use data based init for ak4535 DAPM Lu Guanqun
@ 2011-03-30 13:53 ` Lu Guanqun
  2011-03-30 13:53 ` [PATCH 03/11] ASoC: Use data based init for cx20442 DAPM Lu Guanqun
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Lu Guanqun @ 2011-03-30 13:53 UTC (permalink / raw)
  To: alsa-devel
  Cc: Mark Brown, Takashi Iwai, Lu Guanqun, Lars-Peter Clausen,
	Timur Tabi, Liam Girdwood

CC: Liam Girdwood <lrg@slimlogic.co.uk>
CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
CC: Jaroslav Kysela <perex@perex.cz>
CC: Takashi Iwai <tiwai@suse.de>
CC: Jarkko Nikula <jhnikula@gmail.com>
CC: Lars-Peter Clausen <lars@metafoo.de>
CC: Timur Tabi <timur@freescale.com>
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
---
 sound/soc/codecs/ak4671.c |   18 +++++-------------
 1 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/sound/soc/codecs/ak4671.c b/sound/soc/codecs/ak4671.c
index 2ec75ab..88b29f8 100644
--- a/sound/soc/codecs/ak4671.c
+++ b/sound/soc/codecs/ak4671.c
@@ -352,7 +352,7 @@ static const struct snd_soc_dapm_widget ak4671_dapm_widgets[] = {
 	SND_SOC_DAPM_SUPPLY("PMPLL", AK4671_PLL_MODE_SELECT1, 0, 0, NULL, 0),
 };
 
-static const struct snd_soc_dapm_route intercon[] = {
+static const struct snd_soc_dapm_route ak4671_intercon[] = {
 	{"DAC Left", "NULL", "PMPLL"},
 	{"DAC Right", "NULL", "PMPLL"},
 	{"ADC Left", "NULL", "PMPLL"},
@@ -433,17 +433,6 @@ static const struct snd_soc_dapm_route intercon[] = {
 	{"ROUT3 Mixer", "RINS4", "RIN4 Mixing Circuit"},
 };
 
-static int ak4671_add_widgets(struct snd_soc_codec *codec)
-{
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-	snd_soc_dapm_new_controls(dapm, ak4671_dapm_widgets,
-				  ARRAY_SIZE(ak4671_dapm_widgets));
-	snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon));
-
-	return 0;
-}
-
 static int ak4671_hw_params(struct snd_pcm_substream *substream,
 		struct snd_pcm_hw_params *params,
 		struct snd_soc_dai *dai)
@@ -650,7 +639,6 @@ static int ak4671_probe(struct snd_soc_codec *codec)
 
 	snd_soc_add_controls(codec, ak4671_snd_controls,
 			     ARRAY_SIZE(ak4671_snd_controls));
-	ak4671_add_widgets(codec);
 
 	ak4671_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
 
@@ -670,6 +658,10 @@ static struct snd_soc_codec_driver soc_codec_dev_ak4671 = {
 	.reg_cache_size = AK4671_CACHEREGNUM,
 	.reg_word_size = sizeof(u8),
 	.reg_cache_default = ak4671_reg,
+	.dapm_widgets = ak4671_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(ak4671_dapm_widgets),
+	.dapm_routes = ak4671_intercon,
+	.num_dapm_routes = ARRAY_SIZE(ak4671_intercon),
 };
 
 static int __devinit ak4671_i2c_probe(struct i2c_client *client,
-- 
1.7.2.3

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

* [PATCH 03/11] ASoC: Use data based init for cx20442 DAPM
  2011-03-30 13:53 [PATCH 01/11] ASoC: Use data based init for ak4535 DAPM Lu Guanqun
  2011-03-30 13:53 ` [PATCH 02/11] ASoC: Use data based init for ak4671 DAPM Lu Guanqun
@ 2011-03-30 13:53 ` Lu Guanqun
  2011-03-30 13:53 ` [PATCH 04/11] ASoC: Use data based init for max98088 DAPM Lu Guanqun
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Lu Guanqun @ 2011-03-30 13:53 UTC (permalink / raw)
  To: alsa-devel
  Cc: Mark Brown, Janusz Krzysztofik, Takashi Iwai, Lu Guanqun,
	Lars-Peter Clausen, Liam Girdwood

CC: Liam Girdwood <lrg@slimlogic.co.uk>
CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
CC: Jaroslav Kysela <perex@perex.cz>
CC: Takashi Iwai <tiwai@suse.de>
CC: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
CC: Jarkko Nikula <jhnikula@gmail.com>
CC: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
---
 sound/soc/codecs/cx20442.c |   18 ++++--------------
 1 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/sound/soc/codecs/cx20442.c b/sound/soc/codecs/cx20442.c
index 0bb424a..d68ea53 100644
--- a/sound/soc/codecs/cx20442.c
+++ b/sound/soc/codecs/cx20442.c
@@ -86,18 +86,6 @@ static const struct snd_soc_dapm_route cx20442_audio_map[] = {
 	{"ADC", NULL, "Input Mixer"},
 };
 
-static int cx20442_add_widgets(struct snd_soc_codec *codec)
-{
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-	snd_soc_dapm_new_controls(dapm, cx20442_dapm_widgets,
-				  ARRAY_SIZE(cx20442_dapm_widgets));
-	snd_soc_dapm_add_routes(dapm, cx20442_audio_map,
-				ARRAY_SIZE(cx20442_audio_map));
-
-	return 0;
-}
-
 static unsigned int cx20442_read_reg_cache(struct snd_soc_codec *codec,
 							unsigned int reg)
 {
@@ -344,8 +332,6 @@ static int cx20442_codec_probe(struct snd_soc_codec *codec)
 		return -ENOMEM;
 	snd_soc_codec_set_drvdata(codec, cx20442);
 
-	cx20442_add_widgets(codec);
-
 	cx20442->control_data = NULL;
 	codec->hw_write = NULL;
 	codec->card->pop_time = 0;
@@ -377,6 +363,10 @@ static struct snd_soc_codec_driver cx20442_codec_dev = {
 	.reg_word_size = sizeof(u8),
 	.read = cx20442_read_reg_cache,
 	.write = cx20442_write,
+	.dapm_widgets = cx20442_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(cx20442_dapm_widgets),
+	.dapm_routes = cx20442_audio_map,
+	.num_dapm_routes = ARRAY_SIZE(cx20442_audio_map),
 };
 
 static int cx20442_platform_probe(struct platform_device *pdev)
-- 
1.7.2.3

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

* [PATCH 04/11] ASoC: Use data based init for max98088 DAPM
  2011-03-30 13:53 [PATCH 01/11] ASoC: Use data based init for ak4535 DAPM Lu Guanqun
  2011-03-30 13:53 ` [PATCH 02/11] ASoC: Use data based init for ak4671 DAPM Lu Guanqun
  2011-03-30 13:53 ` [PATCH 03/11] ASoC: Use data based init for cx20442 DAPM Lu Guanqun
@ 2011-03-30 13:53 ` Lu Guanqun
  2011-03-30 13:53 ` [PATCH 05/11] ASoC: Use data based init for wm9713 DAPM Lu Guanqun
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Lu Guanqun @ 2011-03-30 13:53 UTC (permalink / raw)
  To: alsa-devel
  Cc: Dimitris Papastamos, Mark Brown, Takashi Iwai, Lu Guanqun,
	Peter Hsiang, Liam Girdwood

CC: Liam Girdwood <lrg@slimlogic.co.uk>
CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
CC: Jaroslav Kysela <perex@perex.cz>
CC: Takashi Iwai <tiwai@suse.de>
CC: Peter Hsiang <Peter.Hsiang@maxim-ic.com>
CC: Jarkko Nikula <jhnikula@gmail.com>
CC: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
---
 sound/soc/codecs/max98088.c |   25 +++++++------------------
 1 files changed, 7 insertions(+), 18 deletions(-)

diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c
index bd0517c..bb58bdb 100644
--- a/sound/soc/codecs/max98088.c
+++ b/sound/soc/codecs/max98088.c
@@ -1112,7 +1112,7 @@ static const struct snd_soc_dapm_widget max98088_dapm_widgets[] = {
        SND_SOC_DAPM_INPUT("INB2"),
 };
 
-static const struct snd_soc_dapm_route audio_map[] = {
+static const struct snd_soc_dapm_route max98088_audio_map[] = {
        /* Left headphone output mixer */
        {"Left HP Mixer", "Left DAC1 Switch", "DACL1"},
        {"Left HP Mixer", "Left DAC2 Switch", "DACL2"},
@@ -1226,22 +1226,6 @@ static const struct snd_soc_dapm_route audio_map[] = {
        {"MIC2 Input", NULL, "MIC2"},
 };
 
-static int max98088_add_widgets(struct snd_soc_codec *codec)
-{
-       struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-       snd_soc_dapm_new_controls(dapm, max98088_dapm_widgets,
-                                 ARRAY_SIZE(max98088_dapm_widgets));
-
-       snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
-
-       snd_soc_add_controls(codec, max98088_snd_controls,
-                            ARRAY_SIZE(max98088_snd_controls));
-
-       snd_soc_dapm_new_widgets(dapm);
-       return 0;
-}
-
 /* codec mclk clock divider coefficients */
 static const struct {
        u32 rate;
@@ -2010,7 +1994,8 @@ static int max98088_probe(struct snd_soc_codec *codec)
 
        max98088_handle_pdata(codec);
 
-       max98088_add_widgets(codec);
+       snd_soc_add_controls(codec, max98088_snd_controls,
+                            ARRAY_SIZE(max98088_snd_controls));
 
 err_access:
        return ret;
@@ -2036,6 +2021,10 @@ static struct snd_soc_codec_driver soc_codec_dev_max98088 = {
        .reg_word_size = sizeof(u8),
        .reg_cache_default = max98088_reg,
        .volatile_register = max98088_volatile_register,
+	.dapm_widgets = max98088_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(max98088_dapm_widgets),
+	.dapm_routes = max98088_audio_map,
+	.num_dapm_routes = ARRAY_SIZE(max98088_audio_map),
 };
 
 static int max98088_i2c_probe(struct i2c_client *i2c,
-- 
1.7.2.3

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

* [PATCH 05/11] ASoC: Use data based init for wm9713 DAPM
  2011-03-30 13:53 [PATCH 01/11] ASoC: Use data based init for ak4535 DAPM Lu Guanqun
                   ` (2 preceding siblings ...)
  2011-03-30 13:53 ` [PATCH 04/11] ASoC: Use data based init for max98088 DAPM Lu Guanqun
@ 2011-03-30 13:53 ` Lu Guanqun
  2011-03-30 13:53 ` [PATCH 06/11] ASoC: Use data based init for wm9712 DAPM Lu Guanqun
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Lu Guanqun @ 2011-03-30 13:53 UTC (permalink / raw)
  To: alsa-devel
  Cc: Dimitris Papastamos, Mark Brown, Takashi Iwai, Lu Guanqun,
	Ian Lartey, Liam Girdwood

CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
CC: Ian Lartey <ian@opensource.wolfsonmicro.com>
CC: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
CC: Liam Girdwood <lrg@slimlogic.co.uk>
CC: Jaroslav Kysela <perex@perex.cz>
CC: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
---
 sound/soc/codecs/wm9713.c |   19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c
index 38ed985..7167cb6 100644
--- a/sound/soc/codecs/wm9713.c
+++ b/sound/soc/codecs/wm9713.c
@@ -487,7 +487,7 @@ SND_SOC_DAPM_INPUT("MIC2B"),
 SND_SOC_DAPM_VMID("VMID"),
 };
 
-static const struct snd_soc_dapm_route audio_map[] = {
+static const struct snd_soc_dapm_route wm9713_audio_map[] = {
 	/* left HP mixer */
 	{"Left HP Mixer", "Beep Playback Switch",    "PCBEEP"},
 	{"Left HP Mixer", "Voice Playback Switch",   "Voice DAC"},
@@ -644,18 +644,6 @@ static const struct snd_soc_dapm_route audio_map[] = {
 	{"Capture Mono Mux", "Right", "Right Capture Source"},
 };
 
-static int wm9713_add_widgets(struct snd_soc_codec *codec)
-{
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-	snd_soc_dapm_new_controls(dapm, wm9713_dapm_widgets,
-				  ARRAY_SIZE(wm9713_dapm_widgets));
-
-	snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
-
-	return 0;
-}
-
 static unsigned int ac97_read(struct snd_soc_codec *codec,
 	unsigned int reg)
 {
@@ -1231,7 +1219,6 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec)
 
 	snd_soc_add_controls(codec, wm9713_snd_ac97_controls,
 				ARRAY_SIZE(wm9713_snd_ac97_controls));
-	wm9713_add_widgets(codec);
 
 	return 0;
 
@@ -1262,6 +1249,10 @@ static struct snd_soc_codec_driver soc_codec_dev_wm9713 = {
 	.reg_word_size = sizeof(u16),
 	.reg_cache_step = 2,
 	.reg_cache_default = wm9713_reg,
+	.dapm_widgets = wm9713_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(wm9713_dapm_widgets),
+	.dapm_routes = wm9713_audio_map,
+	.num_dapm_routes = ARRAY_SIZE(wm9713_audio_map),
 };
 
 static __devinit int wm9713_probe(struct platform_device *pdev)
-- 
1.7.2.3

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

* [PATCH 06/11] ASoC: Use data based init for wm9712 DAPM
  2011-03-30 13:53 [PATCH 01/11] ASoC: Use data based init for ak4535 DAPM Lu Guanqun
                   ` (3 preceding siblings ...)
  2011-03-30 13:53 ` [PATCH 05/11] ASoC: Use data based init for wm9713 DAPM Lu Guanqun
@ 2011-03-30 13:53 ` Lu Guanqun
  2011-03-30 13:53 ` [PATCH 07/11] ASoC: Use data based init for wm9705 DAPM Lu Guanqun
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Lu Guanqun @ 2011-03-30 13:53 UTC (permalink / raw)
  To: alsa-devel
  Cc: Dimitris Papastamos, Mark Brown, Takashi Iwai, Lu Guanqun,
	Ian Lartey, Liam Girdwood

CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
CC: Ian Lartey <ian@opensource.wolfsonmicro.com>
CC: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
CC: Liam Girdwood <lrg@slimlogic.co.uk>
CC: Jaroslav Kysela <perex@perex.cz>
CC: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
---
 sound/soc/codecs/wm9712.c |   18 +++++-------------
 1 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
index bf5d4ef..90117f8 100644
--- a/sound/soc/codecs/wm9712.c
+++ b/sound/soc/codecs/wm9712.c
@@ -332,7 +332,7 @@ SND_SOC_DAPM_INPUT("MIC1"),
 SND_SOC_DAPM_INPUT("MIC2"),
 };
 
-static const struct snd_soc_dapm_route audio_map[] = {
+static const struct snd_soc_dapm_route wm9712_audio_map[] = {
 	/* virtual mixer - mixes left & right channels for spk and mono */
 	{"AC97 Mixer", NULL, "Left DAC"},
 	{"AC97 Mixer", NULL, "Right DAC"},
@@ -429,17 +429,6 @@ static const struct snd_soc_dapm_route audio_map[] = {
 	{"ROUT2", NULL, "Speaker PGA"},
 };
 
-static int wm9712_add_widgets(struct snd_soc_codec *codec)
-{
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-	snd_soc_dapm_new_controls(dapm, wm9712_dapm_widgets,
-				  ARRAY_SIZE(wm9712_dapm_widgets));
-	snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
-
-	return 0;
-}
-
 static unsigned int ac97_read(struct snd_soc_codec *codec,
 	unsigned int reg)
 {
@@ -651,7 +640,6 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec)
 	wm9712_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
 	snd_soc_add_controls(codec, wm9712_snd_ac97_controls,
 				ARRAY_SIZE(wm9712_snd_ac97_controls));
-	wm9712_add_widgets(codec);
 
 	return 0;
 
@@ -678,6 +666,10 @@ static struct snd_soc_codec_driver soc_codec_dev_wm9712 = {
 	.reg_word_size = sizeof(u16),
 	.reg_cache_step = 2,
 	.reg_cache_default = wm9712_reg,
+	.dapm_widgets = wm9712_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(wm9712_dapm_widgets),
+	.dapm_routes = wm9712_audio_map,
+	.num_dapm_routes = ARRAY_SIZE(wm9712_audio_map),
 };
 
 static __devinit int wm9712_probe(struct platform_device *pdev)
-- 
1.7.2.3

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

* [PATCH 07/11] ASoC: Use data based init for wm9705 DAPM
  2011-03-30 13:53 [PATCH 01/11] ASoC: Use data based init for ak4535 DAPM Lu Guanqun
                   ` (4 preceding siblings ...)
  2011-03-30 13:53 ` [PATCH 06/11] ASoC: Use data based init for wm9712 DAPM Lu Guanqun
@ 2011-03-30 13:53 ` Lu Guanqun
  2011-03-30 13:53 ` [PATCH 08/11] ASoC: Use data based init for wm8728 DAPM Lu Guanqun
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Lu Guanqun @ 2011-03-30 13:53 UTC (permalink / raw)
  To: alsa-devel
  Cc: Dimitris Papastamos, Mark Brown, Takashi Iwai, Lu Guanqun,
	Ian Lartey, Liam Girdwood

CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
CC: Ian Lartey <ian@opensource.wolfsonmicro.com>
CC: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
CC: Liam Girdwood <lrg@slimlogic.co.uk>
CC: Jaroslav Kysela <perex@perex.cz>
CC: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
---
 sound/soc/codecs/wm9705.c |   18 +++++-------------
 1 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/sound/soc/codecs/wm9705.c b/sound/soc/codecs/wm9705.c
index 47b357a..646b58d 100644
--- a/sound/soc/codecs/wm9705.c
+++ b/sound/soc/codecs/wm9705.c
@@ -142,7 +142,7 @@ static const struct snd_soc_dapm_widget wm9705_dapm_widgets[] = {
  * constantly enabled, we use the mutes on those inputs to simulate such
  * controls.
  */
-static const struct snd_soc_dapm_route audio_map[] = {
+static const struct snd_soc_dapm_route wm9705_audio_map[] = {
 	/* HP mixer */
 	{"HP Mixer", "PCBeep Playback Switch", "PCBEEP PGA"},
 	{"HP Mixer", "CD Playback Switch", "CD PGA"},
@@ -200,17 +200,6 @@ static const struct snd_soc_dapm_route audio_map[] = {
 	{"Right ADC", NULL, "ADC PGA"},
 };
 
-static int wm9705_add_widgets(struct snd_soc_codec *codec)
-{
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-	snd_soc_dapm_new_controls(dapm, wm9705_dapm_widgets,
-					ARRAY_SIZE(wm9705_dapm_widgets));
-	snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
-
-	return 0;
-}
-
 /* We use a register cache to enhance read performance. */
 static unsigned int ac97_read(struct snd_soc_codec *codec, unsigned int reg)
 {
@@ -364,7 +353,6 @@ static int wm9705_soc_probe(struct snd_soc_codec *codec)
 
 	snd_soc_add_controls(codec, wm9705_snd_ac97_controls,
 				ARRAY_SIZE(wm9705_snd_ac97_controls));
-	wm9705_add_widgets(codec);
 
 	return 0;
 
@@ -390,6 +378,10 @@ static struct snd_soc_codec_driver soc_codec_dev_wm9705 = {
 	.reg_word_size = sizeof(u16),
 	.reg_cache_step = 2,
 	.reg_cache_default = wm9705_reg,
+	.dapm_widgets = wm9705_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(wm9705_dapm_widgets),
+	.dapm_routes = wm9705_audio_map,
+	.num_dapm_routes = ARRAY_SIZE(wm9705_audio_map),
 };
 
 static __devinit int wm9705_probe(struct platform_device *pdev)
-- 
1.7.2.3

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

* [PATCH 08/11] ASoC: Use data based init for wm8728 DAPM
  2011-03-30 13:53 [PATCH 01/11] ASoC: Use data based init for ak4535 DAPM Lu Guanqun
                   ` (5 preceding siblings ...)
  2011-03-30 13:53 ` [PATCH 07/11] ASoC: Use data based init for wm9705 DAPM Lu Guanqun
@ 2011-03-30 13:53 ` Lu Guanqun
  2011-03-30 13:53 ` [PATCH 09/11] ASoC: Use data based init for wm8711 DAPM Lu Guanqun
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Lu Guanqun @ 2011-03-30 13:53 UTC (permalink / raw)
  To: alsa-devel
  Cc: Dimitris Papastamos, Mark Brown, Takashi Iwai, Lu Guanqun,
	Ian Lartey, Liam Girdwood

CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
CC: Ian Lartey <ian@opensource.wolfsonmicro.com>
CC: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
CC: Liam Girdwood <lrg@slimlogic.co.uk>
CC: Jaroslav Kysela <perex@perex.cz>
CC: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
---
 sound/soc/codecs/wm8728.c |   18 +++++-------------
 1 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/sound/soc/codecs/wm8728.c b/sound/soc/codecs/wm8728.c
index 736b035..86d4718 100644
--- a/sound/soc/codecs/wm8728.c
+++ b/sound/soc/codecs/wm8728.c
@@ -65,22 +65,11 @@ SND_SOC_DAPM_OUTPUT("VOUTL"),
 SND_SOC_DAPM_OUTPUT("VOUTR"),
 };
 
-static const struct snd_soc_dapm_route intercon[] = {
+static const struct snd_soc_dapm_route wm8728_intercon[] = {
 	{"VOUTL", NULL, "DAC"},
 	{"VOUTR", NULL, "DAC"},
 };
 
-static int wm8728_add_widgets(struct snd_soc_codec *codec)
-{
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-	snd_soc_dapm_new_controls(dapm, wm8728_dapm_widgets,
-				  ARRAY_SIZE(wm8728_dapm_widgets));
-	snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon));
-
-	return 0;
-}
-
 static int wm8728_mute(struct snd_soc_dai *dai, int mute)
 {
 	struct snd_soc_codec *codec = dai->codec;
@@ -255,7 +244,6 @@ static int wm8728_probe(struct snd_soc_codec *codec)
 
 	snd_soc_add_controls(codec, wm8728_snd_controls,
 				ARRAY_SIZE(wm8728_snd_controls));
-	wm8728_add_widgets(codec);
 
 	return ret;
 }
@@ -275,6 +263,10 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8728 = {
 	.reg_cache_size = ARRAY_SIZE(wm8728_reg_defaults),
 	.reg_word_size = sizeof(u16),
 	.reg_cache_default = wm8728_reg_defaults,
+	.dapm_widgets = wm8728_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(wm8728_dapm_widgets),
+	.dapm_routes = wm8728_intercon,
+	.num_dapm_routes = ARRAY_SIZE(wm8728_intercon),
 };
 
 #if defined(CONFIG_SPI_MASTER)
-- 
1.7.2.3

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

* [PATCH 09/11] ASoC: Use data based init for wm8711 DAPM
  2011-03-30 13:53 [PATCH 01/11] ASoC: Use data based init for ak4535 DAPM Lu Guanqun
                   ` (6 preceding siblings ...)
  2011-03-30 13:53 ` [PATCH 08/11] ASoC: Use data based init for wm8728 DAPM Lu Guanqun
@ 2011-03-30 13:53 ` Lu Guanqun
  2011-03-30 13:53 ` [PATCH 10/11] ASoC: Use data based init for tlv320aic23 DAPM Lu Guanqun
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Lu Guanqun @ 2011-03-30 13:53 UTC (permalink / raw)
  To: alsa-devel
  Cc: Dimitris Papastamos, Mark Brown, Takashi Iwai, Lu Guanqun,
	Ian Lartey, Liam Girdwood

CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
CC: Ian Lartey <ian@opensource.wolfsonmicro.com>
CC: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
CC: Liam Girdwood <lrg@slimlogic.co.uk>
CC: Jaroslav Kysela <perex@perex.cz>
CC: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
---
 sound/soc/codecs/wm8711.c |   18 +++++-------------
 1 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/sound/soc/codecs/wm8711.c b/sound/soc/codecs/wm8711.c
index 97c3038..a537e4a 100644
--- a/sound/soc/codecs/wm8711.c
+++ b/sound/soc/codecs/wm8711.c
@@ -77,7 +77,7 @@ SND_SOC_DAPM_OUTPUT("ROUT"),
 SND_SOC_DAPM_OUTPUT("RHPOUT"),
 };
 
-static const struct snd_soc_dapm_route intercon[] = {
+static const struct snd_soc_dapm_route wm8711_intercon[] = {
 	/* output mixer */
 	{"Output Mixer", "Line Bypass Switch", "Line Input"},
 	{"Output Mixer", "HiFi Playback Switch", "DAC"},
@@ -89,17 +89,6 @@ static const struct snd_soc_dapm_route intercon[] = {
 	{"LOUT", NULL, "Output Mixer"},
 };
 
-static int wm8711_add_widgets(struct snd_soc_codec *codec)
-{
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-	snd_soc_dapm_new_controls(dapm, wm8711_dapm_widgets,
-				  ARRAY_SIZE(wm8711_dapm_widgets));
-	snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon));
-
-	return 0;
-}
-
 struct _coeff_div {
 	u32 mclk;
 	u32 rate;
@@ -398,7 +387,6 @@ static int wm8711_probe(struct snd_soc_codec *codec)
 
 	snd_soc_add_controls(codec, wm8711_snd_controls,
 			     ARRAY_SIZE(wm8711_snd_controls));
-	wm8711_add_widgets(codec);
 
 	return ret;
 
@@ -420,6 +408,10 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8711 = {
 	.reg_cache_size = ARRAY_SIZE(wm8711_reg),
 	.reg_word_size = sizeof(u16),
 	.reg_cache_default = wm8711_reg,
+	.dapm_widgets = wm8711_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(wm8711_dapm_widgets),
+	.dapm_routes = wm8711_intercon,
+	.num_dapm_routes = ARRAY_SIZE(wm8711_intercon),
 };
 
 #if defined(CONFIG_SPI_MASTER)
-- 
1.7.2.3

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

* [PATCH 10/11] ASoC: Use data based init for tlv320aic23 DAPM
  2011-03-30 13:53 [PATCH 01/11] ASoC: Use data based init for ak4535 DAPM Lu Guanqun
                   ` (7 preceding siblings ...)
  2011-03-30 13:53 ` [PATCH 09/11] ASoC: Use data based init for wm8711 DAPM Lu Guanqun
@ 2011-03-30 13:53 ` Lu Guanqun
  2011-03-30 13:53 ` [PATCH 11/11] ASoC: Use data based init for sn95031 DAPM Lu Guanqun
  2011-03-30 19:10 ` [PATCH 01/11] ASoC: Use data based init for ak4535 DAPM Liam Girdwood
  10 siblings, 0 replies; 13+ messages in thread
From: Lu Guanqun @ 2011-03-30 13:53 UTC (permalink / raw)
  To: alsa-devel
  Cc: Mark Brown, Takashi Iwai, Sascha Hauer, Lu Guanqun, Timur Tabi,
	Liam Girdwood

CC: Liam Girdwood <lrg@slimlogic.co.uk>
CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
CC: Jaroslav Kysela <perex@perex.cz>
CC: Takashi Iwai <tiwai@suse.de>
CC: Jarkko Nikula <jhnikula@gmail.com>
CC: Timur Tabi <timur@freescale.com>
CC: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
---
 sound/soc/codecs/tlv320aic23.c |   19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/sound/soc/codecs/tlv320aic23.c b/sound/soc/codecs/tlv320aic23.c
index 54a30ef..33bb52f 100644
--- a/sound/soc/codecs/tlv320aic23.c
+++ b/sound/soc/codecs/tlv320aic23.c
@@ -212,7 +212,7 @@ static const struct snd_soc_dapm_widget tlv320aic23_dapm_widgets[] = {
 	SND_SOC_DAPM_INPUT("MICIN"),
 };
 
-static const struct snd_soc_dapm_route intercon[] = {
+static const struct snd_soc_dapm_route tlv320aic23_intercon[] = {
 	/* Output Mixer */
 	{"Output Mixer", "Line Bypass Switch", "Line Input"},
 	{"Output Mixer", "Playback Switch", "DAC"},
@@ -388,18 +388,6 @@ static int set_sample_rate_control(struct snd_soc_codec *codec, int mclk,
 	return 0;
 }
 
-static int tlv320aic23_add_widgets(struct snd_soc_codec *codec)
-{
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-	snd_soc_dapm_new_controls(dapm, tlv320aic23_dapm_widgets,
-				  ARRAY_SIZE(tlv320aic23_dapm_widgets));
-	/* set up audio path interconnects */
-	snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon));
-
-	return 0;
-}
-
 static int tlv320aic23_hw_params(struct snd_pcm_substream *substream,
 				 struct snd_pcm_hw_params *params,
 				 struct snd_soc_dai *dai)
@@ -676,7 +664,6 @@ static int tlv320aic23_probe(struct snd_soc_codec *codec)
 
 	snd_soc_add_controls(codec, tlv320aic23_snd_controls,
 				ARRAY_SIZE(tlv320aic23_snd_controls));
-	tlv320aic23_add_widgets(codec);
 
 	return 0;
 }
@@ -698,6 +685,10 @@ static struct snd_soc_codec_driver soc_codec_dev_tlv320aic23 = {
 	.read = tlv320aic23_read_reg_cache,
 	.write = tlv320aic23_write,
 	.set_bias_level = tlv320aic23_set_bias_level,
+	.dapm_widgets = tlv320aic23_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(tlv320aic23_dapm_widgets),
+	.dapm_routes = tlv320aic23_intercon,
+	.num_dapm_routes = ARRAY_SIZE(tlv320aic23_intercon),
 };
 
 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
-- 
1.7.2.3

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

* [PATCH 11/11] ASoC: Use data based init for sn95031 DAPM
  2011-03-30 13:53 [PATCH 01/11] ASoC: Use data based init for ak4535 DAPM Lu Guanqun
                   ` (8 preceding siblings ...)
  2011-03-30 13:53 ` [PATCH 10/11] ASoC: Use data based init for tlv320aic23 DAPM Lu Guanqun
@ 2011-03-30 13:53 ` Lu Guanqun
  2011-03-30 19:10 ` [PATCH 01/11] ASoC: Use data based init for ak4535 DAPM Liam Girdwood
  10 siblings, 0 replies; 13+ messages in thread
From: Lu Guanqun @ 2011-03-30 13:53 UTC (permalink / raw)
  To: alsa-devel
  Cc: Mark Brown, Takashi Iwai, Lu Guanqun, Vinod Koul, Harsha Priya,
	Liam Girdwood

CC: Liam Girdwood <lrg@slimlogic.co.uk>
CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
CC: Jaroslav Kysela <perex@perex.cz>
CC: Takashi Iwai <tiwai@suse.de>
CC: Harsha Priya <priya.harsha@intel.com>
CC: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
---
 sound/soc/codecs/sn95031.c |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/sound/soc/codecs/sn95031.c b/sound/soc/codecs/sn95031.c
index 2a30eae..569555f 100644
--- a/sound/soc/codecs/sn95031.c
+++ b/sound/soc/codecs/sn95031.c
@@ -825,8 +825,6 @@ EXPORT_SYMBOL_GPL(sn95031_jack_detection);
 /* codec registration */
 static int sn95031_codec_probe(struct snd_soc_codec *codec)
 {
-	int ret;
-
 	pr_debug("codec_probe called\n");
 
 	codec->dapm.bias_level = SND_SOC_BIAS_OFF;
@@ -877,16 +875,7 @@ static int sn95031_codec_probe(struct snd_soc_codec *codec)
 	snd_soc_add_controls(codec, sn95031_snd_controls,
 			     ARRAY_SIZE(sn95031_snd_controls));
 
-	ret = snd_soc_dapm_new_controls(&codec->dapm, sn95031_dapm_widgets,
-				ARRAY_SIZE(sn95031_dapm_widgets));
-	if (ret)
-		pr_err("soc_dapm_new_control failed %d", ret);
-	ret = snd_soc_dapm_add_routes(&codec->dapm, sn95031_audio_map,
-				ARRAY_SIZE(sn95031_audio_map));
-	if (ret)
-		pr_err("soc_dapm_add_routes failed %d", ret);
-
-	return ret;
+	return 0;
 }
 
 static int sn95031_codec_remove(struct snd_soc_codec *codec)
@@ -903,6 +892,10 @@ struct snd_soc_codec_driver sn95031_codec = {
 	.read		= sn95031_read,
 	.write		= sn95031_write,
 	.set_bias_level	= sn95031_set_vaud_bias,
+	.dapm_widgets	= sn95031_dapm_widgets,
+	.num_dapm_widgets	= ARRAY_SIZE(sn95031_dapm_widgets),
+	.dapm_routes	= sn95031_audio_map,
+	.num_dapm_routes	= ARRAY_SIZE(sn95031_audio_map),
 };
 
 static int __devinit sn95031_device_probe(struct platform_device *pdev)
-- 
1.7.2.3

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

* Re: [PATCH 01/11] ASoC: Use data based init for ak4535 DAPM
  2011-03-30 13:53 [PATCH 01/11] ASoC: Use data based init for ak4535 DAPM Lu Guanqun
                   ` (9 preceding siblings ...)
  2011-03-30 13:53 ` [PATCH 11/11] ASoC: Use data based init for sn95031 DAPM Lu Guanqun
@ 2011-03-30 19:10 ` Liam Girdwood
  2011-03-30 21:13   ` Mark Brown
  10 siblings, 1 reply; 13+ messages in thread
From: Liam Girdwood @ 2011-03-30 19:10 UTC (permalink / raw)
  To: Lu Guanqun
  Cc: alsa-devel, Takashi Iwai, Sascha Hauer, Mark Brown, Tabi, Timur

On Wed, 2011-03-30 at 21:53 +0800, Lu Guanqun wrote:
> CC: Liam Girdwood <lrg@slimlogic.co.uk>
> CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
> CC: Jaroslav Kysela <perex@perex.cz>
> CC: Takashi Iwai <tiwai@suse.de>
> CC: Jarkko Nikula <jhnikula@gmail.com>
> CC: Timur Tabi <timur@freescale.com>
> CC: Sascha Hauer <s.hauer@pengutronix.de>
> Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
> ---

All 

Acked-by: Liam Girdwood <lrg@ti.com>

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

* Re: [PATCH 01/11] ASoC: Use data based init for ak4535 DAPM
  2011-03-30 19:10 ` [PATCH 01/11] ASoC: Use data based init for ak4535 DAPM Liam Girdwood
@ 2011-03-30 21:13   ` Mark Brown
  0 siblings, 0 replies; 13+ messages in thread
From: Mark Brown @ 2011-03-30 21:13 UTC (permalink / raw)
  To: Liam Girdwood
  Cc: alsa-devel, Takashi Iwai, Sascha Hauer, Lu Guanqun, Timur Tabi

On Wed, Mar 30, 2011 at 08:10:23PM +0100, Liam Girdwood wrote:

> All 

> Acked-by: Liam Girdwood <lrg@ti.com>

And applied, thanks.

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

end of thread, other threads:[~2011-03-30 21:13 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-30 13:53 [PATCH 01/11] ASoC: Use data based init for ak4535 DAPM Lu Guanqun
2011-03-30 13:53 ` [PATCH 02/11] ASoC: Use data based init for ak4671 DAPM Lu Guanqun
2011-03-30 13:53 ` [PATCH 03/11] ASoC: Use data based init for cx20442 DAPM Lu Guanqun
2011-03-30 13:53 ` [PATCH 04/11] ASoC: Use data based init for max98088 DAPM Lu Guanqun
2011-03-30 13:53 ` [PATCH 05/11] ASoC: Use data based init for wm9713 DAPM Lu Guanqun
2011-03-30 13:53 ` [PATCH 06/11] ASoC: Use data based init for wm9712 DAPM Lu Guanqun
2011-03-30 13:53 ` [PATCH 07/11] ASoC: Use data based init for wm9705 DAPM Lu Guanqun
2011-03-30 13:53 ` [PATCH 08/11] ASoC: Use data based init for wm8728 DAPM Lu Guanqun
2011-03-30 13:53 ` [PATCH 09/11] ASoC: Use data based init for wm8711 DAPM Lu Guanqun
2011-03-30 13:53 ` [PATCH 10/11] ASoC: Use data based init for tlv320aic23 DAPM Lu Guanqun
2011-03-30 13:53 ` [PATCH 11/11] ASoC: Use data based init for sn95031 DAPM Lu Guanqun
2011-03-30 19:10 ` [PATCH 01/11] ASoC: Use data based init for ak4535 DAPM Liam Girdwood
2011-03-30 21:13   ` 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.