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

ASoC: Merge up workaround for CODECs that play noise on stopped stream

This was sent too late to actually make it for v6.6 but was sent against
v6.6 so merge it up here.

+34 -11
+1
include/sound/soc-dai.h
··· 370 370 371 371 /* bit field */ 372 372 unsigned int no_capture_mute:1; 373 + unsigned int mute_unmute_on_trigger:1; 373 374 }; 374 375 375 376 struct snd_soc_cdai_ops {
+1 -6
sound/soc/codecs/wsa883x.c
··· 1203 1203 break; 1204 1204 } 1205 1205 1206 - snd_soc_component_write_field(component, WSA883X_DRE_CTL_1, 1207 - WSA883X_DRE_GAIN_EN_MASK, 1208 - WSA883X_DRE_GAIN_FROM_CSR); 1209 1206 if (wsa883x->port_enable[WSA883X_PORT_COMP]) 1210 1207 snd_soc_component_write_field(component, WSA883X_DRE_CTL_0, 1211 1208 WSA883X_DRE_OFFSET_MASK, ··· 1215 1218 snd_soc_component_write_field(component, WSA883X_PDM_WD_CTL, 1216 1219 WSA883X_PDM_EN_MASK, 1217 1220 WSA883X_PDM_ENABLE); 1218 - snd_soc_component_write_field(component, WSA883X_PA_FSM_CTL, 1219 - WSA883X_GLOBAL_PA_EN_MASK, 1220 - WSA883X_GLOBAL_PA_ENABLE); 1221 1221 1222 1222 break; 1223 1223 case SND_SOC_DAPM_PRE_PMD: ··· 1340 1346 .hw_free = wsa883x_hw_free, 1341 1347 .mute_stream = wsa883x_digital_mute, 1342 1348 .set_stream = wsa883x_set_sdw_stream, 1349 + .mute_unmute_on_trigger = true, 1343 1350 }; 1344 1351 1345 1352 static struct snd_soc_dai_driver wsa883x_dais[] = {
+6 -2
sound/soc/fsl/fsl_easrc.c
··· 1966 1966 &fsl_easrc_dai, 1); 1967 1967 if (ret) { 1968 1968 dev_err(dev, "failed to register ASoC DAI\n"); 1969 - return ret; 1969 + goto err_pm_disable; 1970 1970 } 1971 1971 1972 1972 ret = devm_snd_soc_register_component(dev, &fsl_asrc_component, 1973 1973 NULL, 0); 1974 1974 if (ret) { 1975 1975 dev_err(&pdev->dev, "failed to register ASoC platform\n"); 1976 - return ret; 1976 + goto err_pm_disable; 1977 1977 } 1978 1978 1979 1979 return 0; 1980 + 1981 + err_pm_disable: 1982 + pm_runtime_disable(&pdev->dev); 1983 + return ret; 1980 1984 } 1981 1985 1982 1986 static void fsl_easrc_remove(struct platform_device *pdev)
+1
sound/soc/intel/skylake/skl-sst-utils.c
··· 299 299 module->instance_id = devm_kzalloc(ctx->dev, size, GFP_KERNEL); 300 300 if (!module->instance_id) { 301 301 ret = -ENOMEM; 302 + kfree(module); 302 303 goto free_uuid_list; 303 304 } 304 305
+7
sound/soc/soc-dai.c
··· 658 658 ret = soc_dai_trigger(dai, substream, cmd); 659 659 if (ret < 0) 660 660 break; 661 + 662 + if (dai->driver->ops && dai->driver->ops->mute_unmute_on_trigger) 663 + snd_soc_dai_digital_mute(dai, 0, substream->stream); 664 + 661 665 soc_dai_mark_push(dai, substream, trigger); 662 666 } 663 667 break; ··· 671 667 for_each_rtd_dais(rtd, i, dai) { 672 668 if (rollback && !soc_dai_mark_match(dai, substream, trigger)) 673 669 continue; 670 + 671 + if (dai->driver->ops && dai->driver->ops->mute_unmute_on_trigger) 672 + snd_soc_dai_digital_mute(dai, 1, substream->stream); 674 673 675 674 r = soc_dai_trigger(dai, substream, cmd); 676 675 if (r < 0)
+11 -3
sound/soc/soc-pcm.c
··· 700 700 snd_soc_runtime_deactivate(rtd, substream->stream); 701 701 702 702 /* Make sure DAI parameters cleared if the DAI becomes inactive */ 703 - for_each_rtd_dais(rtd, i, dai) 703 + for_each_rtd_dais(rtd, i, dai) { 704 704 if (snd_soc_dai_active(dai) == 0 && 705 705 (dai->rate || dai->channels || dai->sample_bits)) 706 706 soc_pcm_set_dai_params(dai, NULL); 707 + 708 + if (snd_soc_dai_stream_active(dai, substream->stream) == 0) { 709 + if (dai->driver->ops && !dai->driver->ops->mute_unmute_on_trigger) 710 + snd_soc_dai_digital_mute(dai, 1, substream->stream); 711 + } 712 + } 707 713 } 708 714 709 715 for_each_rtd_dais(rtd, i, dai) ··· 902 896 snd_soc_dapm_stream_event(rtd, substream->stream, 903 897 SND_SOC_DAPM_STREAM_START); 904 898 905 - for_each_rtd_dais(rtd, i, dai) 906 - snd_soc_dai_digital_mute(dai, 0, substream->stream); 899 + for_each_rtd_dais(rtd, i, dai) { 900 + if (dai->driver->ops && !dai->driver->ops->mute_unmute_on_trigger) 901 + snd_soc_dai_digital_mute(dai, 0, substream->stream); 902 + } 907 903 908 904 out: 909 905 return soc_pcm_ret(rtd, ret);
+7
sound/soc/sof/sof-pci-dev.c
··· 145 145 DMI_MATCH(DMI_PRODUCT_FAMILY, "Google"), 146 146 } 147 147 }, 148 + { 149 + .ident = "Google firmware", 150 + .callback = chromebook_use_community_key, 151 + .matches = { 152 + DMI_MATCH(DMI_BIOS_VERSION, "Google"), 153 + } 154 + }, 148 155 {}, 149 156 }; 150 157