Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/9] ASoC: OMAP machine driver cleanups
@ 2011-10-10 12:34 Peter Ujfalusi
  2011-10-10 12:34 ` [PATCH v2 1/9] ASoC: OMAP machines: Remove soc_dapm_sync() call from init Peter Ujfalusi
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Peter Ujfalusi @ 2011-10-10 12:34 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel

Hello,

Some cleanups for the OMAP ASoC machine drivers:
- do not call soc_dapm_sync from dai_link->init callback since it is useless
- Convert drivers to use table based DAPM initialization
- Remove dapm_enable_pin calls from dai_link->init callback since pins are
  enabled by default

Changelog since v1:
- Do not touch ams-delta just remove the dapm_sync call.
- Do not convert soc_dapm_sync calls to dapm_new_widgets call

Regards,
Peter
---
Peter Ujfalusi (9):
  ASoC: OMAP machines: Remove soc_dapm_sync() call from init
  ASoC: am3517evm: Let core to deal with the DAPM widgets
  ASoC: n810: Let the core to register DAPM widgets/routes and controls
  ASoC: osk5912: Let core to deal with the DAPM widgets
  ASoC: sdp3430: Let core to deal with the DAPM widgets
  ASoC: zoom2: Let core to deal with the DAPM widgets
  ASoC: zoom2: No need to call dapm_pin_enable at init time
  ASoC: sdp4430: Let core to deal with the DAPM widgets
  ASoC: sdp4430: No need to call dapm_pin_enable at init time

 sound/soc/omap/am3517evm.c    |   28 +++++-----------------------
 sound/soc/omap/ams-delta.c    |    1 -
 sound/soc/omap/n810.c         |   23 +++++++----------------
 sound/soc/omap/omap3pandora.c |    8 ++------
 sound/soc/omap/osk5912.c      |   27 +++++----------------------
 sound/soc/omap/rx51.c         |    2 --
 sound/soc/omap/sdp3430.c      |   18 +++++-------------
 sound/soc/omap/sdp4430.c      |   27 +++++----------------------
 sound/soc/omap/zoom2.c        |   26 ++++++--------------------
 9 files changed, 35 insertions(+), 125 deletions(-)

-- 
1.7.7

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

* [PATCH v2 1/9] ASoC: OMAP machines: Remove soc_dapm_sync() call from init
  2011-10-10 12:34 [PATCH v2 0/9] ASoC: OMAP machine driver cleanups Peter Ujfalusi
@ 2011-10-10 12:34 ` Peter Ujfalusi
  2011-10-10 12:34 ` [PATCH v2 2/9] ASoC: am3517evm: Let core to deal with the DAPM widgets Peter Ujfalusi
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Peter Ujfalusi @ 2011-10-10 12:34 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: alsa-devel, Janusz Krzysztofik, Gražvydas Ignotas,
	Anuj Aggarwal, Misael Lopez Cruz, Jarkko Nikula

No need to call soc_dapm_sync at init time.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Anuj Aggarwal <anuj.aggarwal@ti.com>
Cc: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Cc: Jarkko Nikula <jarkko.nikula@bitmer.com>
Cc: Gražvydas Ignotas <notasas@gmail.com>
Cc: Misael Lopez Cruz <misael.lopez@ti.com>
---
 sound/soc/omap/am3517evm.c    |    2 --
 sound/soc/omap/ams-delta.c    |    1 -
 sound/soc/omap/n810.c         |    6 +-----
 sound/soc/omap/omap3pandora.c |    8 ++------
 sound/soc/omap/osk5912.c      |    2 --
 sound/soc/omap/rx51.c         |    2 --
 sound/soc/omap/sdp3430.c      |    4 ----
 sound/soc/omap/sdp4430.c      |    4 ----
 sound/soc/omap/zoom2.c        |    4 +---
 9 files changed, 4 insertions(+), 29 deletions(-)

diff --git a/sound/soc/omap/am3517evm.c b/sound/soc/omap/am3517evm.c
index 48af0f8..f5a4d65 100644
--- a/sound/soc/omap/am3517evm.c
+++ b/sound/soc/omap/am3517evm.c
@@ -107,8 +107,6 @@ static int am3517evm_aic23_init(struct snd_soc_pcm_runtime *rtd)
 	snd_soc_dapm_enable_pin(dapm, "Line In");
 	snd_soc_dapm_enable_pin(dapm, "Mic In");
 
-	snd_soc_dapm_sync(dapm);
-
 	return 0;
 }
 
diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c
index 0aa475f..dcb7b689 100644
--- a/sound/soc/omap/ams-delta.c
+++ b/sound/soc/omap/ams-delta.c
@@ -569,7 +569,6 @@ static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd)
 	snd_soc_dapm_disable_pin(dapm, "Speaker");
 	snd_soc_dapm_disable_pin(dapm, "AGCIN");
 	snd_soc_dapm_disable_pin(dapm, "AGCOUT");
-	snd_soc_dapm_sync(dapm);
 
 	/* Add virtual switch */
 	ret = snd_soc_add_controls(codec, ams_delta_audio_controls,
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c
index c10d356..4fa881b 100644
--- a/sound/soc/omap/n810.c
+++ b/sound/soc/omap/n810.c
@@ -280,11 +280,7 @@ static int n810_aic33_init(struct snd_soc_pcm_runtime *rtd)
 				  ARRAY_SIZE(aic33_dapm_widgets));
 
 	/* Set up N810 specific audio path audio_map */
-	snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
-
-	snd_soc_dapm_sync(dapm);
-
-	return 0;
+	return snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
 }
 
 /* Digital audio interface glue - connects codec <--> CPU */
diff --git a/sound/soc/omap/omap3pandora.c b/sound/soc/omap/omap3pandora.c
index 3ae87fd..30a75b4 100644
--- a/sound/soc/omap/omap3pandora.c
+++ b/sound/soc/omap/omap3pandora.c
@@ -173,10 +173,8 @@ static int omap3pandora_out_init(struct snd_soc_pcm_runtime *rtd)
 	if (ret < 0)
 		return ret;
 
-	snd_soc_dapm_add_routes(dapm, omap3pandora_out_map,
+	return snd_soc_dapm_add_routes(dapm, omap3pandora_out_map,
 		ARRAY_SIZE(omap3pandora_out_map));
-
-	return snd_soc_dapm_sync(dapm);
 }
 
 static int omap3pandora_in_init(struct snd_soc_pcm_runtime *rtd)
@@ -196,10 +194,8 @@ static int omap3pandora_in_init(struct snd_soc_pcm_runtime *rtd)
 	if (ret < 0)
 		return ret;
 
-	snd_soc_dapm_add_routes(dapm, omap3pandora_in_map,
+	return snd_soc_dapm_add_routes(dapm, omap3pandora_in_map,
 		ARRAY_SIZE(omap3pandora_in_map));
-
-	return snd_soc_dapm_sync(dapm);
 }
 
 static struct snd_soc_ops omap3pandora_ops = {
diff --git a/sound/soc/omap/osk5912.c b/sound/soc/omap/osk5912.c
index 5978332..18f8a2d 100644
--- a/sound/soc/omap/osk5912.c
+++ b/sound/soc/omap/osk5912.c
@@ -107,8 +107,6 @@ static int osk_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd)
 	snd_soc_dapm_enable_pin(dapm, "Line In");
 	snd_soc_dapm_enable_pin(dapm, "Mic Jack");
 
-	snd_soc_dapm_sync(dapm);
-
 	return 0;
 }
 
diff --git a/sound/soc/omap/rx51.c b/sound/soc/omap/rx51.c
index 7164db5..a568423 100644
--- a/sound/soc/omap/rx51.c
+++ b/sound/soc/omap/rx51.c
@@ -317,8 +317,6 @@ static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd)
 	if (err < 0)
 		return err;
 
-	snd_soc_dapm_sync(dapm);
-
 	/* AV jack detection */
 	err = snd_soc_jack_new(codec, "AV Jack",
 			       SND_JACK_HEADSET | SND_JACK_VIDEOOUT,
diff --git a/sound/soc/omap/sdp3430.c b/sound/soc/omap/sdp3430.c
index 269aded..85e2e918 100644
--- a/sound/soc/omap/sdp3430.c
+++ b/sound/soc/omap/sdp3430.c
@@ -159,10 +159,6 @@ static int sdp3430_twl4030_init(struct snd_soc_pcm_runtime *rtd)
 	snd_soc_dapm_nc_pin(dapm, "CARKITL");
 	snd_soc_dapm_nc_pin(dapm, "CARKITR");
 
-	ret = snd_soc_dapm_sync(dapm);
-	if (ret)
-		return ret;
-
 	/* Headset jack detection */
 	ret = snd_soc_jack_new(codec, "Headset Jack",
 				SND_JACK_HEADSET, &hs_jack);
diff --git a/sound/soc/omap/sdp4430.c b/sound/soc/omap/sdp4430.c
index 79ec76d..98f05dc 100644
--- a/sound/soc/omap/sdp4430.c
+++ b/sound/soc/omap/sdp4430.c
@@ -140,10 +140,6 @@ static int sdp4430_twl6040_init(struct snd_soc_pcm_runtime *rtd)
 	snd_soc_dapm_enable_pin(dapm, "Headset Mic");
 	snd_soc_dapm_enable_pin(dapm, "Headset Stereophone");
 
-	ret = snd_soc_dapm_sync(dapm);
-	if (ret)
-		return ret;
-
 	/*
 	 * Configure McPDM offset cancellation based on the HSOTRIM value from
 	 * twl6040.
diff --git a/sound/soc/omap/zoom2.c b/sound/soc/omap/zoom2.c
index 8b1ebbc..9a8288d 100644
--- a/sound/soc/omap/zoom2.c
+++ b/sound/soc/omap/zoom2.c
@@ -126,9 +126,7 @@ static int zoom2_twl4030_init(struct snd_soc_pcm_runtime *rtd)
 	snd_soc_dapm_nc_pin(dapm, "CARKITL");
 	snd_soc_dapm_nc_pin(dapm, "CARKITR");
 
-	ret = snd_soc_dapm_sync(dapm);
-
-	return ret;
+	return 0;
 }
 
 static int zoom2_twl4030_voice_init(struct snd_soc_pcm_runtime *rtd)
-- 
1.7.7

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* [PATCH v2 2/9] ASoC: am3517evm: Let core to deal with the DAPM widgets
  2011-10-10 12:34 [PATCH v2 0/9] ASoC: OMAP machine driver cleanups Peter Ujfalusi
  2011-10-10 12:34 ` [PATCH v2 1/9] ASoC: OMAP machines: Remove soc_dapm_sync() call from init Peter Ujfalusi
