Skip to content

Commit 4f876bf

Browse files
committed
Merge tag 'asoc-fix-v6.2-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.2 An unfortunately large batch of fixes here, the numbers amplified by several repeated fixes for patterns of bugs in multiple drivers. Most of this is in the x86 drivers which are very actively developed, the implementation of PCI shutdown is a fix for issues with spamming warnings into the logs with a leaked reference to the i915 driver.
2 parents 53466eb + e18c6da commit 4f876bf

File tree

17 files changed

+104
-49
lines changed

17 files changed

+104
-49
lines changed

drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ static int snd_dw_hdmi_probe(struct platform_device *pdev)
193193
struct hdmi_codec_pdata pdata;
194194
struct platform_device *platform;
195195

196+
memset(&pdata, 0, sizeof(pdata));
196197
pdata.ops = &dw_hdmi_i2s_ops;
197198
pdata.i2s = 1;
198199
pdata.max_i2s_channels = 8;

sound/soc/amd/acp-es8336.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,11 @@ static int st_es8336_late_probe(struct snd_soc_card *card)
198198
int ret;
199199

200200
adev = acpi_dev_get_first_match_dev("ESSX8336", NULL, -1);
201-
if (adev)
202-
put_device(&adev->dev);
201+
if (!adev)
202+
return -ENODEV;
203+
203204
codec_dev = acpi_get_first_physical_node(adev);
205+
acpi_dev_put(adev);
204206
if (!codec_dev)
205207
dev_err(card->dev, "can not find codec dev\n");
206208

sound/soc/amd/yc/acp6x-mach.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,34 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
227227
DMI_MATCH(DMI_PRODUCT_NAME, "Redmi Book Pro 14 2022"),
228228
}
229229
},
230+
{
231+
.driver_data = &acp6x_card,
232+
.matches = {
233+
DMI_MATCH(DMI_BOARD_VENDOR, "TIMI"),
234+
DMI_MATCH(DMI_PRODUCT_NAME, "Redmi Book Pro 15 2022"),
235+
}
236+
},
230237
{
231238
.driver_data = &acp6x_card,
232239
.matches = {
233240
DMI_MATCH(DMI_BOARD_VENDOR, "Razer"),
234241
DMI_MATCH(DMI_PRODUCT_NAME, "Blade 14 (2022) - RZ09-0427"),
235242
}
236243
},
244+
{
245+
.driver_data = &acp6x_card,
246+
.matches = {
247+
DMI_MATCH(DMI_BOARD_VENDOR, "RB"),
248+
DMI_MATCH(DMI_PRODUCT_NAME, "Swift SFA16-41"),
249+
}
250+
},
251+
{
252+
.driver_data = &acp6x_card,
253+
.matches = {
254+
DMI_MATCH(DMI_BOARD_VENDOR, "IRBIS"),
255+
DMI_MATCH(DMI_PRODUCT_NAME, "15NBC1011"),
256+
}
257+
},
237258
{}
238259
};
239260

sound/soc/codecs/cs42l56.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,18 +1191,12 @@ static int cs42l56_i2c_probe(struct i2c_client *i2c_client)
11911191
if (pdata) {
11921192
cs42l56->pdata = *pdata;
11931193
} else {
1194-
pdata = devm_kzalloc(&i2c_client->dev, sizeof(*pdata),
1195-
GFP_KERNEL);
1196-
if (!pdata)
1197-
return -ENOMEM;
1198-
11991194
if (i2c_client->dev.of_node) {
12001195
ret = cs42l56_handle_of_data(i2c_client,
12011196
&cs42l56->pdata);
12021197
if (ret != 0)
12031198
return ret;
12041199
}
1205-
cs42l56->pdata = *pdata;
12061200
}
12071201

12081202
if (cs42l56->pdata.gpio_nreset) {

sound/soc/codecs/wsa883x.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,8 +1359,8 @@ static struct snd_soc_dai_driver wsa883x_dais[] = {
13591359
.stream_name = "SPKR Playback",
13601360
.rates = WSA883X_RATES | WSA883X_FRAC_RATES,
13611361
.formats = WSA883X_FORMATS,
1362-
.rate_max = 8000,
1363-
.rate_min = 352800,
1362+
.rate_min = 8000,
1363+
.rate_max = 352800,
13641364
.channels_min = 1,
13651365
.channels_max = 1,
13661366
},

sound/soc/intel/avs/core.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,29 @@ static int avs_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
481481
return ret;
482482
}
483483

