From: Shimrra Shai shimrrashai@gmail.com
[ Upstream commit 258384d8ce365dddd6c5c15204de8ccd53a7ab0a ]
Enable DAPM widgets for power and volume control of playback.
Signed-off-by: Shimrra Shai shimrrashai@gmail.com Link: https://patch.msgid.link/20250814014919.87170-1-shimrrashai@gmail.com Signed-off-by: Mark Brown broonie@kernel.org Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
YES
Why this is a bug fix - Previously the playback DACs and output amps were declared as DAPM widgets without a backing power register, so DAPM could not actually power them on/off. This can cause silent playback (if hardware defaults to powered-down) or excess power consumption/pops (if left always-on). - The change wires those DAPM widgets to the codec’s DAC power register with correct bit polarity, so the hardware is powered in sync with the DAPM graph during stream start/stop and routing changes. This is functional correctness, not a new feature.
What changed (specific code references) - Binds DAC widgets to the DAC power register: - sound/soc/codecs/es8323.c:194 - Right DAC: `SND_SOC_DAPM_DAC(..., ES8323_DACPOWER, 6, 1)` (was `SND_SOC_NOPM`) - Left DAC: `SND_SOC_DAPM_DAC(..., ES8323_DACPOWER, 7, 1)` (was `SND_SOC_NOPM`) - The `invert=1` indicates those bits are power-down bits in hardware (1 = off), so DAPM will clear them when enabling. - Binds output amplifier PGAs to the same DAC power register: - sound/soc/codecs/es8323.c:194 - Right Out 2: `SND_SOC_DAPM_PGA(..., ES8323_DACPOWER, 2, 0)` (was `SND_SOC_NOPM`) - Left Out 2: `SND_SOC_DAPM_PGA(..., ES8323_DACPOWER, 3, 0)` (was `SND_SOC_NOPM`) - Right Out 1: `SND_SOC_DAPM_PGA(..., ES8323_DACPOWER, 4, 0)` (was `SND_SOC_NOPM`) - Left Out 1: `SND_SOC_DAPM_PGA(..., ES8323_DACPOWER, 5, 0)` (was `SND_SOC_NOPM`) - The `invert=0` indicates those bits are enable bits (1 = on). - ADC side and mic bias remain unchanged; only playback path power control is corrected.
Why it fits stable backport criteria - Fixes an important, user-visible functional issue: playback path may not power up reliably without these bindings, leading to no audio or erratic power behavior. - Small and tightly scoped: affects only `sound/soc/codecs/es8323.c` DAPM widget definitions; no API/ABI or architectural changes. - Low regression risk: aligns with ASoC/DAPM design where power bits are owned by DAPM. Similar fixes have been applied across other codecs (e.g., ES83xx/ES8316 families) and routinely backported. - No security or behavioral changes outside this codec; no dependency on DT/Kconfig; uses existing register define `ES8323_DACPOWER` and established DAPM patterns.
Potential side effects and why acceptable - If any out-of-band code previously toggled `ES8323_DACPOWER`, DAPM will now own those bits. This generally removes races and produces correct sequencing. Minor changes in pop/click characteristics are possible but usually improved by proper DAPM gating. - No new controls, no user-visible mixer name changes; only the power lifecycle is corrected.
Backport considerations - The change is mechanical and compile-time obvious. Ensure the target stable branch’s `es8323.c` already defines `ES8323_DACPOWER` with the same bit layout (very likely). If not, a trivial definition addition would be needed in that branch. - No additional follow-ups appear required for this specific wiring; if later upstream commits tweak routing or invert bits for ES8323, consider them if reports of polarity mismatch arise on older branches.
Conclusion - This is a classic DAPM power hookup fix for a specific codec. It corrects functional behavior with minimal, contained changes, and is safe to backport to stable trees.
sound/soc/codecs/es8323.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/sound/soc/codecs/es8323.c b/sound/soc/codecs/es8323.c index a9822998199fb..70d348ff3b437 100644 --- a/sound/soc/codecs/es8323.c +++ b/sound/soc/codecs/es8323.c @@ -211,8 +211,8 @@ static const struct snd_soc_dapm_widget es8323_dapm_widgets[] = {
SND_SOC_DAPM_ADC("Right ADC", "Right Capture", SND_SOC_NOPM, 4, 1), SND_SOC_DAPM_ADC("Left ADC", "Left Capture", SND_SOC_NOPM, 5, 1), - SND_SOC_DAPM_DAC("Right DAC", "Right Playback", SND_SOC_NOPM, 6, 1), - SND_SOC_DAPM_DAC("Left DAC", "Left Playback", SND_SOC_NOPM, 7, 1), + SND_SOC_DAPM_DAC("Right DAC", "Right Playback", ES8323_DACPOWER, 6, 1), + SND_SOC_DAPM_DAC("Left DAC", "Left Playback", ES8323_DACPOWER, 7, 1),
SND_SOC_DAPM_MIXER("Left Mixer", SND_SOC_NOPM, 0, 0, &es8323_left_mixer_controls[0], @@ -223,10 +223,10 @@ static const struct snd_soc_dapm_widget es8323_dapm_widgets[] = {
SND_SOC_DAPM_PGA("Right ADC Power", SND_SOC_NOPM, 6, 1, NULL, 0), SND_SOC_DAPM_PGA("Left ADC Power", SND_SOC_NOPM, 7, 1, NULL, 0), - SND_SOC_DAPM_PGA("Right Out 2", SND_SOC_NOPM, 2, 0, NULL, 0), - SND_SOC_DAPM_PGA("Left Out 2", SND_SOC_NOPM, 3, 0, NULL, 0), - SND_SOC_DAPM_PGA("Right Out 1", SND_SOC_NOPM, 4, 0, NULL, 0), - SND_SOC_DAPM_PGA("Left Out 1", SND_SOC_NOPM, 5, 0, NULL, 0), + SND_SOC_DAPM_PGA("Right Out 2", ES8323_DACPOWER, 2, 0, NULL, 0), + SND_SOC_DAPM_PGA("Left Out 2", ES8323_DACPOWER, 3, 0, NULL, 0), + SND_SOC_DAPM_PGA("Right Out 1", ES8323_DACPOWER, 4, 0, NULL, 0), + SND_SOC_DAPM_PGA("Left Out 1", ES8323_DACPOWER, 5, 0, NULL, 0), SND_SOC_DAPM_PGA("LAMP", ES8323_ADCCONTROL1, 4, 0, NULL, 0), SND_SOC_DAPM_PGA("RAMP", ES8323_ADCCONTROL1, 0, 0, NULL, 0),