Skip to content

Commit 8382f29

Browse files
ranj063broonie
authored andcommitted
ASoC: Intel: broadwell: Fix oops during module removal
When removing the SOF module, the RT286 jack detect handler will oops if jack detection is not disabled. Disable the jack in the machine driver remove callback to prevent this. This fix is only for SOF support and is not needed for earlier versions. Signed-off-by: Ranjani Sridharan <[email protected]> Reviewed-by: Kai Vehmanen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent be8499c commit 8382f29

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

sound/soc/intel/boards/broadwell.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ static struct snd_soc_dai_link broadwell_rt286_dais[] = {
230230
},
231231
};
232232

233-
static int broadwell_suspend(struct snd_soc_card *card){
233+
static int broadwell_disable_jack(struct snd_soc_card *card)
234+
{
234235
struct snd_soc_component *component;
235236

236237
for_each_card_components(card, component) {
@@ -241,9 +242,15 @@ static int broadwell_suspend(struct snd_soc_card *card){
241242
break;
242243
}
243244
}
245+
244246
return 0;
245247
}
246248

249+
static int broadwell_suspend(struct snd_soc_card *card)
250+
{
251+
return broadwell_disable_jack(card);
252+
}
253+
247254
static int broadwell_resume(struct snd_soc_card *card){
248255
struct snd_soc_component *component;
249256

@@ -292,8 +299,16 @@ static int broadwell_audio_probe(struct platform_device *pdev)
292299
return devm_snd_soc_register_card(&pdev->dev, &broadwell_rt286);
293300
}
294301

302+
static int broadwell_audio_remove(struct platform_device *pdev)
303+
{
304+
struct snd_soc_card *card = platform_get_drvdata(pdev);
305+
306+
return broadwell_disable_jack(card);
307+
}
308+
295309
static struct platform_driver broadwell_audio = {
296310
.probe = broadwell_audio_probe,
311+
.remove = broadwell_audio_remove,
297312
.driver = {
298313
.name = "broadwell-audio",
299314
},

0 commit comments

Comments
 (0)