Unverified Commit a23ff143 authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: Intel: avs: Add support for MalibouLake

Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:

The avs-driver is the go-to driver for Intel Automotive. MalibouLake
(MBL) and RedondoLake (RDL) are representatives of the project. These
inherit majority of the featureset from RaptorLake-M (RPL-M) and
AlderLake-N (ADL-N) respectively. The onboard codec for these is TI's
pcm3168a.

In summary, the patchset:

- modifies existing pcm3168a.c to be x86/ACPI friendly
- updates the DSP firmware booting sequence for cAVS 2.5 platforms to
  improve its behaviour on some specific revisions/steppings of the
  hardware
- adds new machine board driver, avs_pcm3168a
- adds selector entry for RPL-M devices in intel-dspcfg

While there 'ALSA: hda:' patch within the list, I'd prefer the patchset
to go through Mark's tree to avoid conflicts with follow ups to this
one.

Longer version:

Currently the pcm3168a is supported on ARM/DT (ti/j721e-evm.c being the
only user). To make it x86/ACPI friendly, add relevant ACPI-match table
and relax driver's probing conditions.
The default format is 2ch, 24-bits, 48000kHz. As per specification,
24-bits are supported by the chip and it works in production in contrary
to what the existing code suggests. A fix is provided to align the code
with the spec.

Now, a single DSP firmware binary covers a wide range of platforms - a
single one covers AlderLake, RaptorLake and all their derevatires except
for AlderLake-N based due to MEU differences. While most of the hardware
capabilities are read by the firmware during runtime, some information is
not accessible from the DSP level. Provide the HDAudio controller
revision/stepping information to the firmware to address that.

With that done, expand number of modules supported with WovHostModule
(WHM). WHM is a processing module which is tailored for ultra-low-power
scenarios. From software perspective, as most of its config is similar
to the Copier module, code reuse is advised. To make the reuse possible,
existing gateway configuration code is refactor - not only to add
support for WHM but also make it easier to understand. Multiple smaller
functions instead of all-in-one one.
parents 4c751806 856366dc
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -77,6 +77,13 @@ enum avs_tplg_token {
	AVS_TKN_MODCFG_UPDOWN_MIX_CHAN_MAP_U32		= 430,
	AVS_TKN_MODCFG_EXT_NUM_INPUT_PINS_U16		= 431,
	AVS_TKN_MODCFG_EXT_NUM_OUTPUT_PINS_U16		= 432,
	AVS_TKN_MODCFG_WHM_REF_AFMT_ID_U32		= 433,
	AVS_TKN_MODCFG_WHM_OUT_AFMT_ID_U32		= 434,
	AVS_TKN_MODCFG_WHM_WAKE_TICK_PERIOD_U32		= 435,
	AVS_TKN_MODCFG_WHM_VINDEX_U8			= 436,
	AVS_TKN_MODCFG_WHM_DMA_TYPE_U32			= 437,
	AVS_TKN_MODCFG_WHM_DMABUFF_SIZE_U32		= 438,
	AVS_TKN_MODCFG_WHM_BLOB_AFMT_ID_U32		= 439,

	/* struct avs_tplg_pplcfg */
	AVS_TKN_PPLCFG_ID_U32				= 1401,
+4 −0
Original line number Diff line number Diff line
@@ -108,6 +108,10 @@ static const struct config_entry config_table[] = {
			{}
		}
	},
	{
		.flags = FLAG_SST,
		.device = PCI_DEVICE_ID_INTEL_HDA_RPL_M,
	},
#endif
#if IS_ENABLED(CONFIG_SND_SOC_SOF_APOLLOLAKE)
	{
+9 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>

#include <sound/soc.h>

@@ -37,6 +38,13 @@ static const struct i2c_device_id pcm3168a_i2c_id[] = {
};
MODULE_DEVICE_TABLE(i2c, pcm3168a_i2c_id);

static const struct acpi_device_id pcm3168a_acpi_match[] = {
	{ "PCM3168A" },
	{ "104C3168" },
	{}
};
MODULE_DEVICE_TABLE(acpi, pcm3168a_acpi_match);

static const struct of_device_id pcm3168a_of_match[] = {
	{ .compatible = "ti,pcm3168a", },
	{ }
@@ -49,6 +57,7 @@ static struct i2c_driver pcm3168a_i2c_driver = {
	.id_table	= pcm3168a_i2c_id,
	.driver		= {
		.name	= "pcm3168a",
		.acpi_match_table = pcm3168a_acpi_match,
		.of_match_table = pcm3168a_of_match,
		.pm		= &pcm3168a_pm_ops,
	},
+7 −4
Original line number Diff line number Diff line
@@ -493,9 +493,9 @@ static int pcm3168a_hw_params(struct snd_pcm_substream *substream,
		}
		break;
	case 24:
		if (provider_mode || (format == SND_SOC_DAIFMT_DSP_A) ||
		    		     (format == SND_SOC_DAIFMT_DSP_B)) {
			dev_err(component->dev, "24-bit slots not supported in provider mode, or consumer mode using DSP\n");
		if (!provider_mode && ((format == SND_SOC_DAIFMT_DSP_A) ||
				       (format == SND_SOC_DAIFMT_DSP_B))) {
			dev_err(component->dev, "24-bit slots not supported in consumer mode using DSP\n");
			return -EINVAL;
		}
		break;
@@ -743,7 +743,7 @@ int pcm3168a_probe(struct device *dev, struct regmap *regmap)
		return dev_err_probe(dev, PTR_ERR(pcm3168a->gpio_rst),
				     "failed to acquire RST gpio\n");

	pcm3168a->scki = devm_clk_get(dev, "scki");
	pcm3168a->scki = devm_clk_get_optional(dev, "scki");
	if (IS_ERR(pcm3168a->scki))
		return dev_err_probe(dev, PTR_ERR(pcm3168a->scki),
				     "failed to acquire clock 'scki'\n");
@@ -755,6 +755,9 @@ int pcm3168a_probe(struct device *dev, struct regmap *regmap)
	}

	pcm3168a->sysclk = clk_get_rate(pcm3168a->scki);
	/* Fallback to the default if no clk entry available. */
	if (!pcm3168a->sysclk)
		pcm3168a->sysclk = 24576000;

	for (i = 0; i < ARRAY_SIZE(pcm3168a->supplies); i++)
		pcm3168a->supplies[i].supply = pcm3168a_supply_names[i];
+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ struct avs_dsp_ops {
	int (* const load_basefw)(struct avs_dev *, struct firmware *);
	int (* const load_lib)(struct avs_dev *, struct firmware *, u32);
	int (* const transfer_mods)(struct avs_dev *, bool, struct avs_module_entry *, u32);
	int (* const config_basefw)(struct avs_dev *);
	int (* const enable_logs)(struct avs_dev *, enum avs_log_enable, u32, u32, unsigned long,
				  u32 *);
	int (* const log_buffer_offset)(struct avs_dev *, u32);
Loading