Unverified Commit 70c30545 authored by Mark Brown's avatar Mark Brown
Browse files

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.
parents a8df7892 31ddc62c
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -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) \