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: lpass-wsa-macro: Do not hard-code dai in VI mixer

The wsa_macro_vi_feed_mixer_put() callback for setting VI feedback mixer
value could be used for different DAIs (planned in the future CPS DAI),
so make the code a bit more generic by using DAI ID from widget->shift,
instead of hard-coding it. The get() callback already follows such
convention.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240723144607.123240-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Mark Brown
b3f35bae 3ff810b9

+13 -12
+13 -12
sound/soc/codecs/lpass-wsa-macro.c
··· 2297 2297 struct wsa_macro *wsa = snd_soc_component_get_drvdata(component); 2298 2298 u32 enable = ucontrol->value.integer.value[0]; 2299 2299 u32 spk_tx_id = mixer->shift; 2300 + u32 dai_id = widget->shift; 2300 2301 2301 2302 if (enable) { 2302 2303 if (spk_tx_id == WSA_MACRO_TX0 && 2303 2304 !test_bit(WSA_MACRO_TX0, 2304 - &wsa->active_ch_mask[WSA_MACRO_AIF_VI])) { 2305 + &wsa->active_ch_mask[dai_id])) { 2305 2306 set_bit(WSA_MACRO_TX0, 2306 - &wsa->active_ch_mask[WSA_MACRO_AIF_VI]); 2307 - wsa->active_ch_cnt[WSA_MACRO_AIF_VI]++; 2307 + &wsa->active_ch_mask[dai_id]); 2308 + wsa->active_ch_cnt[dai_id]++; 2308 2309 } 2309 2310 if (spk_tx_id == WSA_MACRO_TX1 && 2310 2311 !test_bit(WSA_MACRO_TX1, 2311 - &wsa->active_ch_mask[WSA_MACRO_AIF_VI])) { 2312 + &wsa->active_ch_mask[dai_id])) { 2312 2313 set_bit(WSA_MACRO_TX1, 2313 - &wsa->active_ch_mask[WSA_MACRO_AIF_VI]); 2314 - wsa->active_ch_cnt[WSA_MACRO_AIF_VI]++; 2314 + &wsa->active_ch_mask[dai_id]); 2315 + wsa->active_ch_cnt[dai_id]++; 2315 2316 } 2316 2317 } else { 2317 2318 if (spk_tx_id == WSA_MACRO_TX0 && 2318 2319 test_bit(WSA_MACRO_TX0, 2319 - &wsa->active_ch_mask[WSA_MACRO_AIF_VI])) { 2320 + &wsa->active_ch_mask[dai_id])) { 2320 2321 clear_bit(WSA_MACRO_TX0, 2321 - &wsa->active_ch_mask[WSA_MACRO_AIF_VI]); 2322 - wsa->active_ch_cnt[WSA_MACRO_AIF_VI]--; 2322 + &wsa->active_ch_mask[dai_id]); 2323 + wsa->active_ch_cnt[dai_id]--; 2323 2324 } 2324 2325 if (spk_tx_id == WSA_MACRO_TX1 && 2325 2326 test_bit(WSA_MACRO_TX1, 2326 - &wsa->active_ch_mask[WSA_MACRO_AIF_VI])) { 2327 + &wsa->active_ch_mask[dai_id])) { 2327 2328 clear_bit(WSA_MACRO_TX1, 2328 - &wsa->active_ch_mask[WSA_MACRO_AIF_VI]); 2329 - wsa->active_ch_cnt[WSA_MACRO_AIF_VI]--; 2329 + &wsa->active_ch_mask[dai_id]); 2330 + wsa->active_ch_cnt[dai_id]--; 2330 2331 } 2331 2332 } 2332 2333 snd_soc_dapm_mixer_update_power(widget->dapm, kcontrol, enable, NULL);