Unverified Commit 4694b838 authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown
Browse files

ASoC: Intel: soc-acpi: quirk topology filename dynamically

Different topology filenames may be required depending on which SSP is
used, and whether or not digital mics are present.

This patch adds a tplg_quirk_mask and in the case of the SOF driver
adds the relevant configurations.

This is a short-term solution to the ES8336 support issues.

In a long-term solution, we would need an interface where the machine
driver or platform driver have the ability to alter the topology
hard-coded low-level hardware support, e.g. by substituting an
interface for another, or disabling an interface that is not supported
on a given skew.

BugLink: https://github.com/thesofproject/linux/issues/3248


Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: default avatarPéter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220308192610.392950-7-pierre-louis.bossart@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent bd015f63
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -125,6 +125,24 @@ struct snd_soc_acpi_link_adr {
	const struct snd_soc_acpi_adr_device *adr_d;
};

/*
 * when set the topology uses the -ssp<N> suffix, where N is determined based on
 * BIOS or DMI information
 */
#define SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER BIT(0)

/*
 * when more than one SSP is reported in the link mask, use the most significant.
 * This choice was found to be valid on platforms with ES8336 codecs.
 */
#define SND_SOC_ACPI_TPLG_INTEL_SSP_MSB BIT(1)

/*
 * when set the topology uses the -dmic<N>ch suffix, where N is determined based on
 * BIOS or DMI information
 */
#define SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER BIT(2)

/**
 * snd_soc_acpi_mach: ACPI-based machine descriptor. Most of the fields are
 * related to the hardware, except for the firmware and topology file names.
@@ -146,6 +164,7 @@ struct snd_soc_acpi_link_adr {
 * @pdata: intended for platform data or machine specific-ops. This structure
 *  is not constant since this field may be updated at run-time
 * @sof_tplg_filename: Sound Open Firmware topology file name, if enabled
 * @tplg_quirk_mask: quirks to select different topology files dynamically
 */
/* Descriptor for SST ASoC machine driver */
struct snd_soc_acpi_mach {
@@ -161,6 +180,7 @@ struct snd_soc_acpi_mach {
	void *pdata;
	struct snd_soc_acpi_mach_params mach_params;
	const char *sof_tplg_filename;
	const u32 tplg_quirk_mask;
};

#define SND_SOC_ACPI_MAX_CODECS 3
+4 −1
Original line number Diff line number Diff line
@@ -80,7 +80,10 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_bxt_machines[] = {
	{
		.id = "ESSX8336",
		.drv_name = "sof-essx8336",
		.sof_tplg_filename = "sof-apl-es8336.tplg",
		.sof_tplg_filename = "sof-apl-es8336", /* the tplg suffix is added at run time */
		.tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER |
					SND_SOC_ACPI_TPLG_INTEL_SSP_MSB |
					SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER,
	},
	{},
};
+4 −1
Original line number Diff line number Diff line
@@ -78,7 +78,10 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_cml_machines[] = {
	{
		.id = "ESSX8336",
		.drv_name = "sof-essx8336",
		.sof_tplg_filename = "sof-cml-es8336.tplg",
		.sof_tplg_filename = "sof-cml-es8336", /* the tplg suffix is added at run time */
		.tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER |
					SND_SOC_ACPI_TPLG_INTEL_SSP_MSB |
					SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER,
	},
	{},
};
+4 −1
Original line number Diff line number Diff line
@@ -55,7 +55,10 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_glk_machines[] = {
	{
		.id = "ESSX8336",
		.drv_name = "sof-essx8336",
		.sof_tplg_filename = "sof-glk-es8336.tplg",
		.sof_tplg_filename = "sof-glk-es8336", /* the tplg suffix is added at run time */
		.tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER |
					SND_SOC_ACPI_TPLG_INTEL_SSP_MSB |
					SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER,
	},
	{},
};
+4 −1
Original line number Diff line number Diff line
@@ -83,7 +83,10 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_jsl_machines[] = {
	{
		.id = "ESSX8336",
		.drv_name = "sof-essx8336",
		.sof_tplg_filename = "sof-jsl-es8336.tplg",
		.sof_tplg_filename = "sof-jsl-es8336", /* the tplg suffix is added at run time */
		.tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER |
					SND_SOC_ACPI_TPLG_INTEL_SSP_MSB |
					SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER,
	},
	{},
};
Loading