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

ASoC: SOF: couple of cleanups

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

Guennadi spotted inconsistencies with our 'const' handling, Ajit Kumar
flagged a missing check for a null pointer and we missed the
definition of debug zones.
parents f7c7ecab 60ded273
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ enum sof_ipc_dbg_mem_zone {
	SOF_IPC_MEM_ZONE_SYS_RUNTIME	= 1,	/**< System-runtime zone */
	SOF_IPC_MEM_ZONE_RUNTIME	= 2,	/**< Runtime zone */
	SOF_IPC_MEM_ZONE_BUFFER		= 3,	/**< Buffer zone */
	SOF_IPC_MEM_ZONE_RUNTIME_SHARED	= 4,	/**< System runtime zone */
	SOF_IPC_MEM_ZONE_SYS_SHARED	= 5,	/**< System shared zone */
};

/** ABI3.18 */
+4 −3
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ static struct snd_soc_dai_driver renoir_sof_dai[] = {
	},
};

static void amd_sof_machine_select(struct snd_sof_dev *sdev)
static struct snd_soc_acpi_mach *amd_sof_machine_select(struct snd_sof_dev *sdev)
{
	struct snd_sof_pdata *sof_pdata = sdev->pdata;
	const struct sof_dev_desc *desc = sof_pdata->desc;
@@ -113,12 +113,13 @@ static void amd_sof_machine_select(struct snd_sof_dev *sdev)
	mach = snd_soc_acpi_find_machine(desc->machines);
	if (!mach) {
		dev_warn(sdev->dev, "No matching ASoC machine driver found\n");
		return;
		return NULL;
	}

	sof_pdata->tplg_filename = mach->sof_tplg_filename;
	sof_pdata->fw_filename = mach->fw_filename;
	sof_pdata->machine = mach;

	return mach;
}

/* AMD Renoir DSP ops */
+7 −6
Original line number Diff line number Diff line
@@ -293,7 +293,7 @@ static const char *fixup_tplg_name(struct snd_sof_dev *sdev,
	return tplg_filename;
}

void atom_machine_select(struct snd_sof_dev *sdev)
struct snd_soc_acpi_mach *atom_machine_select(struct snd_sof_dev *sdev)
{
	struct snd_sof_pdata *sof_pdata = sdev->pdata;
	const struct sof_dev_desc *desc = sof_pdata->desc;
@@ -304,7 +304,7 @@ void atom_machine_select(struct snd_sof_dev *sdev)
	mach = snd_soc_acpi_find_machine(desc->machines);
	if (!mach) {
		dev_warn(sdev->dev, "warning: No matching ASoC machine driver found\n");
		return;
		return NULL;
	}

	pdev = to_platform_device(sdev->dev);
@@ -322,12 +322,13 @@ void atom_machine_select(struct snd_sof_dev *sdev)
	if (!tplg_filename) {
		dev_dbg(sdev->dev,
			"error: no topology filename\n");
		return;
		return NULL;
	}

	sof_pdata->tplg_filename = tplg_filename;
	mach->mach_params.acpi_ipc_irq_index = desc->irqindex_host_ipc;
	sof_pdata->machine = mach;

	return mach;
}
EXPORT_SYMBOL_NS(atom_machine_select, SND_SOC_SOF_INTEL_ATOM_HIFI_EP);

@@ -402,14 +403,14 @@ struct snd_soc_dai_driver atom_dai[] = {
};
EXPORT_SYMBOL_NS(atom_dai, SND_SOC_SOF_INTEL_ATOM_HIFI_EP);

void atom_set_mach_params(const struct snd_soc_acpi_mach *mach,
void atom_set_mach_params(struct snd_soc_acpi_mach *mach,
			  struct snd_sof_dev *sdev)
{
	struct snd_sof_pdata *pdata = sdev->pdata;
	const struct sof_dev_desc *desc = pdata->desc;
	struct snd_soc_acpi_mach_params *mach_params;

	mach_params = (struct snd_soc_acpi_mach_params *)&mach->mach_params;
	mach_params = &mach->mach_params;
	mach_params->platform = dev_name(sdev->dev);
	mach_params->num_dai_drivers = desc->ops->num_drv;
	mach_params->dai_drivers = desc->ops->drv;
+2 −2
Original line number Diff line number Diff line
@@ -65,8 +65,8 @@ int atom_run(struct snd_sof_dev *sdev);
int atom_reset(struct snd_sof_dev *sdev);
void atom_dump(struct snd_sof_dev *sdev, u32 flags);

void atom_machine_select(struct snd_sof_dev *sdev);
void atom_set_mach_params(const struct snd_soc_acpi_mach *mach,
struct snd_soc_acpi_mach *atom_machine_select(struct snd_sof_dev *sdev);
void atom_set_mach_params(struct snd_soc_acpi_mach *mach,
			  struct snd_sof_dev *sdev);

extern struct snd_soc_dai_driver atom_dai[];
+6 −5
Original line number Diff line number Diff line
@@ -509,7 +509,7 @@ static int bdw_probe(struct snd_sof_dev *sdev)
	return ret;
}

static void bdw_machine_select(struct snd_sof_dev *sdev)
static struct snd_soc_acpi_mach *bdw_machine_select(struct snd_sof_dev *sdev)
{
	struct snd_sof_pdata *sof_pdata = sdev->pdata;
	const struct sof_dev_desc *desc = sof_pdata->desc;
@@ -518,22 +518,23 @@ static void bdw_machine_select(struct snd_sof_dev *sdev)
	mach = snd_soc_acpi_find_machine(desc->machines);
	if (!mach) {
		dev_warn(sdev->dev, "warning: No matching ASoC machine driver found\n");
		return;
		return NULL;
	}

	sof_pdata->tplg_filename = mach->sof_tplg_filename;
	mach->mach_params.acpi_ipc_irq_index = desc->irqindex_host_ipc;
	sof_pdata->machine = mach;

	return mach;
}

static void bdw_set_mach_params(const struct snd_soc_acpi_mach *mach,
static void bdw_set_mach_params(struct snd_soc_acpi_mach *mach,
				struct snd_sof_dev *sdev)
{
	struct snd_sof_pdata *pdata = sdev->pdata;
	const struct sof_dev_desc *desc = pdata->desc;
	struct snd_soc_acpi_mach_params *mach_params;

	mach_params = (struct snd_soc_acpi_mach_params *)&mach->mach_params;
	mach_params = &mach->mach_params;
	mach_params->platform = dev_name(sdev->dev);
	mach_params->num_dai_drivers = desc->ops->num_drv;
	mach_params->dai_drivers = desc->ops->drv;
Loading