Pierre-Louis Bossart | e149ca2 | 2020-05-01 09:58:50 -0500 | [diff] [blame] | 1 | /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 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 Girdwood | 8017b8f | 2019-04-12 11:05:17 -0500 | [diff] [blame] | 15 | #include <sound/soc.h> |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 16 | #include <sound/soc-acpi.h> |
| 17 | |
| 18 | struct snd_sof_dsp_ops; |
| 19 | |
| 20 | /* |
| 21 | * SOF Platform data. |
| 22 | */ |
| 23 | struct snd_sof_pdata { |
| 24 | const struct firmware *fw; |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 25 | const char *name; |
| 26 | const char *platform; |
| 27 | |
| 28 | struct device *dev; |
| 29 | |
Karol Trzcinski | 92be17a | 2020-04-15 15:27:55 -0500 | [diff] [blame] | 30 | /* indicate how many first bytes shouldn't be loaded into DSP memory. */ |
| 31 | size_t fw_offset; |
| 32 | |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 33 | /* |
| 34 | * notification callback used if the hardware initialization |
| 35 | * can take time or is handled in a workqueue. This callback |
| 36 | * can be used by the caller to e.g. enable runtime_pm |
| 37 | * or limit functionality until all low-level inits are |
| 38 | * complete. |
| 39 | */ |
| 40 | void (*sof_probe_complete)(struct device *dev); |
| 41 | |
| 42 | /* descriptor */ |
| 43 | const struct sof_dev_desc *desc; |
| 44 | |
| 45 | /* firmware and topology filenames */ |
| 46 | const char *fw_filename_prefix; |
| 47 | const char *fw_filename; |
| 48 | const char *tplg_filename_prefix; |
| 49 | const char *tplg_filename; |
| 50 | |
| 51 | /* machine */ |
| 52 | struct platform_device *pdev_mach; |
| 53 | const struct snd_soc_acpi_mach *machine; |
| 54 | |
| 55 | void *hw_pdata; |
| 56 | }; |
| 57 | |
| 58 | /* |
| 59 | * Descriptor used for setting up SOF platform data. This is used when |
| 60 | * ACPI/PCI data is missing or mapped differently. |
| 61 | */ |
| 62 | struct sof_dev_desc { |
| 63 | /* list of machines using this configuration */ |
| 64 | struct snd_soc_acpi_mach *machines; |
| 65 | |
Pierre-Louis Bossart | 1466327 | 2019-09-16 16:42:41 -0500 | [diff] [blame] | 66 | /* alternate list of machines using this configuration */ |
| 67 | struct snd_soc_acpi_mach *alt_machines; |
| 68 | |
Daniel Baluta | 43437d0 | 2020-09-21 13:50:38 +0300 | [diff] [blame] | 69 | bool use_acpi_target_states; |
| 70 | |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 71 | /* Platform resource indexes in BAR / ACPI resources. */ |
| 72 | /* Must set to -1 if not used - add new items to end */ |
| 73 | int resindex_lpe_base; |
| 74 | int resindex_pcicfg_base; |
| 75 | int resindex_imr_base; |
| 76 | int irqindex_host_ipc; |
| 77 | int resindex_dma_base; |
| 78 | |
| 79 | /* DMA only valid when resindex_dma_base != -1*/ |
| 80 | int dma_engine; |
| 81 | int dma_size; |
| 82 | |
| 83 | /* IPC timeouts in ms */ |
| 84 | int ipc_timeout; |
| 85 | int boot_timeout; |
| 86 | |
| 87 | /* chip information for dsp */ |
| 88 | const void *chip_info; |
| 89 | |
| 90 | /* defaults for no codec mode */ |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 91 | const char *nocodec_tplg_filename; |
| 92 | |
| 93 | /* defaults paths for firmware and topology files */ |
| 94 | const char *default_fw_path; |
| 95 | const char *default_tplg_path; |
| 96 | |
Ranjani Sridharan | 03eec9b | 2019-12-04 15:15:50 -0600 | [diff] [blame] | 97 | /* default firmware name */ |
| 98 | const char *default_fw_filename; |
| 99 | |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 100 | const struct snd_sof_dsp_ops *ops; |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 101 | }; |
| 102 | |
Liam Girdwood | 8017b8f | 2019-04-12 11:05:17 -0500 | [diff] [blame] | 103 | int sof_nocodec_setup(struct device *dev, |
Liam Girdwood | 8017b8f | 2019-04-12 11:05:17 -0500 | [diff] [blame] | 104 | const struct snd_sof_dsp_ops *ops); |
Liam Girdwood | c16211d | 2019-04-12 11:05:06 -0500 | [diff] [blame] | 105 | #endif |