Skip to content

Commit 2e5bf5b

Browse files
committed
Merge tag 'asoc-fix-v6.13-merge-window' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.13 A pile of driver specific quirks and fixes that came in since the merge window. One of the AMD fixes is a bit broken for some systems, I'm expecting an incremental change to fix that but it seems better overall to merge the rest of the fixes. There's also one small documentation update that seemed sensible to apply now, pointing to the dapm-graph tool.
2 parents a7df7f9 + b682aa7 commit 2e5bf5b

File tree

9 files changed

+86
-10
lines changed

9 files changed

+86
-10
lines changed

Documentation/sound/soc/dapm.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ The graph for the STM32MP1-DK1 sound card is shown in picture:
3535
:alt: Example DAPM graph
3636
:align: center
3737

38+
You can also generate compatible graph for your sound card using
39+
`tools/sound/dapm-graph` utility.
40+
3841
DAPM power domains
3942
==================
4043

sound/soc/amd/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ config SND_SOC_AMD_SOUNDWIRE
163163
config SND_SOC_AMD_PS
164164
tristate "AMD Audio Coprocessor-v6.3 Pink Sardine support"
165165
select SND_SOC_AMD_SOUNDWIRE_LINK_BASELINE
166+
select SND_SOC_ACPI_AMD_MATCH
166167
depends on X86 && PCI && ACPI
167168
help
168169
This option enables Audio Coprocessor i.e ACP v6.3 support on

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

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
220220
DMI_MATCH(DMI_PRODUCT_NAME, "21J6"),
221221
}
222222
},
223+
{
224+
.driver_data = &acp6x_card,
225+
.matches = {
226+
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
227+
DMI_MATCH(DMI_PRODUCT_NAME, "21M1"),
228+
}
229+
},
223230
{
224231
.driver_data = &acp6x_card,
225232
.matches = {
@@ -241,6 +248,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
241248
DMI_MATCH(DMI_PRODUCT_NAME, "21M5"),
242249
}
243250
},
251+
{
252+
.driver_data = &acp6x_card,
253+
.matches = {
254+
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
255+
DMI_MATCH(DMI_PRODUCT_NAME, "21ME"),
256+
}
257+
},
244258
{
245259
.driver_data = &acp6x_card,
246260
.matches = {
@@ -409,6 +423,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
409423
DMI_MATCH(DMI_PRODUCT_NAME, "Xiaomi Book Pro 14 2022"),
410424
}
411425
},
426+
{
427+
.driver_data = &acp6x_card,
428+
.matches = {
429+
DMI_MATCH(DMI_BOARD_VENDOR, "TIMI"),
430+
DMI_MATCH(DMI_PRODUCT_NAME, "Redmi G 2022"),
431+
}
432+
},
412433
{
413434
.driver_data = &acp6x_card,
414435
.matches = {
@@ -537,18 +558,34 @@ static int acp6x_probe(struct platform_device *pdev)
537558
struct acp6x_pdm *machine = NULL;
538559
struct snd_soc_card *card;
539560
struct acpi_device *adev;
561+
acpi_handle handle;
562+
acpi_integer dmic_status;
540563
int ret;
564+
bool is_dmic_enable, wov_en;
541565

566+
/* IF WOV entry not found, enable dmic based on AcpDmicConnected entry*/
567+
is_dmic_enable = false;
568+
wov_en = true;
542569
/* check the parent device's firmware node has _DSD or not */
543570
adev = ACPI_COMPANION(pdev->dev.parent);
544571
if (adev) {
545572
const union acpi_object *obj;
546573

547574
if (!acpi_dev_get_property(adev, "AcpDmicConnected", ACPI_TYPE_INTEGER, &obj) &&
548575
obj->integer.value == 1)
549-
platform_set_drvdata(pdev, &acp6x_card);
576+
is_dmic_enable = true;
550577
}
551578

579+
handle = ACPI_HANDLE(pdev->dev.parent);
580+
ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status);
581+
if (!ACPI_FAILURE(ret))
582+
wov_en = dmic_status;
583+
584+
if (is_dmic_enable && wov_en)
585+
platform_set_drvdata(pdev, &acp6x_card);
586+
else
587+
return 0;
588+
552589
/* check for any DMI overrides */
553590
dmi_id = dmi_first_match(yc_acp_quirk_table);
554591
if (dmi_id)

sound/soc/apple/mca.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ static int mca_fe_hw_params(struct snd_pcm_substream *substream,
616616
tdm_slot_width = 32;
617617

618618
if (tdm_slot_width < params_width(params)) {
619-
dev_err(dev, "TDM slots too narrow (tdm=%d params=%d)\n",
619+
dev_err(dev, "TDM slots too narrow (tdm=%u params=%d)\n",
620620
tdm_slot_width, params_width(params));
621621
return -EINVAL;
622622
}

sound/soc/fsl/imx-audmix.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@ static int imx_audmix_probe(struct platform_device *pdev)
274274
/* Add AUDMIX Backend */
275275
be_name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
276276
"audmix-%d", i);
277+
if (!be_name)
278+
return -ENOMEM;
279+
277280
priv->dai[num_dai + i].cpus = &dlc[1];
278281
priv->dai[num_dai + i].codecs = &snd_soc_dummy_dlc;
279282

sound/soc/mediatek/mt8188/mt8188-mt6359.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,10 +1277,12 @@ static int mt8188_mt6359_soc_card_probe(struct mtk_soc_card_data *soc_card_data,
12771277

12781278
for_each_card_prelinks(card, i, dai_link) {
12791279
if (strcmp(dai_link->name, "DPTX_BE") == 0) {
1280-
if (strcmp(dai_link->codecs->dai_name, "snd-soc-dummy-dai"))
1280+
if (dai_link->num_codecs &&
1281+
strcmp(dai_link->codecs->dai_name, "snd-soc-dummy-dai"))
12811282
dai_link->init = mt8188_dptx_codec_init;
12821283
} else if (strcmp(dai_link->name, "ETDM3_OUT_BE") == 0) {
1283-
if (strcmp(dai_link->codecs->dai_name, "snd-soc-dummy-dai"))
1284+
if (dai_link->num_codecs &&
1285+
strcmp(dai_link->codecs->dai_name, "snd-soc-dummy-dai"))
12841286
dai_link->init = mt8188_hdmi_codec_init;
12851287
} else if (strcmp(dai_link->name, "DL_SRC_BE") == 0 ||
12861288
strcmp(dai_link->name, "UL_SRC_BE") == 0) {
@@ -1292,6 +1294,9 @@ static int mt8188_mt6359_soc_card_probe(struct mtk_soc_card_data *soc_card_data,
12921294
strcmp(dai_link->name, "ETDM2_OUT_BE") == 0 ||
12931295
strcmp(dai_link->name, "ETDM1_IN_BE") == 0 ||
12941296
strcmp(dai_link->name, "ETDM2_IN_BE") == 0) {
1297+
if (!dai_link->num_codecs)
1298+
continue;
1299+
12951300
if (!strcmp(dai_link->codecs->dai_name, MAX98390_CODEC_DAI)) {
12961301
/*
12971302
* The TDM protocol settings with fixed 4 slots are defined in

sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ static int mt8192_mt6359_legacy_probe(struct mtk_soc_card_data *soc_card_data)
10911091
dai_link->ignore = 0;
10921092
}
10931093

1094-
if (dai_link->num_codecs && dai_link->codecs[0].dai_name &&
1094+
if (dai_link->num_codecs &&
10951095
strcmp(dai_link->codecs[0].dai_name, RT1015_CODEC_DAI) == 0)
10961096
dai_link->ops = &mt8192_rt1015_i2s_ops;
10971097
}
@@ -1119,7 +1119,7 @@ static int mt8192_mt6359_soc_card_probe(struct mtk_soc_card_data *soc_card_data,
11191119
int i;
11201120

11211121
for_each_card_prelinks(card, i, dai_link)
1122-
if (dai_link->num_codecs && dai_link->codecs[0].dai_name &&
1122+
if (dai_link->num_codecs &&
11231123
strcmp(dai_link->codecs[0].dai_name, RT1015_CODEC_DAI) == 0)
11241124
dai_link->ops = &mt8192_rt1015_i2s_ops;
11251125
}

sound/soc/mediatek/mt8195/mt8195-mt6359.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,10 +1378,12 @@ static int mt8195_mt6359_soc_card_probe(struct mtk_soc_card_data *soc_card_data,
13781378

13791379
for_each_card_prelinks(card, i, dai_link) {
13801380
if (strcmp(dai_link->name, "DPTX_BE") == 0) {
1381-
if (strcmp(dai_link->codecs->dai_name, "snd-soc-dummy-dai"))
1381+
if (dai_link->num_codecs &&
1382+
strcmp(dai_link->codecs->dai_name, "snd-soc-dummy-dai"))
13821383
dai_link->init = mt8195_dptx_codec_init;
13831384
} else if (strcmp(dai_link->name, "ETDM3_OUT_BE") == 0) {
1384-
if (strcmp(dai_link->codecs->dai_name, "snd-soc-dummy-dai"))
1385+
if (dai_link->num_codecs &&
1386+
strcmp(dai_link->codecs->dai_name, "snd-soc-dummy-dai"))
13851387
dai_link->init = mt8195_hdmi_codec_init;
13861388
} else if (strcmp(dai_link->name, "DL_SRC_BE") == 0 ||
13871389
strcmp(dai_link->name, "UL_SRC1_BE") == 0 ||
@@ -1394,6 +1396,9 @@ static int mt8195_mt6359_soc_card_probe(struct mtk_soc_card_data *soc_card_data,
13941396
strcmp(dai_link->name, "ETDM2_OUT_BE") == 0 ||
13951397
strcmp(dai_link->name, "ETDM1_IN_BE") == 0 ||
13961398
strcmp(dai_link->name, "ETDM2_IN_BE") == 0) {
1399+
if (!dai_link->num_codecs)
1400+
continue;
1401+
13971402
if (!strcmp(dai_link->codecs->dai_name, MAX98390_CODEC_DAI)) {
13981403
if (!(codec_init & MAX98390_CODEC_INIT)) {
13991404
dai_link->init = mt8195_max98390_init;

sound/soc/sof/ipc3-topology.c

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
/* size of tplg ABI in bytes */
2121
#define SOF_IPC3_TPLG_ABI_SIZE 3
2222

23+
/* Base of SOF_DAI_INTEL_ALH, this should be aligned with SOC_SDW_INTEL_BIDIR_PDI_BASE */
24+
#define INTEL_ALH_DAI_INDEX_BASE 2
25+
2326
struct sof_widget_data {
2427
int ctrl_type;
2528
int ipc_cmd;
@@ -1594,6 +1597,17 @@ static int sof_ipc3_widget_setup_comp_dai(struct snd_sof_widget *swidget)
15941597
if (ret < 0)
15951598
goto free;
15961599

1600+
/* Subtract the base to match the FW dai index. */
1601+
if (comp_dai->type == SOF_DAI_INTEL_ALH) {
1602+
if (comp_dai->dai_index < INTEL_ALH_DAI_INDEX_BASE) {
1603+
dev_err(sdev->dev,
1604+
"Invalid ALH dai index %d, only Pin numbers >= %d can be used\n",
1605+
comp_dai->dai_index, INTEL_ALH_DAI_INDEX_BASE);
1606+
return -EINVAL;
1607+
}
1608+
comp_dai->dai_index -= INTEL_ALH_DAI_INDEX_BASE;
1609+
}
1610+
15971611
dev_dbg(scomp->dev, "dai %s: type %d index %d\n",
15981612
swidget->widget->name, comp_dai->type, comp_dai->dai_index);
15991613
sof_dbg_comp_config(scomp, &comp_dai->config);
@@ -2167,8 +2181,16 @@ static int sof_ipc3_dai_config(struct snd_sof_dev *sdev, struct snd_sof_widget *
21672181
case SOF_DAI_INTEL_ALH:
21682182
if (data) {
21692183
/* save the dai_index during hw_params and reuse it for hw_free */
2170-
if (flags & SOF_DAI_CONFIG_FLAGS_HW_PARAMS)
2171-
config->dai_index = data->dai_index;
2184+
if (flags & SOF_DAI_CONFIG_FLAGS_HW_PARAMS) {
2185+
/* Subtract the base to match the FW dai index. */
2186+
if (data->dai_index < INTEL_ALH_DAI_INDEX_BASE) {
2187+
dev_err(sdev->dev,
2188+
"Invalid ALH dai index %d, only Pin numbers >= %d can be used\n",
2189+
config->dai_index, INTEL_ALH_DAI_INDEX_BASE);
2190+
return -EINVAL;
2191+
}
2192+
config->dai_index = data->dai_index - INTEL_ALH_DAI_INDEX_BASE;
2193+
}
21722194
config->alh.stream_id = data->dai_data;
21732195
}
21742196
break;

0 commit comments

Comments
 (0)