Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: codecs: wcd-clsh: Always update buck/flyback on transitions on transitions

The WCD934x audio outputs (earpiece, headphone, speaker) share two power
supply converters, a buck and a flyback, managed by reference counters
(buck_users, flyback_users) in the Class-H controller.

The early return in wcd_clsh_ctrl_set_state() when nstate == ctrl->state
prevented _wcd_clsh_ctrl_set_state() from being called when switching
between outputs sharing the same state value. As a result, the buck and
flyback reference counters were never decremented on disable, leaving the
converters active and their counters out of sync with the actual hardware
state.

This caused audible distortion on the earpiece output and spurious MBHC
over-current protection interrupts on HPHL/HPHR during output switching.

Remove the early return so that CLSH_REQ_ENABLE and CLSH_REQ_DISABLE are
always dispatched, keeping the buck and flyback reference counters
consistent on every state transition.

Signed-off-by: Cédric Bellegarde <cedric.bellegarde@adishatz.org>
Link: https://patch.msgid.link/20260304141006.280894-1-cedric.bellegarde@adishatz.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Cédric Bellegarde and committed by
Mark Brown
f8d51e90 804dce6c

-3
-3
sound/soc/codecs/wcd-clsh-v2.c
··· 848 848 { 849 849 struct snd_soc_component *comp = ctrl->comp; 850 850 851 - if (nstate == ctrl->state) 852 - return 0; 853 - 854 851 if (!wcd_clsh_is_state_valid(nstate)) { 855 852 dev_err(comp->dev, "Class-H not a valid new state:\n"); 856 853 return -EINVAL;