All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>
Cc: alsa-devel@alsa-project.org, Lars-Peter Clausen <lars@metafoo.de>,
	Vinod Koul <vinod.koul@intel.com>,
	patches@opensource.wolfsonmicro.com, Dan Murphy <dmurphy@ti.com>,
	Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Subject: [PATCH 4/6] ASoC: wm8737: Use table based DAPM and control setup
Date: Wed,  5 Nov 2014 10:46:34 +0100	[thread overview]
Message-ID: <1415180796-31129-4-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1415180796-31129-1-git-send-email-lars@metafoo.de>

Makes the code a bit cleaner and shorter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/codecs/wm8737.c | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/sound/soc/codecs/wm8737.c b/sound/soc/codecs/wm8737.c
index 744a422..fe41dd2b 100644
--- a/sound/soc/codecs/wm8737.c
+++ b/sound/soc/codecs/wm8737.c
@@ -277,17 +277,6 @@ static const struct snd_soc_dapm_route intercon[] = {
 	{ "AIF", NULL, "ADCR" },
 };
 
-static int wm8737_add_widgets(struct snd_soc_codec *codec)
-{
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-	snd_soc_dapm_new_controls(dapm, wm8737_dapm_widgets,
-				  ARRAY_SIZE(wm8737_dapm_widgets));
-	snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon));
-
-	return 0;
-}
-
 /* codec mclk clock divider coefficients */
 static const struct {
 	u32 mclk;
@@ -593,10 +582,6 @@ static int wm8737_probe(struct snd_soc_codec *codec)
 	/* Bias level configuration will have done an extra enable */
 	regulator_bulk_disable(ARRAY_SIZE(wm8737->supplies), wm8737->supplies);
 
-	snd_soc_add_codec_controls(codec, wm8737_snd_controls,
-			     ARRAY_SIZE(wm8737_snd_controls));
-	wm8737_add_widgets(codec);
-
 	return 0;
 
 err_enable:
@@ -617,6 +602,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8737 = {
 	.suspend	= wm8737_suspend,
 	.resume		= wm8737_resume,
 	.set_bias_level = wm8737_set_bias_level,
+
+	.controls = wm8737_snd_controls,
+	.num_controls = ARRAY_SIZE(wm8737_snd_controls),
+	.dapm_widgets = wm8737_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(wm8737_dapm_widgets),
+	.dapm_routes = intercon,
+	.num_dapm_routes = ARRAY_SIZE(intercon),
 };
 
 static const struct of_device_id wm8737_of_match[] = {
-- 
1.8.0

  parent reply	other threads:[~2014-11-05  9:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-05  9:46 [PATCH 1/6] ASoC: sn95031: Use table based control setup Lars-Peter Clausen
2014-11-05  9:46 ` [PATCH 2/6] ASoC: tas2552: Use table based DAPM setup Lars-Peter Clausen
2014-11-05  9:46 ` [PATCH 3/6] ASoC: wl1273: Use table based control setup Lars-Peter Clausen
2014-11-05  9:46 ` Lars-Peter Clausen [this message]
2014-11-05 14:21   ` [PATCH 4/6] ASoC: wm8737: Use table based DAPM and " Charles Keepax
2014-11-05  9:46 ` [PATCH 5/6] ASoC: wm8961: " Lars-Peter Clausen
2014-11-05 14:22   ` Charles Keepax
2014-11-05  9:46 ` [PATCH 6/6] ASoC: wm8995: " Lars-Peter Clausen
2014-11-05 14:22   ` Charles Keepax
2014-11-05 12:12 ` [PATCH 1/6] ASoC: sn95031: Use table based " Vinod Koul
2014-11-05 14:50 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1415180796-31129-4-git-send-email-lars@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.wolfsonmicro.com \
    --cc=dmurphy@ti.com \
    --cc=lgirdwood@gmail.com \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.