blob: a0cbca02123074fdf95b366a2f526915d133f8ff [file] [log] [blame]
Liam Girdwoodc16211d2019-04-12 11:05:06 -05001/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
2/*
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
5 *
6 * Copyright(c) 2018 Intel Corporation. All rights reserved.
7 *
8 * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
9 */
10
11#ifndef __INCLUDE_SOUND_SOF_H
12#define __INCLUDE_SOUND_SOF_H
13
14#include <linux/pci.h>
Liam Girdwood8017b8f2019-04-12 11:05:17 -050015#include <sound/soc.h>
Liam Girdwoodc16211d2019-04-12 11:05:06 -050016#include <sound/soc-acpi.h>
17
18struct snd_sof_dsp_ops;
19
20/*
21 * SOF Platform data.
22 */
23struct snd_sof_pdata {
24 const struct firmware *fw;
Liam Girdwoodc16211d2019-04-12 11:05:06 -050025 const char *name;
26 const char *platform;
27
28 struct device *dev;
29
30 /*
31 * notification callback used if the hardware initialization
32 * can take time or is handled in a workqueue. This callback
33 * can be used by the caller to e.g. enable runtime_pm
34 * or limit functionality until all low-level inits are
35 * complete.
36 */
37 void (*sof_probe_complete)(struct device *dev);
38
39 /* descriptor */
40 const struct sof_dev_desc *desc;
41
42 /* firmware and topology filenames */
43 const char *fw_filename_prefix;
44 const char *fw_filename;
45 const char *tplg_filename_prefix;
46 const char *tplg_filename;
47
48 /* machine */
49 struct platform_device *pdev_mach;
50 const struct snd_soc_acpi_mach *machine;
51
52 void *hw_pdata;
53};
54
55/*
56 * Descriptor used for setting up SOF platform data. This is used when
57 * ACPI/PCI data is missing or mapped differently.
58 */
59struct sof_dev_desc {
60 /* list of machines using this configuration */
61 struct snd_soc_acpi_mach *machines;
62
Pierre-Louis Bossart14663272019-09-16 16:42:41 -050063 /* alternate list of machines using this configuration */
64 struct snd_soc_acpi_mach *alt_machines;
65
Liam Girdwoodc16211d2019-04-12 11:05:06 -050066 /* Platform resource indexes in BAR / ACPI resources. */
67 /* Must set to -1 if not used - add new items to end */
68 int resindex_lpe_base;
69 int resindex_pcicfg_base;
70 int resindex_imr_base;
71 int irqindex_host_ipc;
72 int resindex_dma_base;
73
74 /* DMA only valid when resindex_dma_base != -1*/
75 int dma_engine;
76 int dma_size;
77
78 /* IPC timeouts in ms */
79 int ipc_timeout;
80 int boot_timeout;
81
82 /* chip information for dsp */
83 const void *chip_info;
84
85 /* defaults for no codec mode */
Liam Girdwoodc16211d2019-04-12 11:05:06 -050086 const char *nocodec_tplg_filename;
87
88 /* defaults paths for firmware and topology files */
89 const char *default_fw_path;
90 const char *default_tplg_path;
91
Ranjani Sridharan03eec9b2019-12-04 15:15:50 -060092 /* default firmware name */
93 const char *default_fw_filename;
94
Liam Girdwoodc16211d2019-04-12 11:05:06 -050095 const struct snd_sof_dsp_ops *ops;
Liam Girdwoodc16211d2019-04-12 11:05:06 -050096};
97
Liam Girdwood8017b8f2019-04-12 11:05:17 -050098int sof_nocodec_setup(struct device *dev,
Liam Girdwood8017b8f2019-04-12 11:05:17 -050099 const struct snd_sof_dsp_ops *ops);
Liam Girdwoodc16211d2019-04-12 11:05:06 -0500100#endif