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: dapm: Sort speakers after other outputs

Currently we sequence speakers with line and headphone outputs in DAPM.
This works well when speakers are integrate into a CODEC but when there is
an external speaker driver connected to a line or headphone output it can
mean that the speaker driver ends up getting sequenced such that it picks
up pops and clicks from the CODEC. Mask this by moving speakers after the
other outputs in DAPM.

We may want to consider doing this for headphones too but separate drivers
are less common there and headphone drivers often also function as line
outputs so the situation is less clear.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230324-asoc-dapm-spk-v1-1-e1f27f766505@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>

+37 -37
+37 -37
sound/soc/soc-dapm.c
··· 99 99 [snd_soc_dapm_adc] = 11, 100 100 [snd_soc_dapm_out_drv] = 12, 101 101 [snd_soc_dapm_hp] = 12, 102 - [snd_soc_dapm_spk] = 12, 103 102 [snd_soc_dapm_line] = 12, 104 103 [snd_soc_dapm_sink] = 12, 105 - [snd_soc_dapm_kcontrol] = 13, 106 - [snd_soc_dapm_post] = 14, 104 + [snd_soc_dapm_spk] = 13, 105 + [snd_soc_dapm_kcontrol] = 14, 106 + [snd_soc_dapm_post] = 15, 107 107 }; 108 108 109 109 static int dapm_down_seq[] = { 110 110 [snd_soc_dapm_pre] = 1, 111 111 [snd_soc_dapm_kcontrol] = 2, 112 112 [snd_soc_dapm_adc] = 3, 113 - [snd_soc_dapm_hp] = 4, 114 113 [snd_soc_dapm_spk] = 4, 115 - [snd_soc_dapm_line] = 4, 116 - [snd_soc_dapm_out_drv] = 4, 117 - [snd_soc_dapm_sink] = 4, 118 - [snd_soc_dapm_pga] = 5, 119 - [snd_soc_dapm_buffer] = 5, 120 - [snd_soc_dapm_scheduler] = 5, 121 - [snd_soc_dapm_effect] = 5, 122 - [snd_soc_dapm_src] = 5, 123 - [snd_soc_dapm_asrc] = 5, 124 - [snd_soc_dapm_encoder] = 5, 125 - [snd_soc_dapm_decoder] = 5, 126 - [snd_soc_dapm_switch] = 6, 127 - [snd_soc_dapm_mixer_named_ctl] = 6, 128 - [snd_soc_dapm_mixer] = 6, 129 - [snd_soc_dapm_dac] = 7, 130 - [snd_soc_dapm_mic] = 8, 131 - [snd_soc_dapm_siggen] = 8, 132 - [snd_soc_dapm_input] = 8, 133 - [snd_soc_dapm_output] = 8, 134 - [snd_soc_dapm_micbias] = 9, 135 - [snd_soc_dapm_vmid] = 9, 136 - [snd_soc_dapm_mux] = 10, 137 - [snd_soc_dapm_demux] = 10, 138 - [snd_soc_dapm_aif_in] = 11, 139 - [snd_soc_dapm_aif_out] = 11, 140 - [snd_soc_dapm_dai_in] = 11, 141 - [snd_soc_dapm_dai_out] = 11, 142 - [snd_soc_dapm_dai_link] = 12, 143 - [snd_soc_dapm_supply] = 13, 144 - [snd_soc_dapm_clock_supply] = 14, 145 - [snd_soc_dapm_pinctrl] = 14, 146 - [snd_soc_dapm_regulator_supply] = 14, 147 - [snd_soc_dapm_post] = 15, 114 + [snd_soc_dapm_hp] = 5, 115 + [snd_soc_dapm_line] = 5, 116 + [snd_soc_dapm_out_drv] = 5, 117 + [snd_soc_dapm_sink] = 6, 118 + [snd_soc_dapm_pga] = 6, 119 + [snd_soc_dapm_buffer] = 6, 120 + [snd_soc_dapm_scheduler] = 6, 121 + [snd_soc_dapm_effect] = 6, 122 + [snd_soc_dapm_src] = 6, 123 + [snd_soc_dapm_asrc] = 6, 124 + [snd_soc_dapm_encoder] = 6, 125 + [snd_soc_dapm_decoder] = 6, 126 + [snd_soc_dapm_switch] = 7, 127 + [snd_soc_dapm_mixer_named_ctl] = 7, 128 + [snd_soc_dapm_mixer] = 7, 129 + [snd_soc_dapm_dac] = 8, 130 + [snd_soc_dapm_mic] = 9, 131 + [snd_soc_dapm_siggen] = 9, 132 + [snd_soc_dapm_input] = 9, 133 + [snd_soc_dapm_output] = 9, 134 + [snd_soc_dapm_micbias] = 10, 135 + [snd_soc_dapm_vmid] = 10, 136 + [snd_soc_dapm_mux] = 11, 137 + [snd_soc_dapm_demux] = 11, 138 + [snd_soc_dapm_aif_in] = 12, 139 + [snd_soc_dapm_aif_out] = 12, 140 + [snd_soc_dapm_dai_in] = 12, 141 + [snd_soc_dapm_dai_out] = 12, 142 + [snd_soc_dapm_dai_link] = 13, 143 + [snd_soc_dapm_supply] = 14, 144 + [snd_soc_dapm_clock_supply] = 15, 145 + [snd_soc_dapm_pinctrl] = 15, 146 + [snd_soc_dapm_regulator_supply] = 15, 147 + [snd_soc_dapm_post] = 16, 148 148 }; 149 149 150 150 static void dapm_assert_locked(struct snd_soc_dapm_context *dapm)