aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/cs5535audio
diff options
context:
space:
mode:
authorAndres Salomon <dilinger@queued.net>2008-11-06 16:47:05 -0500
committerTakashi Iwai <tiwai@suse.de>2008-12-10 11:14:42 -0500
commit1e2232bc70b32f90109d678d1faccf6f50ebba80 (patch)
tree80ea678625eb4d041c90da63b3dbbcd2dee7b464 /sound/pci/cs5535audio
parentb91254e75c3ec4f371ce1849672a95a929d99861 (diff)
ALSA: cs5535audio: decouple HPF from V_REFOUT in OLPC code
We shouldn't be touching V_REFOUT when we toggle HPF/analog input, so just drop that code. Signed-off-by: Andres Salomon <dilinger@debian.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/cs5535audio')
-rw-r--r--sound/pci/cs5535audio/cs5535audio_olpc.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/sound/pci/cs5535audio/cs5535audio_olpc.c b/sound/pci/cs5535audio/cs5535audio_olpc.c
index 2bd6588b435..f20e7418272 100644
--- a/sound/pci/cs5535audio/cs5535audio_olpc.c
+++ b/sound/pci/cs5535audio/cs5535audio_olpc.c
@@ -30,18 +30,11 @@ static int snd_cs5535audio_ctl_get(struct snd_kcontrol *kcontrol,
30 struct snd_ctl_elem_value *ucontrol) 30 struct snd_ctl_elem_value *ucontrol)
31{ 31{
32 struct cs5535audio *cs5535au = snd_kcontrol_chip(kcontrol); 32 struct cs5535audio *cs5535au = snd_kcontrol_chip(kcontrol);
33 u16 reg1, reg2; 33 u8 val;
34 34
35 /* if either AD1888 VRef Bias and High Pass Filter are enabled 35 val = snd_ac97_read(cs5535au->ac97, AC97_AD_TEST2);
36 or the EC is not in analog mode then flag as not in analog mode. 36 val >>= AC97_AD_HPFD_SHIFT;
37 No EC command to read current analog state so we cache that. */ 37 ucontrol->value.integer.value[0] = val & 0x1;
38 reg1 = snd_ac97_read(cs5535au->ac97, AC97_AD_MISC);
39 reg2 = snd_ac97_read(cs5535au->ac97, AC97_AD_TEST2);
40
41 if ((reg1 & AD1888_VREFOUT_EN_BIT) && (reg2 & AD1888_HPF_EN_BIT))
42 ucontrol->value.integer.value[0] = 1;
43 else
44 ucontrol->value.integer.value[0] = 0;
45 38
46 return 0; 39 return 0;
47} 40}
@@ -57,16 +50,6 @@ static int snd_cs5535audio_ctl_put(struct snd_kcontrol *kcontrol,
57 /* value is 1 if analog input is desired */ 50 /* value is 1 if analog input is desired */
58 value = ucontrol->value.integer.value[0]; 51 value = ucontrol->value.integer.value[0];
59 52
60 /* sets High Z on VREF Bias if 1 */
61 if (value)
62 err = snd_ac97_update_bits(ac97, AC97_AD_MISC,
63 AD1888_VREFOUT_EN_BIT, AD1888_VREFOUT_EN_BIT);
64 else
65 err = snd_ac97_update_bits(ac97, AC97_AD_MISC,
66 AD1888_VREFOUT_EN_BIT, 0);
67 if (err < 0)
68 snd_printk(KERN_ERR "Error updating AD_MISC %d\n", err);
69
70 /* turns off High Pass Filter if 1 */ 53 /* turns off High Pass Filter if 1 */
71 if (value) 54 if (value)
72 err = snd_ac97_update_bits(ac97, AC97_AD_TEST2, 55 err = snd_ac97_update_bits(ac97, AC97_AD_TEST2,