Unverified Commit 7ed1bf73 authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: SOF: add INTEL_IPC4 plumbing

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

The INTEL_IPC4 protocol and firmware architecture will rely on
different sets of firmware binary and topology files. Some platforms
will only support INTEL_IPC4, some will support both INTEL_IPC4 and
SOF_IPC for development, and some will stay with the existing SOF_IPC.

This patchset adds new IPC definitions, and search paths for firmware
and topology files, along with means to override the default IPC type
and search paths for development. The firmware binary names are
aligned with those used by the Intel AVS driver to avoid duplicate
firmware installs, but the topology will have to differ due to driver
architecture differences.
parents e1bbfccf 03cf7262
Loading
Loading
Loading
Loading
+19 −4
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
#include <sound/soc-acpi.h>

struct snd_sof_dsp_ops;
struct snd_sof_dev;

/**
 * enum sof_fw_state - DSP firmware state definitions
@@ -47,6 +48,13 @@ enum sof_dsp_power_states {
	SOF_DSP_PM_D3,
};

/* Definitions for multiple IPCs */
enum sof_ipc_type {
	SOF_IPC,
	SOF_INTEL_IPC4,
	SOF_IPC_TYPE_COUNT
};

/*
 * SOF Platform data.
 */
@@ -83,6 +91,8 @@ struct snd_sof_pdata {
	const struct snd_soc_acpi_mach *machine;

	void *hw_pdata;

	enum sof_ipc_type ipc_type;
};

/*
@@ -115,14 +125,19 @@ struct sof_dev_desc {
	/* defaults for no codec mode */
	const char *nocodec_tplg_filename;

	/* information on supported IPCs */
	unsigned int ipc_supported_mask;
	enum sof_ipc_type ipc_default;

	/* defaults paths for firmware and topology files */
	const char *default_fw_path;
	const char *default_tplg_path;
	const char *default_fw_path[SOF_IPC_TYPE_COUNT];
	const char *default_tplg_path[SOF_IPC_TYPE_COUNT];

	/* default firmware name */
	const char *default_fw_filename;
	const char *default_fw_filename[SOF_IPC_TYPE_COUNT];

	const struct snd_sof_dsp_ops *ops;
	struct snd_sof_dsp_ops *ops;
	int (*ops_init)(struct snd_sof_dev *sdev);
};

int sof_dai_get_mclk(struct snd_soc_pcm_runtime *rtd);
+1 −1
Original line number Diff line number Diff line
@@ -204,7 +204,7 @@ int acp_pcm_hw_params(struct snd_sof_dev *sdev, struct snd_pcm_substream *substr
		      struct snd_pcm_hw_params *params,
		      struct snd_sof_platform_stream_params *platform_params);

extern const struct snd_sof_dsp_ops sof_renoir_ops;
extern struct snd_sof_dsp_ops sof_renoir_ops;

/* Machine configuration */
int snd_amd_acp_find_config(struct pci_dev *pci);
+11 −3
Original line number Diff line number Diff line
@@ -54,9 +54,17 @@ static const struct sof_dev_desc renoir_desc = {
	.resindex_imr_base	= -1,
	.irqindex_host_ipc	= -1,
	.chip_info		= &renoir_chip_info,
	.default_fw_path	= "amd/sof",
	.default_tplg_path	= "amd/sof-tplg",
	.default_fw_filename	= "sof-rn.ri",
	.ipc_supported_mask	= BIT(SOF_IPC),
	.ipc_default		= SOF_IPC,
	.default_fw_path = {
		[SOF_IPC] = "amd/sof",
	},
	.default_tplg_path = {
		[SOF_IPC] = "amd/sof-tplg",
	},
	.default_fw_filename	= {
		[SOF_IPC] = "sof-rn.ri",
	},
	.nocodec_tplg_filename	= "sof-acp.tplg",
	.ops			= &sof_renoir_ops,
};
+1 −1
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ static struct snd_soc_acpi_mach *amd_sof_machine_select(struct snd_sof_dev *sdev
}

/* AMD Renoir DSP ops */
const struct snd_sof_dsp_ops sof_renoir_ops = {
struct snd_sof_dsp_ops sof_renoir_ops = {
	/* probe and remove */
	.probe			= amd_sof_acp_probe,
	.remove			= amd_sof_acp_remove,
+6 −0
Original line number Diff line number Diff line
@@ -342,6 +342,7 @@ static void sof_probe_work(struct work_struct *work)
int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data)
{
	struct snd_sof_dev *sdev;
	int ret;

	sdev = devm_kzalloc(dev, sizeof(*sdev), GFP_KERNEL);
	if (!sdev)
@@ -357,6 +358,11 @@ int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data)
	sdev->first_boot = true;
	dev_set_drvdata(dev, sdev);

	/* init ops, if necessary */
	ret = sof_ops_init(sdev);
	if (ret < 0)
		return ret;

	/* check all mandatory ops */
	if (!sof_ops(sdev) || !sof_ops(sdev)->probe || !sof_ops(sdev)->run ||
	    !sof_ops(sdev)->block_read || !sof_ops(sdev)->block_write ||
Loading