mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:24:47 +01:00
ASoC: fsl_easrc: Fix control writes
Merge series from Mark Brown <broonie@kernel.org>: I noticed that neither of the put() operations for the controls defined by the fsl_easrc driver was flagging value changes properly, fix that.
This commit is contained in:
commit
70c3054505
1 changed files with 10 additions and 4 deletions
|
|
@ -52,10 +52,13 @@ static int fsl_easrc_iec958_put_bits(struct snd_kcontrol *kcontrol,
|
|||
struct soc_mreg_control *mc =
|
||||
(struct soc_mreg_control *)kcontrol->private_value;
|
||||
unsigned int regval = ucontrol->value.integer.value[0];
|
||||
int ret;
|
||||
|
||||
ret = (easrc_priv->bps_iec958[mc->regbase] != regval);
|
||||
|
||||
easrc_priv->bps_iec958[mc->regbase] = regval;
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int fsl_easrc_iec958_get_bits(struct snd_kcontrol *kcontrol,
|
||||
|
|
@ -93,14 +96,17 @@ static int fsl_easrc_set_reg(struct snd_kcontrol *kcontrol,
|
|||
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
|
||||
struct soc_mreg_control *mc =
|
||||
(struct soc_mreg_control *)kcontrol->private_value;
|
||||
struct fsl_asrc *easrc = snd_soc_component_get_drvdata(component);
|
||||
unsigned int regval = ucontrol->value.integer.value[0];
|
||||
bool changed;
|
||||
int ret;
|
||||
|
||||
ret = snd_soc_component_write(component, mc->regbase, regval);
|
||||
if (ret < 0)
|
||||
ret = regmap_update_bits_check(easrc->regmap, mc->regbase,
|
||||
GENMASK(31, 0), regval, &changed);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
return changed;
|
||||
}
|
||||
|
||||
#define SOC_SINGLE_REG_RW(xname, xreg) \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue