Skip to content

Commit

Permalink
ASoC: Fix lm4857 control
Browse files Browse the repository at this point in the history
Commit 4eaa981 changed semantics of
private_value member of kcontrol. This resulted in inability to control
amplifier and subsequently in very low output volume.

Tested-by: Johannes Schauer <josch@pyneo.org>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Jun 10, 2009
1 parent 74b8f95 commit 236e672
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions sound/soc/s3c24xx/neo1973_wm8753.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,11 @@ static void lm4857_write_regs(void)
static int lm4857_get_reg(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
int reg = kcontrol->private_value & 0xFF;
int shift = (kcontrol->private_value >> 8) & 0x0F;
int mask = (kcontrol->private_value >> 16) & 0xFF;
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
int reg = mc->reg;
int shift = mc->shift;
int mask = mc->max;

pr_debug("Entered %s\n", __func__);

Expand All @@ -358,9 +360,11 @@ static int lm4857_get_reg(struct snd_kcontrol *kcontrol,
static int lm4857_set_reg(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
int reg = kcontrol->private_value & 0xFF;
int shift = (kcontrol->private_value >> 8) & 0x0F;
int mask = (kcontrol->private_value >> 16) & 0xFF;
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
int reg = mc->reg;
int shift = mc->shift;
int mask = mc->max;

if (((lm4857_regs[reg] >> shift) & mask) ==
ucontrol->value.integer.value[0])
Expand Down

0 comments on commit 236e672

Please sign in to comment.