All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lgirdwood@gmail.com>
Subject: [PATCH 026/102] ASoC: wm8991: Fix the wrong number of enum items
Date: Tue, 18 Feb 2014 12:37:01 +0100	[thread overview]
Message-ID: <1392723422-12689-11-git-send-email-tiwai@suse.de> (raw)
In-Reply-To: <1392723422-12689-1-git-send-email-tiwai@suse.de>

wm8991 codec driver has a few places wrongly defining the number of
enum items.

Use SOC_ENUM_SINGLE_DECL() macro and they are automatically fixed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/codecs/wm8991.c | 41 +++++++++++++++++++----------------------
 1 file changed, 19 insertions(+), 22 deletions(-)

diff --git a/sound/soc/codecs/wm8991.c b/sound/soc/codecs/wm8991.c
index 244eb09ffa43..32d219570cca 100644
--- a/sound/soc/codecs/wm8991.c
+++ b/sound/soc/codecs/wm8991.c
@@ -171,26 +171,23 @@ static int wm899x_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol,
 static const char *wm8991_digital_sidetone[] =
 {"None", "Left ADC", "Right ADC", "Reserved"};
 
-static const struct soc_enum wm8991_left_digital_sidetone_enum =
-	SOC_ENUM_SINGLE(WM8991_DIGITAL_SIDE_TONE,
-			WM8991_ADC_TO_DACL_SHIFT,
-			WM8991_ADC_TO_DACL_MASK,
-			wm8991_digital_sidetone);
-
-static const struct soc_enum wm8991_right_digital_sidetone_enum =
-	SOC_ENUM_SINGLE(WM8991_DIGITAL_SIDE_TONE,
-			WM8991_ADC_TO_DACR_SHIFT,
-			WM8991_ADC_TO_DACR_MASK,
-			wm8991_digital_sidetone);
+static SOC_ENUM_SINGLE_DECL(wm8991_left_digital_sidetone_enum,
+			    WM8991_DIGITAL_SIDE_TONE,
+			    WM8991_ADC_TO_DACL_SHIFT,
+			    wm8991_digital_sidetone);
+
+static SOC_ENUM_SINGLE_DECL(wm8991_right_digital_sidetone_enum,
+			    WM8991_DIGITAL_SIDE_TONE,
+			    WM8991_ADC_TO_DACR_SHIFT,
+			    wm8991_digital_sidetone);
 
 static const char *wm8991_adcmode[] =
 {"Hi-fi mode", "Voice mode 1", "Voice mode 2", "Voice mode 3"};
 
-static const struct soc_enum wm8991_right_adcmode_enum =
-	SOC_ENUM_SINGLE(WM8991_ADC_CTRL,
-			WM8991_ADC_HPF_CUT_SHIFT,
-			WM8991_ADC_HPF_CUT_MASK,
-			wm8991_adcmode);
+static SOC_ENUM_SINGLE_DECL(wm8991_right_adcmode_enum,
+			    WM8991_ADC_CTRL,
+			    WM8991_ADC_HPF_CUT_SHIFT,
+			    wm8991_adcmode);
 
 static const struct snd_kcontrol_new wm8991_snd_controls[] = {
 	/* INMIXL */
@@ -486,9 +483,9 @@ static const struct snd_kcontrol_new wm8991_dapm_inmixr_controls[] = {
 static const char *wm8991_ainlmux[] =
 {"INMIXL Mix", "RXVOICE Mix", "DIFFINL Mix"};
 
-static const struct soc_enum wm8991_ainlmux_enum =
-	SOC_ENUM_SINGLE(WM8991_INPUT_MIXER1, WM8991_AINLMODE_SHIFT,
-			ARRAY_SIZE(wm8991_ainlmux), wm8991_ainlmux);
+static SOC_ENUM_SINGLE_DECL(wm8991_ainlmux_enum,
+			    WM8991_INPUT_MIXER1, WM8991_AINLMODE_SHIFT,
+			    wm8991_ainlmux);
 
 static const struct snd_kcontrol_new wm8991_dapm_ainlmux_controls =
 	SOC_DAPM_ENUM("Route", wm8991_ainlmux_enum);
@@ -499,9 +496,9 @@ static const struct snd_kcontrol_new wm8991_dapm_ainlmux_controls =
 static const char *wm8991_ainrmux[] =
 {"INMIXR Mix", "RXVOICE Mix", "DIFFINR Mix"};
 
-static const struct soc_enum wm8991_ainrmux_enum =
-	SOC_ENUM_SINGLE(WM8991_INPUT_MIXER1, WM8991_AINRMODE_SHIFT,
-			ARRAY_SIZE(wm8991_ainrmux), wm8991_ainrmux);
+static SOC_ENUM_SINGLE_DECL(wm8991_ainrmux_enum,
+			    WM8991_INPUT_MIXER1, WM8991_AINRMODE_SHIFT,
+			    wm8991_ainrmux);
 
 static const struct snd_kcontrol_new wm8991_dapm_ainrmux_controls =
 	SOC_DAPM_ENUM("Route", wm8991_ainrmux_enum);
-- 
1.8.5.2

  parent reply	other threads:[~2014-02-18 11:37 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-18 11:36 [PATCH 000/102 - chunk#3] Actually fix wrong enum items Takashi Iwai
2014-02-18 11:36 ` [PATCH 017/102] ASoC: sta32x: Fix array access overflow Takashi Iwai
2014-02-19 16:46   ` Mark Brown
2014-02-18 11:36 ` [PATCH 018/102] ASoC: ad1980: Fix wrong number of items for capture source Takashi Iwai
2014-02-19 16:50   ` Mark Brown
2014-02-18 11:36 ` [PATCH 019/102] ASoC: arizona: Fix wrong number of items in enum ctls Takashi Iwai
2014-02-18 11:54   ` Takashi Iwai
2014-02-20  1:58   ` Mark Brown
2014-02-18 11:36 ` [PATCH 020/102] ASoC: isabelle: Fix the " Takashi Iwai
2014-02-19 16:53   ` Mark Brown
2014-02-18 11:36 ` [PATCH 021/102] ASoC: ssm2602: Omit superfluous elements in input select array Takashi Iwai
2014-02-18 11:59   ` Lars-Peter Clausen
2014-02-18 13:23     ` Liam Girdwood
2014-02-18 13:29       ` Takashi Iwai
2014-02-18 15:35         ` Liam Girdwood
2014-02-20  1:20   ` Mark Brown
2014-02-18 11:36 ` [PATCH 022/102] ASoC: wm8400: Fix the wrong number of enum items Takashi Iwai
2014-02-20  1:21   ` Mark Brown
2014-02-18 11:36 ` [PATCH 023/102] ASoC: wm8770: Fix " Takashi Iwai
2014-02-20  1:24   ` Mark Brown
2014-02-18 11:36 ` [PATCH 024/102] ASoC: wm8900: Fix the " Takashi Iwai
2014-02-20  1:28   ` Mark Brown
2014-02-18 11:37 ` [PATCH 025/102] ASoC: wm8990: " Takashi Iwai
2014-02-20  1:30   ` Mark Brown
2014-02-18 11:37 ` Takashi Iwai [this message]
2014-02-20  1:32   ` [PATCH 026/102] ASoC: wm8991: " Mark Brown
2014-02-18 11:37 ` [PATCH 027/102] ASoC: wm8994: " Takashi Iwai
2014-02-20  1:33   ` Mark Brown
2014-02-20  2:05 ` [PATCH 000/102 - chunk#3] Actually fix wrong " 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=1392723422-12689-11-git-send-email-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.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.