Unverified Commit e48b41e9 authored by Tzung-Bi Shih's avatar Tzung-Bi Shih Committed by Mark Brown
Browse files

ASoC: rt1015: return error if any when setting bypass_boost



Returns -EBUSY if DAC is using when setting bypass_boost.

Signed-off-by: default avatarTzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20201224100607.3006171-4-tzungbi@google.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent bf1eb056
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -528,7 +528,11 @@ static int rt1015_bypass_boost_put(struct snd_kcontrol *kcontrol,
	struct rt1015_priv *rt1015 =
		snd_soc_component_get_drvdata(component);

	if (!rt1015->dac_is_used) {
	if (rt1015->dac_is_used) {
		dev_err(component->dev, "DAC is being used!\n");
		return -EBUSY;
	}

	rt1015->bypass_boost = ucontrol->value.integer.value[0];
	if (rt1015->bypass_boost == RT1015_Bypass_Boost &&
			!rt1015->cali_done) {
@@ -537,8 +541,6 @@ static int rt1015_bypass_boost_put(struct snd_kcontrol *kcontrol,

		regmap_write(rt1015->regmap, RT1015_MONO_DYNA_CTRL, 0x0010);
	}
	} else
		dev_err(component->dev, "DAC is being used!\n");

	return 0;
}