Skip to content

Commit 70c3054

Browse files
committed
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.
2 parents a8df789 + 31ddc62 commit 70c3054

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

sound/soc/fsl/fsl_easrc.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,13 @@ static int fsl_easrc_iec958_put_bits(struct snd_kcontrol *kcontrol,
5252
struct soc_mreg_control *mc =
5353
(struct soc_mreg_control *)kcontrol->private_value;
5454
unsigned int regval = ucontrol->value.integer.value[0];
55+
int ret;
56+
57+
ret = (easrc_priv->bps_iec958[mc->regbase] != regval);
5558

5659
easrc_priv->bps_iec958[mc->regbase] = regval;
5760

58-
return 0;
61+
return ret;
5962
}
6063

6164
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,
9396
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
9497
struct soc_mreg_control *mc =
9598
(struct soc_mreg_control *)kcontrol->private_value;
99+
struct fsl_asrc *easrc = snd_soc_component_get_drvdata(component);
96100
unsigned int regval = ucontrol->value.integer.value[0];
101+
bool changed;
97102
int ret;
98103

99-
ret = snd_soc_component_write(component, mc->regbase, regval);
100-
if (ret < 0)
104+
ret = regmap_update_bits_check(easrc->regmap, mc->regbase,
105+
GENMASK(31, 0), regval, &changed);
106+
if (ret != 0)
101107
return ret;
102108

103-
return 0;
109+
return changed;
104110
}
105111

106112
#define SOC_SINGLE_REG_RW(xname, xreg) \

0 commit comments

Comments
 (0)