Skip to content
Draft
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
28 changes: 28 additions & 0 deletions sound/soc/intel/common/soc-acpi-intel-hda-match.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,41 @@
*
*/

#include <linux/dmi.h>
#include <sound/soc-acpi.h>
#include <sound/soc-acpi-intel-match.h>

static const struct dmi_system_id hda_pdm1_dmic[] = {
{
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "XIAOMI"),
DMI_MATCH(DMI_PRODUCT_NAME, "Redmi Book Pro 16 2025"),
},
},
{ }
};

static struct snd_soc_acpi_mach intel_hda_dmic_4ch_pdm1_mach = {
/* .id is not used in this file */
.drv_name = "skl_hda_dsp_generic",
.sof_tplg_filename = "sof-hda-generic-4ch-pdm1",
};

static struct snd_soc_acpi_mach *hda_dmic_pdm1_quirk(void *arg)
{
struct snd_soc_acpi_mach *mach = arg;

if (dmi_check_system(hda_pdm1_dmic))
return &intel_hda_dmic_4ch_pdm1_mach;

return mach;
};
Comment on lines +23 to +37

struct snd_soc_acpi_mach snd_soc_acpi_intel_hda_machines[] = {
{
/* .id is not used in this file */
.drv_name = "skl_hda_dsp_generic",
.machine_quirk = hda_dmic_pdm1_quirk,
.sof_tplg_filename = "sof-hda-generic", /* the tplg suffix is added at run time */
.tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER,
},
Expand Down
11 changes: 10 additions & 1 deletion sound/soc/sof/intel/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ static void hda_generic_machine_select(struct snd_sof_dev *sdev,
{
struct hdac_bus *bus = sof_to_bus(sdev);
struct snd_soc_acpi_mach_params *mach_params;
struct snd_soc_acpi_mach *hda_mach;
struct snd_soc_acpi_mach *hda_mach, *mach_alt;
struct snd_sof_pdata *pdata = sdev->pdata;
const char *tplg_filename;
int codec_num = 0;
Expand Down Expand Up @@ -1095,6 +1095,15 @@ static void hda_generic_machine_select(struct snd_sof_dev *sdev,
if (!pdata->tplg_filename)
tplg_fixup = true;

if (hda_mach->machine_quirk) {
mach_alt = hda_mach->machine_quirk(hda_mach);
if (mach_alt) {
hda_mach = mach_alt;
tplg_fixup = false;
dev_dbg(bus->dev, "using quirk for HDA machine driver\n");
}
}
Comment on lines +1098 to +1105

if (tplg_fixup &&
codec_num == 1 && HDA_IDISP_CODEC(bus->codec_mask)) {
tplg_filename = devm_kasprintf(sdev->dev, GFP_KERNEL,
Expand Down
Loading