alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Lu Guanqun <guanqun.lu@intel.com>
To: alsa-devel@alsa-project.org
Cc: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Takashi Iwai <tiwai@suse.de>, Lu Guanqun <guanqun.lu@intel.com>,
	Ian Lartey <ian@opensource.wolfsonmicro.com>,
	Liam Girdwood <lrg@slimlogic.co.uk>
Subject: [PATCH 05/11] ASoC: Use data based init for wm9713 DAPM
Date: Wed, 30 Mar 2011 21:53:11 +0800	[thread overview]
Message-ID: <1301493197-8673-5-git-send-email-guanqun.lu@intel.com> (raw)
In-Reply-To: <1301493197-8673-1-git-send-email-guanqun.lu@intel.com>

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

  parent reply	other threads:[~2011-03-30 13:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Lu Guanqun [this message]
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

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=1301493197-8673-5-git-send-email-guanqun.lu@intel.com \
    --to=guanqun.lu@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dp@opensource.wolfsonmicro.com \
    --cc=ian@opensource.wolfsonmicro.com \
    --cc=lrg@slimlogic.co.uk \
    --cc=tiwai@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).