@ 2011-10-10 12:34 ` Peter Ujfalusi
  2011-10-10 12:34 ` [PATCH v2 3/9] ASoC: n810: Let the core to register DAPM widgets/routes and controls Peter Ujfalusi
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Peter Ujfalusi @ 2011-10-10 12:34 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: Anuj Aggarwal, alsa-devel

Pass the DAPM widgets/routes via the snd_soc_card struct
to core. With this change we do not need the init function
since the remaining snd_soc_dapm_enable_pin calls are
not needed.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Anuj Aggarwal <anuj.aggarwal@ti.com>
---
 sound/soc/omap/am3517evm.c |   26 +++++---------------------
 1 files changed, 5 insertions(+), 21 deletions(-)

diff --git a/sound/soc/omap/am3517evm.c b/sound/soc/omap/am3517evm.c
index f5a4d65..8da55e9 100644
--- a/sound/soc/omap/am3517evm.c
+++ b/sound/soc/omap/am3517evm.c
@@ -90,26 +90,6 @@ static const struct snd_soc_dapm_route audio_map[] = {
 	{"MICIN", NULL, "Mic In"},
 };
 
-static int am3517evm_aic23_init(struct snd_soc_pcm_runtime *rtd)
-{
-	struct snd_soc_codec *codec = rtd->codec;
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-	/* Add am3517-evm specific widgets */
-	snd_soc_dapm_new_controls(dapm, tlv320aic23_dapm_widgets,
-				  ARRAY_SIZE(tlv320aic23_dapm_widgets));
-
-	/* Set up davinci-evm specific audio path audio_map */
-	snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
-
-	/* always connected */
-	snd_soc_dapm_enable_pin(dapm, "Line Out");
-	snd_soc_dapm_enable_pin(dapm, "Line In");
-	snd_soc_dapm_enable_pin(dapm, "Mic In");
-
-	return 0;
-}
-
 /* Digital audio interface glue - connects codec <--> CPU */
 static struct snd_soc_dai_link am3517evm_dai = {
 	.name = "TLV320AIC23",
@@ -120,7 +100,6 @@ static struct snd_soc_dai_link am3517evm_dai = {
 	.codec_name = "tlv320aic23-codec.2-001a",
 	.dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_NB_NF |
 		   SND_SOC_DAIFMT_CBM_CFM,
-	.init = am3517evm_aic23_init,
 	.ops = &am3517evm_ops,
 };
 
@@ -129,6 +108,11 @@ static struct snd_soc_card snd_soc_am3517evm = {
 	.name = "am3517evm",
 	.dai_link = &am3517evm_dai,
 	.num_links = 1,
+
+	.dapm_widgets = tlv320aic23_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(tlv320aic23_dapm_widgets),
+	.dapm_routes = audio_map,
+	.num_dapm_routes = ARRAY_SIZE(audio_map),
 };
 
 static struct platform_device *am3517evm_snd_device;
-- 
1.7.7

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

* [PATCH v2 3/9] ASoC: n810: Let the core to register DAPM widgets/routes and controls
  2011-10-10 12:34 [PATCH v2 0/9] ASoC: OMAP machine driver cleanups Peter Ujfalusi
  2011-10-10 12:34 ` [PATCH v2 1/9] ASoC: OMAP machines: Remove soc_dapm_sync() call from init Peter Ujfalusi
  2011-10-10 12:34 ` [PATCH v2 2/9] ASoC: am3517evm: Let core to deal with the DAPM widgets Peter Ujfalusi
@ 2011-10-10 12:34 ` Peter Ujfalusi
  2011-10-10 12:34 ` [PATCH v2 4/9] ASoC: osk5912: Let core to deal with the DAPM widgets Peter Ujfalusi
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Peter Ujfalusi @ 2011-10-10 12:34 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, Jarkko Nikula

Pass the DAPM widgets/routes and static controls via the
snd_soc_card struct to core. In this way the machine driver
does not need to handle the DAPM widgets/routes.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Jarkko Nikula <jarkko.nikula@bitmer.com>
---
 sound/soc/omap/n810.c |   21 ++++++++-------------
 1 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c
index 4fa881b..7e3c20c 100644
--- a/sound/soc/omap/n810.c
+++ b/sound/soc/omap/n810.c
@@ -257,7 +257,6 @@ static int n810_aic33_init(struct snd_soc_pcm_runtime *rtd)
 {
 	struct snd_soc_codec *codec = rtd->codec;
 	struct snd_soc_dapm_context *dapm = &codec->dapm;
-	int err;
 
 	/* Not connected */
 	snd_soc_dapm_nc_pin(dapm, "MONO_LOUT");
@@ -269,18 +268,7 @@ static int n810_aic33_init(struct snd_soc_pcm_runtime *rtd)
 	snd_soc_dapm_nc_pin(dapm, "LINE2L");
 	snd_soc_dapm_nc_pin(dapm, "LINE2R");
 
-	/* Add N810 specific controls */
-	err = snd_soc_add_controls(codec, aic33_n810_controls,
-				ARRAY_SIZE(aic33_n810_controls));
-	if (err < 0)
-		return err;
-
-	/* Add N810 specific widgets */
-	snd_soc_dapm_new_controls(dapm, aic33_dapm_widgets,
-				  ARRAY_SIZE(aic33_dapm_widgets));
-
-	/* Set up N810 specific audio path audio_map */
-	return snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
+	return 0;
 }
 
 /* Digital audio interface glue - connects codec <--> CPU */
@@ -302,6 +290,13 @@ static struct snd_soc_card snd_soc_n810 = {
 	.name = "N810",
 	.dai_link = &n810_dai,
 	.num_links = 1,
+
+	.controls = aic33_n810_controls,
+	.num_controls = ARRAY_SIZE(aic33_n810_controls),
+	.dapm_widgets = aic33_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(aic33_dapm_widgets),
+	.dapm_routes = audio_map,
+	.num_dapm_routes = ARRAY_SIZE(audio_map),
 };
 
 static struct platform_device *n810_snd_device;
-- 
1.7.7

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

* [PATCH v2 4/9] ASoC: osk5912: Let core to deal with the DAPM widgets
  2011-10-10 12:34 [PATCH v2 0/9] ASoC: OMAP machine driver cleanups Peter Ujfalusi
                   ` (2 preceding siblings ...)
  2011-10-10 12:34 ` [PATCH v2 3/9] ASoC: n810: Let the core to register DAPM widgets/routes and controls Peter Ujfalusi
@ 2011-10-10 12:34 ` Peter Ujfalusi
  2011-10-10 12:34 ` [PATCH v2 5/9] ASoC: sdp3430: " Peter Ujfalusi
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Peter Ujfalusi @ 2011-10-10 12:34 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel

Pass the DAPM widgets/routes via the snd_soc_card struct
to core. With this change we do not need the init function
since the remaining snd_soc_dapm_enable_pin calls are
not needed.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/omap/osk5912.c |   25 +++++--------------------
 1 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/sound/soc/omap/osk5912.c b/sound/soc/omap/osk5912.c
index 18f8a2d..db91cca 100644
--- a/sound/soc/omap/osk5912.c
+++ b/sound/soc/omap/osk5912.c
@@ -91,25 +91,6 @@ static const struct snd_soc_dapm_route audio_map[] = {
 	{"MICIN", NULL, "Mic Jack"},
 };
 
-static int osk_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd)
-{
-	struct snd_soc_codec *codec = rtd->codec;
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-	/* Add osk5912 specific widgets */
-	snd_soc_dapm_new_controls(dapm, tlv320aic23_dapm_widgets,
-				  ARRAY_SIZE(tlv320aic23_dapm_widgets));
-
-	/* Set up osk5912 specific audio path audio_map */
-	snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
-
-	snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
-	snd_soc_dapm_enable_pin(dapm, "Line In");
-	snd_soc_dapm_enable_pin(dapm, "Mic Jack");
-
-	return 0;
-}
-
 /* Digital audio interface glue - connects codec <--> CPU */
 static struct snd_soc_dai_link osk_dai = {
 	.name = "TLV320AIC23",
@@ -120,7 +101,6 @@ static struct snd_soc_dai_link osk_dai = {
 	.codec_name = "tlv320aic23-codec",
 	.dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_NB_NF |
 		   SND_SOC_DAIFMT_CBM_CFM,
-	.init = osk_tlv320aic23_init,
 	.ops = &osk_ops,
 };
 
@@ -129,6 +109,11 @@ static struct snd_soc_card snd_soc_card_osk = {
 	.name = "OSK5912",
 	.dai_link = &osk_dai,
 	.num_links = 1,
+
+	.dapm_widgets = tlv320aic23_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(tlv320aic23_dapm_widgets),
+	.dapm_routes = audio_map,
+	.num_dapm_routes = ARRAY_SIZE(audio_map),
 };
 
 static struct platform_device *osk_snd_device;
-- 
1.7.7

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

* [PATCH v2 5/9] ASoC: sdp3430: Let core to deal with the DAPM widgets
  2011-10-10 12:34 [PATCH v2 0/9] ASoC: OMAP machine driver cleanups Peter Ujfalusi
                   ` (3 preceding siblings ...)
  2011-10-10 12:34 ` [PATCH v2 4/9] ASoC: osk5912: Let core to deal with the DAPM widgets Peter Ujfalusi
@ 2011-10-10 12:34 ` Peter Ujfalusi
  2011-10-10 12:34 ` [PATCH v2 6/9] ASoC: zoom2: " Peter Ujfalusi
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Peter Ujfalusi @ 2011-10-10 12:34 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, Misael Lopez Cruz

Pass the DAPM widgets/routes via the snd_soc_card struct
to core.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Misael Lopez Cruz <misael.lopez@ti.com>
---
 sound/soc/omap/sdp3430.c |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/sound/soc/omap/sdp3430.c b/sound/soc/omap/sdp3430.c
index 85e2e918..4f1969d 100644
--- a/sound/soc/omap/sdp3430.c
+++ b/sound/soc/omap/sdp3430.c
@@ -129,15 +129,6 @@ static int sdp3430_twl4030_init(struct snd_soc_pcm_runtime *rtd)
 	struct snd_soc_dapm_context *dapm = &codec->dapm;
 	int ret;
 
-	/* Add SDP3430 specific widgets */
-	ret = snd_soc_dapm_new_controls(dapm, sdp3430_twl4030_dapm_widgets,
-				ARRAY_SIZE(sdp3430_twl4030_dapm_widgets));
-	if (ret)
-		return ret;
-
-	/* Set up SDP3430 specific audio path audio_map */
-	snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
-
 	/* SDP3430 connected pins */
 	snd_soc_dapm_enable_pin(dapm, "Ext Mic");
 	snd_soc_dapm_enable_pin(dapm, "Ext Spk");
@@ -223,6 +214,11 @@ static struct snd_soc_card snd_soc_sdp3430 = {
 	.name = "SDP3430",
 	.dai_link = sdp3430_dai,
 	.num_links = ARRAY_SIZE(sdp3430_dai),
+
+	.dapm_widgets = sdp3430_twl4030_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(sdp3430_twl4030_dapm_widgets),
+	.dapm_routes = audio_map,
+	.num_dapm_routes = ARRAY_SIZE(audio_map),
 };
 
 static struct platform_device *sdp3430_snd_device;
-- 
1.7.7

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

* [PATCH v2 6/9] ASoC: zoom2: Let core to deal with the DAPM widgets
  2011-10-10 12:34 [PATCH v2 0/9] ASoC: OMAP machine driver cleanups Peter Ujfalusi
                   ` (4 preceding siblings ...)
  2011-10-10 12:34 ` [PATCH v2 5/9] ASoC: sdp3430: " Peter Ujfalusi
@ 2011-10-10 12:34 ` Peter Ujfalusi
  2011-10-10 12:34 ` [PATCH v2 7/9] ASoC: zoom2: No need to call dapm_pin_enable at init time Peter Ujfalusi
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Peter Ujfalusi @ 2011-10-10 12:34 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, Misael Lopez Cruz

Pass the DAPM widgets/routes via the snd_soc_card struct
to core.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Misael Lopez Cruz <misael.lopez@ti.com>
---
 sound/soc/omap/zoom2.c |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/sound/soc/omap/zoom2.c b/sound/soc/omap/zoom2.c
index 9a8288d..4d01e16 100644
--- a/sound/soc/omap/zoom2.c
+++ b/sound/soc/omap/zoom2.c
@@ -98,16 +98,6 @@ static int zoom2_twl4030_init(struct snd_soc_pcm_runtime *rtd)
 {
 	struct snd_soc_codec *codec = rtd->codec;
 	struct snd_soc_dapm_context *dapm = &codec->dapm;
-	int ret;
-
-	/* Add Zoom2 specific widgets */
-	ret = snd_soc_dapm_new_controls(dapm, zoom2_twl4030_dapm_widgets,
-				ARRAY_SIZE(zoom2_twl4030_dapm_widgets));
-	if (ret)
-		return ret;
-
-	/* Set up Zoom2 specific audio path audio_map */
-	snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
 
 	/* Zoom2 connected pins */
 	snd_soc_dapm_enable_pin(dapm, "Ext Mic");
@@ -175,6 +165,11 @@ static struct snd_soc_card snd_soc_zoom2 = {
 	.name = "Zoom2",
 	.dai_link = zoom2_dai,
 	.num_links = ARRAY_SIZE(zoom2_dai),
+
+	.dapm_widgets = zoom2_twl4030_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(zoom2_twl4030_dapm_widgets),
+	.dapm_routes = audio_map,
+	.num_dapm_routes = ARRAY_SIZE(audio_map),
 };
 
 static struct platform_device *zoom2_snd_device;
-- 
1.7.7

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

* [PATCH v2 7/9] ASoC: zoom2: No need to call dapm_pin_enable at init time
  2011-10-10 12:34 [PATCH v2 0/9] ASoC: OMAP machine driver cleanups Peter Ujfalusi
                   ` (5 preceding siblings ...)
  2011-10-10 12:34 ` [PATCH v2 6/9] ASoC: zoom2: " Peter Ujfalusi
@ 2011-10-10 12:34 ` Peter Ujfalusi
  2011-10-10 12:34 ` [PATCH v2 8/9] ASoC: sdp4430: Let core to deal with the DAPM widgets Peter Ujfalusi
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Peter Ujfalusi @ 2011-10-10 12:34 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, Misael Lopez Cruz

Widgets are connected by default.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Misael Lopez Cruz <misael.lopez@ti.com>
---
 sound/soc/omap/zoom2.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/sound/soc/omap/zoom2.c b/sound/soc/omap/zoom2.c
index 4d01e16..7cf35c8 100644
--- a/sound/soc/omap/zoom2.c
+++ b/sound/soc/omap/zoom2.c
@@ -99,13 +99,6 @@ static int zoom2_twl4030_init(struct snd_soc_pcm_runtime *rtd)
 	struct snd_soc_codec *codec = rtd->codec;
 	struct snd_soc_dapm_context *dapm = &codec->dapm;
 
-	/* Zoom2 connected pins */
-	snd_soc_dapm_enable_pin(dapm, "Ext Mic");
-	snd_soc_dapm_enable_pin(dapm, "Ext Spk");
-	snd_soc_dapm_enable_pin(dapm, "Headset Mic");
-	snd_soc_dapm_enable_pin(dapm, "Headset Stereophone");
-	snd_soc_dapm_enable_pin(dapm, "Aux In");
-
 	/* TWL4030 not connected pins */
 	snd_soc_dapm_nc_pin(dapm, "CARKITMIC");
 	snd_soc_dapm_nc_pin(dapm, "DIGIMIC0");
-- 
1.7.7

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

* [PATCH v2 8/9] ASoC: sdp4430: Let core to deal with the DAPM widgets
  2011-10-10 12:34 [PATCH v2 0/9] ASoC: OMAP machine driver cleanups Peter Ujfalusi
                   ` (6 preceding siblings ...)
  2011-10-10 12:34 ` [PATCH v2 7/9] ASoC: zoom2: No need to call dapm_pin_enable at init time Peter Ujfalusi
@ 2011-10-10 12:34 ` Peter Ujfalusi
  2011-10-10 12:34 ` [PATCH v2 9/9] ASoC: sdp4430: No need to call dapm_pin_enable at init time Peter Ujfalusi
  2011-10-10 15:18 ` [PATCH v2 0/9] ASoC: OMAP machine driver cleanups Mark Brown
  9 siblings, 0 replies; 11+ messages in thread
From: Peter Ujfalusi @ 2011-10-10 12:34 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, Misael Lopez Cruz

Pass the DAPM widgets/routes via the snd_soc_card struct
to core.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Misael Lopez Cruz <misael.lopez@ti.com>
---
 sound/soc/omap/sdp4430.c |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/sound/soc/omap/sdp4430.c b/sound/soc/omap/sdp4430.c
index 98f05dc..ebe1bbb 100644
--- a/sound/soc/omap/sdp4430.c
+++ b/sound/soc/omap/sdp4430.c
@@ -123,15 +123,6 @@ static int sdp4430_twl6040_init(struct snd_soc_pcm_runtime *rtd)
 	struct snd_soc_dapm_context *dapm = &codec->dapm;
 	int ret, hs_trim;
 
-	/* Add SDP4430 specific widgets */
-	ret = snd_soc_dapm_new_controls(dapm, sdp4430_twl6040_dapm_widgets,
-				ARRAY_SIZE(sdp4430_twl6040_dapm_widgets));
-	if (ret)
-		return ret;
-
-	/* Set up SDP4430 specific audio path audio_map */
-	snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
-
 	/* SDP4430 connected pins */
 	snd_soc_dapm_enable_pin(dapm, "Ext Mic");
 	snd_soc_dapm_enable_pin(dapm, "Ext Spk");
@@ -182,6 +173,11 @@ static struct snd_soc_card snd_soc_sdp4430 = {
 	.name = "SDP4430",
 	.dai_link = &sdp4430_dai,
 	.num_links = 1,
+
+	.dapm_widgets = sdp4430_twl6040_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(sdp4430_twl6040_dapm_widgets),
+	.dapm_routes = audio_map,
+	.num_dapm_routes = ARRAY_SIZE(audio_map),
 };
 
 static struct platform_device *sdp4430_snd_device;
-- 
1.7.7

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

* [PATCH v2 9/9] ASoC: sdp4430: No need to call dapm_pin_enable at init time
  2011-10-10 12:34 [PATCH v2 0/9] ASoC: OMAP machine driver cleanups Peter Ujfalusi
                   ` (7 preceding siblings ...)
  2011-10-10 12:34 ` [PATCH v2 8/9] ASoC: sdp4430: Let core to deal with the DAPM widgets Peter Ujfalusi
@ 2011-10-10 12:34 ` Peter Ujfalusi
  2011-10-10 15:18 ` [PATCH v2 0/9] ASoC: OMAP machine driver cleanups Mark Brown
  9 siblings, 0 replies; 11+ messages in thread
From: Peter Ujfalusi @ 2011-10-10 12:34 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, Misael Lopez Cruz

Widgets are connected by default.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Misael Lopez Cruz <misael.lopez@ti.com>
---
 sound/soc/omap/sdp4430.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/sound/soc/omap/sdp4430.c b/sound/soc/omap/sdp4430.c
index ebe1bbb..cc3d792 100644
--- a/sound/soc/omap/sdp4430.c
+++ b/sound/soc/omap/sdp4430.c
@@ -120,17 +120,8 @@ static const struct snd_soc_dapm_route audio_map[] = {
 static int sdp4430_twl6040_init(struct snd_soc_pcm_runtime *rtd)
 {
 	struct snd_soc_codec *codec = rtd->codec;
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
 	int ret, hs_trim;
 
-	/* SDP4430 connected pins */
-	snd_soc_dapm_enable_pin(dapm, "Ext Mic");
-	snd_soc_dapm_enable_pin(dapm, "Ext Spk");
-	snd_soc_dapm_enable_pin(dapm, "AFML");
-	snd_soc_dapm_enable_pin(dapm, "AFMR");
-	snd_soc_dapm_enable_pin(dapm, "Headset Mic");
-	snd_soc_dapm_enable_pin(dapm, "Headset Stereophone");
-
 	/*
 	 * Configure McPDM offset cancellation based on the HSOTRIM value from
 	 * twl6040.
-- 
1.7.7

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

* Re: [PATCH v2 0/9] ASoC: OMAP machine driver cleanups
  2011-10-10 12:34 [PATCH v2 0/9] ASoC: OMAP machine driver cleanups Peter Ujfalusi
                   ` (8 preceding siblings ...)
  2011-10-10 12:34 ` [PATCH v2 9/9] ASoC: sdp4430: No need to call dapm_pin_enable at init time Peter Ujfalusi
@ 2011-10-10 15:18 ` Mark Brown
  9 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2011-10-10 15:18 UTC (permalink / raw)
  To: Peter Ujfalusi; +Cc: alsa-devel, Liam Girdwood

On Mon, Oct 10, 2011 at 03:34:07PM +0300, Peter Ujfalusi wrote:

> Some cleanups for the OMAP ASoC machine drivers:
> - do not call soc_dapm_sync from dai_link->init callback since it is useless
> - Convert drivers to use table based DAPM initialization
> - Remove dapm_enable_pin calls from dai_link->init callback since pins are
>   enabled by default

Applied all, thanks.

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

end of thread, other threads:[~2011-10-10 15:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-10 12:34 [PATCH v2 0/9] ASoC: OMAP machine driver cleanups Peter Ujfalusi
2011-10-10 12:34 ` [PATCH v2 1/9] ASoC: OMAP machines: Remove soc_dapm_sync() call from init Peter Ujfalusi
2011-10-10 12:34 ` [PATCH v2 2/9] ASoC: am3517evm: Let core to deal with the DAPM widgets Peter Ujfalusi
2011-10-10 12:34 ` [PATCH v2 3/9] ASoC: n810: Let the core to register DAPM widgets/routes and controls Peter Ujfalusi
2011-10-10 12:34 ` [PATCH v2 4/9] ASoC: osk5912: Let core to deal with the DAPM widgets Peter Ujfalusi
2011-10-10 12:34 ` [PATCH v2 5/9] ASoC: sdp3430: " Peter Ujfalusi
2011-10-10 12:34 ` [PATCH v2 6/9] ASoC: zoom2: " Peter Ujfalusi
2011-10-10 12:34 ` [PATCH v2 7/9] ASoC: zoom2: No need to call dapm_pin_enable at init time Peter Ujfalusi
2011-10-10 12:34 ` [PATCH v2 8/9] ASoC: sdp4430: Let core to deal with the DAPM widgets Peter Ujfalusi
2011-10-10 12:34 ` [PATCH v2 9/9] ASoC: sdp4430: No need to call dapm_pin_enable at init time Peter Ujfalusi
2011-10-10 15:18 ` [PATCH v2 0/9] ASoC: OMAP machine driver cleanups Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox