mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-17 18:56:24 +00:00
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 <josch@pyneo.org> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
74b8f955a7
commit
236e6723be
@ -345,9 +345,11 @@ static void lm4857_write_regs(void)
|
|||||||
static int lm4857_get_reg(struct snd_kcontrol *kcontrol,
|
static int lm4857_get_reg(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
struct snd_ctl_elem_value *ucontrol)
|
||||||
{
|
{
|
||||||
int reg = kcontrol->private_value & 0xFF;
|
struct soc_mixer_control *mc =
|
||||||
int shift = (kcontrol->private_value >> 8) & 0x0F;
|
(struct soc_mixer_control *)kcontrol->private_value;
|
||||||
int mask = (kcontrol->private_value >> 16) & 0xFF;
|
int reg = mc->reg;
|
||||||
|
int shift = mc->shift;
|
||||||
|
int mask = mc->max;
|
||||||
|
|
||||||
pr_debug("Entered %s\n", __func__);
|
pr_debug("Entered %s\n", __func__);
|
||||||
|
|
||||||
@ -358,9 +360,11 @@ static int lm4857_get_reg(struct snd_kcontrol *kcontrol,
|
|||||||
static int lm4857_set_reg(struct snd_kcontrol *kcontrol,
|
static int lm4857_set_reg(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
struct snd_ctl_elem_value *ucontrol)
|
||||||
{
|
{
|
||||||
int reg = kcontrol->private_value & 0xFF;
|
struct soc_mixer_control *mc =
|
||||||
int shift = (kcontrol->private_value >> 8) & 0x0F;
|
(struct soc_mixer_control *)kcontrol->private_value;
|
||||||
int mask = (kcontrol->private_value >> 16) & 0xFF;
|
int reg = mc->reg;
|
||||||
|
int shift = mc->shift;
|
||||||
|
int mask = mc->max;
|
||||||
|
|
||||||
if (((lm4857_regs[reg] >> shift) & mask) ==
|
if (((lm4857_regs[reg] >> shift) & mask) ==
|
||||||
ucontrol->value.integer.value[0])
|
ucontrol->value.integer.value[0])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user