Commit 24338722 authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown
Browse files

ASoC: wm5110: Fix PGA clear when disabling DRE



We don't want to use a bypassed write in wm5110_clear_pga_volume,
we might disable the DRE whilst the CODEC is powered down. A
normal regmap_write will always go to the hardware (when not on
cache_only) even if the written value matches the cache. As using
a normal write will still achieve the desired behaviour of bring
the cache and hardware in sync, this patch updates the function
to use a normal write, which avoids issues when the CODEC is
powered down.

Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
parent e73694d8
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -360,15 +360,13 @@ static int wm5110_hp_ev(struct snd_soc_dapm_widget *w,

static int wm5110_clear_pga_volume(struct arizona *arizona, int output)
{
	struct reg_sequence clear_pga = {
		ARIZONA_OUTPUT_PATH_CONFIG_1L + output * 4, 0x80
	};
	unsigned int reg = ARIZONA_OUTPUT_PATH_CONFIG_1L + output * 4;
	int ret;

	ret = regmap_multi_reg_write_bypassed(arizona->regmap, &clear_pga, 1);
	ret = regmap_write(arizona->regmap, reg, 0x80);
	if (ret)
		dev_err(arizona->dev, "Failed to clear PGA (0x%x): %d\n",
			clear_pga.reg, ret);
			reg, ret);

	return ret;
}