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>,
	Peter Hsiang <Peter.Hsiang@maxim-ic.com>,
	Liam Girdwood <lrg@slimlogic.co.uk>
Subject: [PATCH 04/11] ASoC: Use data based init for max98088 DAPM
Date: Wed, 30 Mar 2011 21:53:10 +0800	[thread overview]
Message-ID: <1301493197-8673-4-git-send-email-guanqun.lu@intel.com> (raw)
In-Reply-To: <1301493197-8673-1-git-send-email-guanqun.lu@intel.com>

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

  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 ` Lu Guanqun [this message]
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

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-4-git-send-email-guanqun.lu@intel.com \
    --to=guanqun.lu@intel.com \
    --cc=Peter.Hsiang@maxim-ic.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dp@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).