Skip to content

Commit 6f6a23d

Browse files
cujomalaineybroonie
authored andcommitted
ASoC: Intel: Fix RT5650 SSP lookup
Commit 8efcd48 ("ASoC: Intel: sof_rt5682: use common module for sof_card_private initialization") migrated the pin assignment in the context struct up to soc-acpi-intel-ssp-common.c. This uses a lookup table to see if a device has a amp/codec before assigning the pin. The issue here arises when combination parts that serve both (with 2 ports) are used. sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:1f.3/adl_rt5682_def/SSP0-Codec' CPU: 1 PID: 2079 Comm: udevd Tainted: G U 6.6.36-03391-g744739e00023 #1 3be1a2880a0970f65545a957db7d08ef4b3e2c0d Hardware name: Google Anraggar/Anraggar, BIOS Google_Anraggar.15217.552.0 05/07/2024 Call Trace: <TASK> dump_stack_lvl+0x69/0xa0 sysfs_warn_dup+0x5b/0x70 sysfs_create_dir_ns+0xb0/0x100 kobject_add_internal+0x133/0x3c0 kobject_add+0x66/0xb0 ? device_add+0x65/0x780 device_add+0x164/0x780 snd_soc_add_pcm_runtimes+0x2fa/0x800 snd_soc_bind_card+0x35e/0xc20 devm_snd_soc_register_card+0x48/0x90 platform_probe+0x7b/0xb0 really_probe+0xf7/0x2a0 ... kobject: kobject_add_internal failed for SSP0-Codec with -EEXIST, don't try to register things with the same name in the same directory. The issue is that the ALC5650 was only defined in the codec table and not the amp table which left the pin unassigned but the dai link was still created by the machine driver. Also patch the suffix filename code for the topology to prevent double suffix names as a result of this change. Fixes: 8efcd48 ("ASoC: Intel: sof_rt5682: use common module for sof_card_private initialization") Reviewed-by: Bard Liao <[email protected]> Signed-off-by: Curtis Malainey <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 9ee3f0d commit 6f6a23d

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

sound/soc/intel/common/soc-acpi-intel-ssp-common.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ static const struct codec_map amps[] = {
6464
CODEC_MAP_ENTRY("RT1015P", "rt1015", RT1015P_ACPI_HID, CODEC_RT1015P),
6565
CODEC_MAP_ENTRY("RT1019P", "rt1019", RT1019P_ACPI_HID, CODEC_RT1019P),
6666
CODEC_MAP_ENTRY("RT1308", "rt1308", RT1308_ACPI_HID, CODEC_RT1308),
67+
68+
/*
69+
* Monolithic components
70+
*
71+
* Only put components that can serve as both the amp and the codec below this line.
72+
* This will ensure that if the part is used just as a codec and there is an amp as well
73+
* then the amp will be selected properly.
74+
*/
75+
CODEC_MAP_ENTRY("RT5650", "rt5650", RT5650_ACPI_HID, CODEC_RT5650),
6776
};
6877

6978
enum snd_soc_acpi_intel_codec

sound/soc/sof/intel/hda.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,9 +1307,10 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev)
13071307
const struct sof_dev_desc *desc = sof_pdata->desc;
13081308
struct hdac_bus *bus = sof_to_bus(sdev);
13091309
struct snd_soc_acpi_mach *mach = NULL;
1310-
enum snd_soc_acpi_intel_codec codec_type;
1310+
enum snd_soc_acpi_intel_codec codec_type, amp_type;
13111311
const char *tplg_filename;
13121312
const char *tplg_suffix;
1313+
bool amp_name_valid;
13131314

13141315
/* Try I2S or DMIC if it is supported */
13151316
if (interface_mask & (BIT(SOF_DAI_INTEL_SSP) | BIT(SOF_DAI_INTEL_DMIC)))
@@ -1413,15 +1414,16 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev)
14131414
}
14141415
}
14151416

1416-
codec_type = snd_soc_acpi_intel_detect_amp_type(sdev->dev);
1417+
amp_type = snd_soc_acpi_intel_detect_amp_type(sdev->dev);
1418+
codec_type = snd_soc_acpi_intel_detect_codec_type(sdev->dev);
1419+
amp_name_valid = amp_type != CODEC_NONE && amp_type != codec_type;
14171420

1418-
if (tplg_fixup &&
1419-
mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_AMP_NAME &&
1420-
codec_type != CODEC_NONE) {
1421-
tplg_suffix = snd_soc_acpi_intel_get_amp_tplg_suffix(codec_type);
1421+
if (tplg_fixup && amp_name_valid &&
1422+
mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_AMP_NAME) {
1423+
tplg_suffix = snd_soc_acpi_intel_get_amp_tplg_suffix(amp_type);
14221424
if (!tplg_suffix) {
14231425
dev_err(sdev->dev, "no tplg suffix found, amp %d\n",
1424-
codec_type);
1426+
amp_type);
14251427
return NULL;
14261428
}
14271429

@@ -1436,7 +1438,6 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev)
14361438
add_extension = true;
14371439
}
14381440

1439-
codec_type = snd_soc_acpi_intel_detect_codec_type(sdev->dev);
14401441

14411442
if (tplg_fixup &&
14421443
mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME &&

0 commit comments

Comments
 (0)