From e6c028cdcc8c3baf5bcd053f4c37fa49bad6cf60 Mon Sep 17 00:00:00 2001 From: Paul Fertser Date: Wed, 10 Jun 2009 15:39:38 +0400 Subject: gta01: asoc: fix lm4857 control Commit 4eaa9819dc08d7bfd1065ce530e31b18a119dcaf 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 Signed-off-by: Paul Fertser --- sound/soc/s3c24xx/neo1973_wm8753.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'sound') diff --git a/sound/soc/s3c24xx/neo1973_wm8753.c b/sound/soc/s3c24xx/neo1973_wm8753.c index 2970305990f..3f170cb53d3 100644 --- a/sound/soc/s3c24xx/neo1973_wm8753.c +++ b/sound/soc/s3c24xx/neo1973_wm8753.c @@ -353,9 +353,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; DBG("Entered %s\n", __func__); @@ -366,9 +368,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]) -- cgit v1.2.3