484+
static void avs_pci_shutdown(struct pci_dev *pci)
485+
{
486+
struct hdac_bus *bus = pci_get_drvdata(pci);
487+
struct avs_dev *adev = hdac_to_avs(bus);
488+
489+
cancel_work_sync(&adev->probe_work);
490+
avs_ipc_block(adev->ipc);
491+
492+
snd_hdac_stop_streams(bus);
493+
avs_dsp_op(adev, int_control, false);
494+
snd_hdac_ext_bus_ppcap_int_enable(bus, false);
495+
snd_hdac_ext_bus_link_power_down_all(bus);
496+
497+
snd_hdac_bus_stop_chip(bus);
498+
snd_hdac_display_power(bus, HDA_CODEC_IDX_CONTROLLER, false);
499+
500+
if (avs_platattr_test(adev, CLDMA))
501+
pci_free_irq(pci, 0, &code_loader);
502+
pci_free_irq(pci, 0, adev);
503+
pci_free_irq(pci, 0, bus);
504+
pci_free_irq_vectors(pci);
505+
}
506+
484507
static void avs_pci_remove(struct pci_dev *pci)
485508
{
486509
struct hdac_device *hdev, *save;
@@ -739,6 +762,7 @@ static struct pci_driver avs_pci_driver = {
739762
.id_table = avs_ids,
740763
.probe = avs_pci_probe,
741764
.remove = avs_pci_remove,
765+
.shutdown = avs_pci_shutdown,
742766
.driver = {
743767
.pm = &avs_dev_pm,
744768
},

sound/soc/intel/boards/bytcht_es8316.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -497,21 +497,28 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
497497
if (adev) {
498498
snprintf(codec_name, sizeof(codec_name),
499499
"i2c-%s", acpi_dev_name(adev));
500-
put_device(&adev->dev);
501500
byt_cht_es8316_dais[dai_index].codecs->name = codec_name;
502501
} else {
503502
dev_err(dev, "Error cannot find '%s' dev\n", mach->id);
504503
return -ENXIO;
505504
}
506505

506+
codec_dev = acpi_get_first_physical_node(adev);
507+
acpi_dev_put(adev);
508+
if (!codec_dev)
509+
return -EPROBE_DEFER;
510+
priv->codec_dev = get_device(codec_dev);
511+
507512
/* override platform name, if required */
508513
byt_cht_es8316_card.dev = dev;
509514
platform_name = mach->mach_params.platform;
510515

511516
ret = snd_soc_fixup_dai_links_platform_name(&byt_cht_es8316_card,
512517
platform_name);
513-
if (ret)
518+
if (ret) {
519+
put_device(codec_dev);
514520
return ret;
521+
}
515522

516523
/* Check for BYTCR or other platform and setup quirks */
517524
dmi_id = dmi_first_match(byt_cht_es8316_quirk_table);
@@ -539,13 +546,10 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
539546

540547
/* get the clock */
541548
priv->mclk = devm_clk_get(dev, "pmc_plt_clk_3");
542-
if (IS_ERR(priv->mclk))
549+
if (IS_ERR(priv->mclk)) {
550+
put_device(codec_dev);
543551
return dev_err_probe(dev, PTR_ERR(priv->mclk), "clk_get pmc_plt_clk_3 failed\n");
544-
545-
codec_dev = acpi_get_first_physical_node(adev);
546-
if (!codec_dev)
547-
return -EPROBE_DEFER;
548-
priv->codec_dev = get_device(codec_dev);
552+
}
549553

550554
if (quirk & BYT_CHT_ES8316_JD_INVERTED)
551555
props[cnt++] = PROPERTY_ENTRY_BOOL("everest,jack-detect-inverted");

sound/soc/intel/boards/bytcr_rt5640.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,13 +1636,18 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
16361636
if (adev) {
16371637
snprintf(byt_rt5640_codec_name, sizeof(byt_rt5640_codec_name),
16381638
"i2c-%s", acpi_dev_name(adev));
1639-
put_device(&adev->dev);
16401639
byt_rt5640_dais[dai_index].codecs->name = byt_rt5640_codec_name;
16411640
} else {
16421641
dev_err(dev, "Error cannot find '%s' dev\n", mach->id);
16431642
return -ENXIO;
16441643
}
16451644

1645+
codec_dev = acpi_get_first_physical_node(adev);
1646+
acpi_dev_put(adev);
1647+
if (!codec_dev)
1648+
return -EPROBE_DEFER;
1649+
priv->codec_dev = get_device(codec_dev);
1650+
16461651
/*
16471652
* swap SSP0 if bytcr is detected
16481653
* (will be overridden if DMI quirk is detected)
@@ -1717,11 +1722,6 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
17171722
byt_rt5640_quirk = quirk_override;
17181723
}
17191724

1720-
codec_dev = acpi_get_first_physical_node(adev);
1721-
if (!codec_dev)
1722-
return -EPROBE_DEFER;
1723-
priv->codec_dev = get_device(codec_dev);
1724-
17251725
if (byt_rt5640_quirk & BYT_RT5640_JD_HP_ELITEP_1000G2) {
17261726
acpi_dev_add_driver_gpios(ACPI_COMPANION(priv->codec_dev),
17271727
byt_rt5640_hp_elitepad_1000g2_gpios);

sound/soc/intel/boards/bytcr_rt5651.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,14 +922,14 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
922922
if (adev) {
923923
snprintf(byt_rt5651_codec_name, sizeof(byt_rt5651_codec_name),
924924
"i2c-%s", acpi_dev_name(adev));
925-
put_device(&adev->dev);
926925
byt_rt5651_dais[dai_index].codecs->name = byt_rt5651_codec_name;
927926
} else {
928927
dev_err(dev, "Error cannot find '%s' dev\n", mach->id);
929928
return -ENXIO;
930929
}
931930

932931
codec_dev = acpi_get_first_physical_node(adev);
932+
acpi_dev_put(adev);
933933
if (!codec_dev)
934934
return -EPROBE_DEFER;
935935
priv->codec_dev = get_device(codec_dev);

sound/soc/intel/boards/bytcr_wm5102.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,9 @@ static int snd_byt_wm5102_mc_probe(struct platform_device *pdev)
411411
return -ENOENT;
412412
}
413413
snprintf(codec_name, sizeof(codec_name), "spi-%s", acpi_dev_name(adev));
414-
put_device(&adev->dev);
415414

416415
codec_dev = bus_find_device_by_name(&spi_bus_type, NULL, codec_name);
416+
acpi_dev_put(adev);
417417
if (!codec_dev)
418418
return -EPROBE_DEFER;
419419

0 commit comments

Comments
 (0)