summaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorLiam Girdwood <liam.r.girdwood@linux.intel.com>2019-04-12 11:05:06 -0500
committerMark Brown <broonie@kernel.org>2019-04-28 02:47:19 +0900
commitc16211d6226dbde8819b84da07508083a1138a06 (patch)
tree65c0c59357453bbe8797e8a850d7f822429d74dd /include/sound
parent8f8a54884dfd3d756693b7f174a06397bf19d8a5 (diff)
downloadlinux-c16211d6226dbde8819b84da07508083a1138a06.tar.bz2
ASoC: SOF: Add Sound Open Firmware driver core
The Sound Open Firmware driver core is a generic architecture independent layer that allows SOF to be used on many different architectures and platforms. It abstracts DSP operations and IO methods so that the target DSP can be an internal memory mapped or external SPI or I2C based device. This abstraction also allows SOF to be run on many different VMs on the same physical HW. SOF also requires some data in ASoC PCM runtime data for looking up SOF data during ASoC PCM operations. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/sof.h94
1 files changed, 94 insertions, 0 deletions
diff --git a/include/sound/sof.h b/include/sound/sof.h
new file mode 100644
index 000000000000..54f65ec33a6c
--- /dev/null
+++ b/include/sound/sof.h
@@ -0,0 +1,94 @@
+/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
+/*
+ * This file is provided under a dual BSD/GPLv2 license. When using or
+ * redistributing this file, you may do so under either license.
+ *
+ * Copyright(c) 2018 Intel Corporation. All rights reserved.
+ *
+ * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
+ */
+
+#ifndef __INCLUDE_SOUND_SOF_H
+#define __INCLUDE_SOUND_SOF_H
+
+#include <linux/pci.h>
+#include <sound/soc-acpi.h>
+
+struct snd_sof_dsp_ops;
+
+/*
+ * SOF Platform data.
+ */
+struct snd_sof_pdata {
+ const struct firmware *fw;
+ const char *drv_name;
+ const char *name;
+ const char *platform;
+
+ struct device *dev;
+
+ /*
+ * notification callback used if the hardware initialization
+ * can take time or is handled in a workqueue. This callback
+ * can be used by the caller to e.g. enable runtime_pm
+ * or limit functionality until all low-level inits are
+ * complete.
+ */
+ void (*sof_probe_complete)(struct device *dev);
+
+ /* descriptor */
+ const struct sof_dev_desc *desc;
+
+ /* firmware and topology filenames */
+ const char *fw_filename_prefix;
+ const char *fw_filename;
+ const char *tplg_filename_prefix;
+ const char *tplg_filename;
+
+ /* machine */
+ struct platform_device *pdev_mach;
+ const struct snd_soc_acpi_mach *machine;
+
+ void *hw_pdata;
+};
+
+/*
+ * Descriptor used for setting up SOF platform data. This is used when
+ * ACPI/PCI data is missing or mapped differently.
+ */
+struct sof_dev_desc {
+ /* list of machines using this configuration */
+ struct snd_soc_acpi_mach *machines;
+
+ /* Platform resource indexes in BAR / ACPI resources. */
+ /* Must set to -1 if not used - add new items to end */
+ int resindex_lpe_base;
+ int resindex_pcicfg_base;
+ int resindex_imr_base;
+ int irqindex_host_ipc;
+ int resindex_dma_base;
+
+ /* DMA only valid when resindex_dma_base != -1*/
+ int dma_engine;
+ int dma_size;
+
+ /* IPC timeouts in ms */
+ int ipc_timeout;
+ int boot_timeout;
+
+ /* chip information for dsp */
+ const void *chip_info;
+
+ /* defaults for no codec mode */
+ const char *nocodec_fw_filename;
+ const char *nocodec_tplg_filename;
+
+ /* defaults paths for firmware and topology files */
+ const char *default_fw_path;
+ const char *default_tplg_path;
+
+ const struct snd_sof_dsp_ops *ops;
+ const struct sof_arch_ops *arch_ops;
+};
+
+#endif