All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Liam Girdwood <lrg@slimlogic.co.uk>
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	Lars-Peter Clausen <lars@metafoo.de>
Subject: [PATCH 4/7] ASoC: neo1973_gta02_wm8753: Remove lm4853_{set,get}_state
Date: Mon,  7 Feb 2011 00:04:20 +0100	[thread overview]
Message-ID: <1297033463-14577-4-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1297033463-14577-1-git-send-email-lars@metafoo.de>

This patch drops the lm4853_{set,get}_state functions and the "Amp State Switch"
control.
Those were noops which existed to maintain alsa state file compatibility. Since
the control names have changed due to internal changes in the ASoC core and
state file compatibility was broken anyway it makes sense to drop them.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/samsung/neo1973_gta02_wm8753.c |   55 ++++--------------------------
 1 files changed, 7 insertions(+), 48 deletions(-)

diff --git a/sound/soc/samsung/neo1973_gta02_wm8753.c b/sound/soc/samsung/neo1973_gta02_wm8753.c
index 95ebf81..b007dd79 100644
--- a/sound/soc/samsung/neo1973_gta02_wm8753.c
+++ b/sound/soc/samsung/neo1973_gta02_wm8753.c
@@ -194,47 +194,14 @@ static struct snd_soc_ops neo1973_gta02_voice_ops = {
 	.hw_free = neo1973_gta02_voice_hw_free,
 };
 
-#define LM4853_AMP 1
-#define LM4853_SPK 2
-
-static u8 lm4853_state;
-
-/* This has no effect, it exists only to maintain compatibility with
- * existing ALSA state files.
- */
-static int lm4853_set_state(struct snd_kcontrol *kcontrol,
-	struct snd_ctl_elem_value *ucontrol)
-{
-	int val = ucontrol->value.integer.value[0];
-
-	if (val)
-		lm4853_state |= LM4853_AMP;
-	else
-		lm4853_state &= ~LM4853_AMP;
-
-	return 0;
-}
-
-static int lm4853_get_state(struct snd_kcontrol *kcontrol,
-	struct snd_ctl_elem_value *ucontrol)
-{
-	ucontrol->value.integer.value[0] = lm4853_state & LM4853_AMP;
-
-	return 0;
-}
+static int gta02_speaker_enabled;
 
 static int lm4853_set_spk(struct snd_kcontrol *kcontrol,
 	struct snd_ctl_elem_value *ucontrol)
 {
-	int val = ucontrol->value.integer.value[0];
-
-	if (val) {
-		lm4853_state |= LM4853_SPK;
-		gpio_set_value(GTA02_GPIO_HP_IN, 0);
-	} else {
-		lm4853_state &= ~LM4853_SPK;
-		gpio_set_value(GTA02_GPIO_HP_IN, 1);
-	}
+	gta02_speaker_enabled = ucontrol->value.integer.value[0];
+
+	gpio_set_value(GTA02_GPIO_HP_IN, !gta02_speaker_enabled);
 
 	return 0;
 }
@@ -242,14 +209,12 @@ static int lm4853_set_spk(struct snd_kcontrol *kcontrol,
 static int lm4853_get_spk(struct snd_kcontrol *kcontrol,
 	struct snd_ctl_elem_value *ucontrol)
 {
-	ucontrol->value.integer.value[0] = (lm4853_state & LM4853_SPK) >> 1;
-
+	ucontrol->value.integer.value[0] = gta02_speaker_enabled;
 	return 0;
 }
 
 static int lm4853_event(struct snd_soc_dapm_widget *w,
-			struct snd_kcontrol *k,
-			int event)
+			struct snd_kcontrol *k, int event)
 {
 	gpio_set_value(GTA02_GPIO_AMP_SHUT, SND_SOC_DAPM_EVENT_OFF(event));
 
@@ -304,13 +269,7 @@ static const struct snd_kcontrol_new wm8753_neo1973_gta02_controls[] = {
 	SOC_DAPM_PIN_SWITCH("Handset Mic"),
 	SOC_DAPM_PIN_SWITCH("Handset Spk"),
 
-	/* This has no effect, it exists only to maintain compatibility with
-	 * existing ALSA state files.
-	 */
-	SOC_SINGLE_EXT("Amp State Switch", 6, 0, 1, 0,
-		lm4853_get_state,
-		lm4853_set_state),
-	SOC_SINGLE_EXT("Amp Spk Switch", 7, 0, 1, 0,
+	SOC_SINGLE_BOOL_EXT("Amp Spk Switch", 0,
 		lm4853_get_spk,
 		lm4853_set_spk),
 };
-- 
1.7.2.3


  parent reply	other threads:[~2011-02-06 23:03 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-06 23:04 [PATCH 1/7] ASoC: neo1973_wm8753: Remove scenario management code Lars-Peter Clausen
2011-02-06 23:04 ` [PATCH 2/7] ASoC: neo1973_wm8753: Move lm4857 specefic code to its own module Lars-Peter Clausen
2011-02-06 23:04   ` Lars-Peter Clausen
2011-02-07 11:50   ` Mark Brown
2011-02-07 11:50     ` Mark Brown
2011-02-06 23:04 ` [PATCH 3/7] ASoC: codecs: lm4857: Use dev_pm_ops Lars-Peter Clausen
2011-02-06 23:04   ` Lars-Peter Clausen
2011-02-06 23:04 ` Lars-Peter Clausen [this message]
2011-02-06 23:04 ` [PATCH 5/7] ASoC: Samsung: neo1973: Use gpio_request_array to request gpios Lars-Peter Clausen
2011-02-06 23:04   ` Lars-Peter Clausen
2011-02-06 23:04 ` [PATCH 6/7] ASoC: Samsung: neo1973_gta02: Fix bluetooth DAI registration Lars-Peter Clausen
2011-02-07 11:59   ` Mark Brown
2011-02-07 11:59     ` Mark Brown
2011-02-07 16:53     ` Lars-Peter Clausen
2011-02-07 17:02       ` Mark Brown
2011-02-07 17:37         ` Lars-Peter Clausen
2011-02-07 17:37           ` Lars-Peter Clausen
2011-02-07 17:49           ` Mark Brown
2011-02-07 17:49             ` Mark Brown
2011-02-07 18:09             ` Lars-Peter Clausen
2011-02-07 18:09               ` Lars-Peter Clausen
2011-02-07 18:17               ` Mark Brown
2011-02-07 18:17                 ` Mark Brown
2011-02-07 22:55                 ` Adding bluetooth PCM interface support to ASoC (Was: Re: [PATCH 6/7] ASoC: Samsung: neo1973_gta02: Fix bluetooth DAI registration) Lars-Peter Clausen
2011-02-07 22:55                   ` Lars-Peter Clausen
2011-02-08 13:08                   ` Mark Brown
2011-02-08 13:08                     ` Mark Brown
2011-02-06 23:04 ` [PATCH 7/7] ASoC: Samsung: Merge neo1937 and neo1973_gta02 sound board driver Lars-Peter Clausen
2011-02-07  2:25 ` [alsa-devel] [PATCH 1/7] ASoC: neo1973_wm8753: Remove scenario management code Jassi Brar
2011-02-07 11:42 ` Mark Brown
2011-02-07 11:42   ` Mark Brown
2011-02-07 17:01   ` Lars-Peter Clausen
2011-02-07 17:01     ` Lars-Peter Clausen

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=1297033463-14577-4-git-send-email-lars@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    /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.