Skip to content

Commit

Permalink
ALSA: cs5535audio: decouple HPF from V_REFOUT in OLPC code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andres Salomon authored and Takashi Iwai committed Dec 10, 2008
1 parent b91254e commit 1e2232b
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions sound/pci/cs5535audio/cs5535audio_olpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,11 @@ static int snd_cs5535audio_ctl_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct cs5535audio *cs5535au = snd_kcontrol_chip(kcontrol);
u16 reg1, reg2;
u8 val;

/* if either AD1888 VRef Bias and High Pass Filter are enabled
or the EC is not in analog mode then flag as not in analog mode.
No EC command to read current analog state so we cache that. */
reg1 = snd_ac97_read(cs5535au->ac97, AC97_AD_MISC);
reg2 = snd_ac97_read(cs5535au->ac97, AC97_AD_TEST2);

if ((reg1 & AD1888_VREFOUT_EN_BIT) && (reg2 & AD1888_HPF_EN_BIT))
ucontrol->value.integer.value[0] = 1;
else
ucontrol->value.integer.value[0] = 0;
val = snd_ac97_read(cs5535au->ac97, AC97_AD_TEST2);
val >>= AC97_AD_HPFD_SHIFT;
ucontrol->value.integer.value[0] = val & 0x1;

return 0;
}
Expand All @@ -57,16 +50,6 @@ static int snd_cs5535audio_ctl_put(struct snd_kcontrol *kcontrol,
/* value is 1 if analog input is desired */
value = ucontrol->value.integer.value[0];

/* sets High Z on VREF Bias if 1 */
if (value)
err = snd_ac97_update_bits(ac97, AC97_AD_MISC,
AD1888_VREFOUT_EN_BIT, AD1888_VREFOUT_EN_BIT);
else
err = snd_ac97_update_bits(ac97, AC97_AD_MISC,
AD1888_VREFOUT_EN_BIT, 0);
if (err < 0)
snd_printk(KERN_ERR "Error updating AD_MISC %d\n", err);

/* turns off High Pass Filter if 1 */
if (value)
err = snd_ac97_update_bits(ac97, AC97_AD_TEST2,
Expand Down

0 comments on commit 1e2232b

Please sign in to comment.