Skip to content

Commit bdb7e19

Browse files
committed
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.
2 parents 0262a8a + 805ce81 commit bdb7e19

File tree

7 files changed

+34
-11
lines changed

7 files changed

+34
-11
lines changed

include/sound/soc-dai.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ struct snd_soc_dai_ops {
370370

371371
/* bit field */
372372
unsigned int no_capture_mute:1;
373+
unsigned int mute_unmute_on_trigger:1;
373374
};
374375

375376
struct snd_soc_cdai_ops {

sound/soc/codecs/wsa883x.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,9 +1203,6 @@ static int wsa883x_spkr_event(struct snd_soc_dapm_widget *w,
12031203
break;
12041204
}
12051205

1206-
snd_soc_component_write_field(component, WSA883X_DRE_CTL_1,
1207-
WSA883X_DRE_GAIN_EN_MASK,
1208-
WSA883X_DRE_GAIN_FROM_CSR);
12091206
if (wsa883x->port_enable[WSA883X_PORT_COMP])
12101207
snd_soc_component_write_field(component, WSA883X_DRE_CTL_0,
12111208
WSA883X_DRE_OFFSET_MASK,
@@ -1218,9 +1215,6 @@ static int wsa883x_spkr_event(struct snd_soc_dapm_widget *w,
12181215
snd_soc_component_write_field(component, WSA883X_PDM_WD_CTL,
12191216
WSA883X_PDM_EN_MASK,
12201217
WSA883X_PDM_ENABLE);
1221-
snd_soc_component_write_field(component, WSA883X_PA_FSM_CTL,
1222-
WSA883X_GLOBAL_PA_EN_MASK,
1223-
WSA883X_GLOBAL_PA_ENABLE);
12241218

12251219
break;
12261220
case SND_SOC_DAPM_PRE_PMD:
@@ -1346,6 +1340,7 @@ static const struct snd_soc_dai_ops wsa883x_dai_ops = {
13461340
.hw_free = wsa883x_hw_free,
13471341
.mute_stream = wsa883x_digital_mute,
13481342
.set_stream = wsa883x_set_sdw_stream,
1343+
.mute_unmute_on_trigger = true,
13491344
};
13501345

13511346
static struct snd_soc_dai_driver wsa883x_dais[] = {

sound/soc/fsl/fsl_easrc.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1966,17 +1966,21 @@ static int fsl_easrc_probe(struct platform_device *pdev)
19661966
&fsl_easrc_dai, 1);
19671967
if (ret) {
19681968
dev_err(dev, "failed to register ASoC DAI\n");
1969-
return ret;
1969+
goto err_pm_disable;
19701970
}
19711971

19721972
ret = devm_snd_soc_register_component(dev, &fsl_asrc_component,
19731973
NULL, 0);
19741974
if (ret) {
19751975
dev_err(&pdev->dev, "failed to register ASoC platform\n");
1976-
return ret;
1976+
goto err_pm_disable;
19771977
}
19781978

19791979
return 0;
1980+
1981+
err_pm_disable:
1982+
pm_runtime_disable(&pdev->dev);
1983+
return ret;
19801984
}
19811985

19821986
static void fsl_easrc_remove(struct platform_device *pdev)

sound/soc/intel/skylake/skl-sst-utils.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw,
299299
module->instance_id = devm_kzalloc(ctx->dev, size, GFP_KERNEL);
300300
if (!module->instance_id) {
301301
ret = -ENOMEM;
302+
kfree(module);
302303
goto free_uuid_list;
303304
}
304305

sound/soc/soc-dai.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,10 @@ int snd_soc_pcm_dai_trigger(struct snd_pcm_substream *substream,
658658
ret = soc_dai_trigger(dai, substream, cmd);
659659
if (ret < 0)
660660
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+
661665
soc_dai_mark_push(dai, substream, trigger);
662666
}
663667
break;
@@ -668,6 +672,9 @@ int snd_soc_pcm_dai_trigger(struct snd_pcm_substream *substream,
668672
if (rollback && !soc_dai_mark_match(dai, substream, trigger))
669673
continue;
670674

675+
if (dai->driver->ops && dai->driver->ops->mute_unmute_on_trigger)
676+
snd_soc_dai_digital_mute(dai, 1, substream->stream);
677+
671678
r = soc_dai_trigger(dai, substream, cmd);
672679
if (r < 0)
673680
ret = r; /* use last ret */

sound/soc/soc-pcm.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -700,10 +700,16 @@ static int soc_pcm_clean(struct snd_soc_pcm_runtime *rtd,
700700
snd_soc_runtime_deactivate(rtd, substream->stream);
701701

702702
/* 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) {
704704
if (snd_soc_dai_active(dai) == 0 &&
705705
(dai->rate || dai->channels || dai->sample_bits))
706706
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+
}
707713
}
708714

709715
for_each_rtd_dais(rtd, i, dai)
@@ -896,8 +902,10 @@ static int __soc_pcm_prepare(struct snd_soc_pcm_runtime *rtd,
896902
snd_soc_dapm_stream_event(rtd, substream->stream,
897903
SND_SOC_DAPM_STREAM_START);
898904

899-
for_each_rtd_dais(rtd, i, dai)
900-
snd_soc_dai_digital_mute(dai, 0, substream->stream);
905+
for_each_rtd_dais(rtd, i, dai) {
906+
if (dai->driver->ops && !dai->driver->ops->mute_unmute_on_trigger)
907+
snd_soc_dai_digital_mute(dai, 0, substream->stream);
908+
}
901909

902910
out:
903911
return soc_pcm_ret(rtd, ret);

sound/soc/sof/sof-pci-dev.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,13 @@ static const struct dmi_system_id community_key_platforms[] = {
145145
DMI_MATCH(DMI_PRODUCT_FAMILY, "Google"),
146146
}
147147
},
148+
{
149+
.ident = "Google firmware",
150+
.callback = chromebook_use_community_key,
151+
.matches = {
152+
DMI_MATCH(DMI_BIOS_VERSION, "Google"),
153+
}
154+
},
148155
{},
149156
};
150157

0 commit comments

Comments
 (0)