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

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.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent bf1eb056
......@@ -528,17 +528,19 @@ 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) {
rt1015->bypass_boost = ucontrol->value.integer.value[0];
if (rt1015->bypass_boost == RT1015_Bypass_Boost &&
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) {
rt1015_calibrate(rt1015);
rt1015->cali_done = 1;
rt1015_calibrate(rt1015);
rt1015->cali_done = 1;
regmap_write(rt1015->regmap, RT1015_MONO_DYNA_CTRL, 0x0010);
}
} else
dev_err(component->dev, "DAC is being used!\n");
regmap_write(rt1015->regmap, RT1015_MONO_DYNA_CTRL, 0x0010);
}
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment