summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHsieh Hung-En <hungen3108@gmail.com>2026-01-31 00:00:13 +0800
committerMark Brown <broonie@kernel.org>2026-02-02 12:49:59 +0000
commit4c6b74d58766ce7cd66ae8e14babf877039adef6 (patch)
tree29c92c00cfa5594d9f4627d82f29318578ce43db
parenta1d14d8364eac2611fe1391c73ff0e5b26064f0e (diff)
ASoC: es8328: Fix DAC deemphasis control handling
The DAC deemphasis control updated the hardware before updating the cached state, causing the previous setting to be applied. Update the cached deemphasis state first and then apply the setting. Also check and propagate errors from es8328_set_deemph() in hw_params(). Signed-off-by: Hsieh Hung-En <hungen3108@gmail.com> Link: https://patch.msgid.link/20260130160017.2630-2-hungen3108@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/es8328.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/soc/codecs/es8328.c b/sound/soc/codecs/es8328.c
index 38340f292282..46868b7924a0 100644
--- a/sound/soc/codecs/es8328.c
+++ b/sound/soc/codecs/es8328.c
@@ -163,12 +163,11 @@ static int es8328_put_deemph(struct snd_kcontrol *kcontrol,
if (es8328->deemph == deemph)
return 0;
+ es8328->deemph = deemph;
ret = es8328_set_deemph(component);
if (ret < 0)
return ret;
- es8328->deemph = deemph;
-
return 1;
}
@@ -530,7 +529,9 @@ static int es8328_hw_params(struct snd_pcm_substream *substream,
return ret;
es8328->playback_fs = params_rate(params);
- es8328_set_deemph(component);
+ ret = es8328_set_deemph(component);
+ if (ret < 0)
+ return ret;
} else {
ret = snd_soc_component_update_bits(component, ES8328_ADCCONTROL4,
ES8328_ADCCONTROL4_ADCWL_MASK,