aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2009-10-05 22:54:30 +0200
committerLars-Peter Clausen <lars@metafoo.de>2010-05-17 19:29:12 +0200
commit0f26ee8c6e084be7439239258b69a1585ab5a4a9 (patch)
tree77f808d2e30c5b5f99905639789cbdb9154d0177 /sound
parente40152ee1e1c7a63f4777791863215e3faa37a86 (diff)
ASoC: neo1973_gta02_wm8753: Get rid of lm4853_{set,get}_state and some minor
cleanups
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/s3c24xx/neo1973_gta02_wm8753.c51
1 files changed, 5 insertions, 46 deletions
diff --git a/sound/soc/s3c24xx/neo1973_gta02_wm8753.c b/sound/soc/s3c24xx/neo1973_gta02_wm8753.c
index dea83d30a5c..0d9fa816f72 100644
--- a/sound/soc/s3c24xx/neo1973_gta02_wm8753.c
+++ b/sound/soc/s3c24xx/neo1973_gta02_wm8753.c
@@ -205,47 +205,12 @@ 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 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);
- }
+ gpio_set_value(GTA02_GPIO_HP_IN, !val);
return 0;
}
@@ -253,7 +218,7 @@ 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] = !gpio_get_value(GTA02_GPIO_HP_IN);
return 0;
}
@@ -262,7 +227,7 @@ static int lm4853_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *k,
int event)
{
- gpio_set_value(GTA02_GPIO_AMP_SHUT, SND_SOC_DAPM_EVENT_OFF(value));
+ gpio_set_value(GTA02_GPIO_AMP_SHUT, !SND_SOC_DAPM_EVENT_ON(event));
return 0;
}
@@ -315,13 +280,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),
};
@@ -453,7 +412,7 @@ static int __init neo1973_gta02_init(void)
goto err_unregister_device;
}
- ret = gpio_direction_output(GTA02_GPIO_AMP_HP_IN, 1);
+ ret = gpio_direction_output(GTA02_GPIO_HP_IN, 1);
if (ret) {
pr_err("gta02_wm8753: Failed to configure GPIO %d\n", GTA02_GPIO_HP_IN);
goto err_free_gpio_hp_in;