Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions sound/soc/intel/common/soc-acpi-intel-ssp-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ static const struct codec_map amps[] = {
CODEC_MAP_ENTRY("RT1015P", "rt1015", RT1015P_ACPI_HID, CODEC_RT1015P),
CODEC_MAP_ENTRY("RT1019P", "rt1019", RT1019P_ACPI_HID, CODEC_RT1019P),
CODEC_MAP_ENTRY("RT1308", "rt1308", RT1308_ACPI_HID, CODEC_RT1308),

/*
* Monolithic components
*
* Only put components that can serve as both the amp and the codec below this line.
* This will ensure that if the part is used just as a codec and there is an amp as well
* then the amp will be selected properly.
*/
CODEC_MAP_ENTRY("RT5650", "rt5650", RT5650_ACPI_HID, CODEC_RT5650),
};

enum snd_soc_acpi_intel_codec
Expand Down
17 changes: 9 additions & 8 deletions sound/soc/sof/intel/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -1305,9 +1305,10 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev)
const struct sof_dev_desc *desc = sof_pdata->desc;
struct hdac_bus *bus = sof_to_bus(sdev);
struct snd_soc_acpi_mach *mach = NULL;
enum snd_soc_acpi_intel_codec codec_type;
enum snd_soc_acpi_intel_codec codec_type, amp_type;
const char *tplg_filename;
const char *tplg_suffix;
bool amp_name_valid;

/* Try I2S or DMIC if it is supported */
if (interface_mask & (BIT(SOF_DAI_INTEL_SSP) | BIT(SOF_DAI_INTEL_DMIC)))
Expand Down Expand Up @@ -1411,15 +1412,16 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev)
}
}

codec_type = snd_soc_acpi_intel_detect_amp_type(sdev->dev);
amp_type = snd_soc_acpi_intel_detect_amp_type(sdev->dev);
codec_type = snd_soc_acpi_intel_detect_codec_type(sdev->dev);
amp_name_valid = amp_type != CODEC_NONE && amp_type != codec_type;

if (tplg_fixup &&
mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_AMP_NAME &&
codec_type != CODEC_NONE) {
tplg_suffix = snd_soc_acpi_intel_get_amp_tplg_suffix(codec_type);
if (tplg_fixup && amp_name_valid &&
mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_AMP_NAME) {
tplg_suffix = snd_soc_acpi_intel_get_amp_tplg_suffix(amp_type);
if (!tplg_suffix) {
dev_err(sdev->dev, "no tplg suffix found, amp %d\n",
codec_type);
amp_type);
return NULL;
}

Expand All @@ -1434,7 +1436,6 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev)
add_extension = true;
}

codec_type = snd_soc_acpi_intel_detect_codec_type(sdev->dev);

if (tplg_fixup &&
mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME &&
Expand Down