0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef __INCLUDE_SOUND_SOF_H
0012 #define __INCLUDE_SOUND_SOF_H
0013
0014 #include <linux/pci.h>
0015 #include <sound/soc.h>
0016 #include <sound/soc-acpi.h>
0017
0018 struct snd_sof_dsp_ops;
0019 struct snd_sof_dev;
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 enum sof_fw_state {
0033 SOF_FW_BOOT_NOT_STARTED = 0,
0034 SOF_FW_BOOT_PREPARE,
0035 SOF_FW_BOOT_IN_PROGRESS,
0036 SOF_FW_BOOT_FAILED,
0037 SOF_FW_BOOT_READY_FAILED,
0038 SOF_FW_BOOT_READY_OK,
0039 SOF_FW_BOOT_COMPLETE,
0040 SOF_FW_CRASHED,
0041 };
0042
0043
0044 enum sof_dsp_power_states {
0045 SOF_DSP_PM_D0,
0046 SOF_DSP_PM_D1,
0047 SOF_DSP_PM_D2,
0048 SOF_DSP_PM_D3,
0049 };
0050
0051
0052 enum sof_ipc_type {
0053 SOF_IPC,
0054 SOF_INTEL_IPC4,
0055 SOF_IPC_TYPE_COUNT
0056 };
0057
0058
0059
0060
0061 struct snd_sof_pdata {
0062 const struct firmware *fw;
0063 const char *name;
0064 const char *platform;
0065
0066 struct device *dev;
0067
0068
0069 size_t fw_offset;
0070
0071
0072
0073
0074
0075
0076
0077
0078 void (*sof_probe_complete)(struct device *dev);
0079
0080
0081 const struct sof_dev_desc *desc;
0082
0083
0084 const char *fw_filename_prefix;
0085 const char *fw_filename;
0086 const char *tplg_filename_prefix;
0087 const char *tplg_filename;
0088
0089
0090 struct platform_device *pdev_mach;
0091 const struct snd_soc_acpi_mach *machine;
0092
0093 void *hw_pdata;
0094
0095 enum sof_ipc_type ipc_type;
0096 };
0097
0098
0099
0100
0101
0102 struct sof_dev_desc {
0103
0104 struct snd_soc_acpi_mach *machines;
0105
0106
0107 struct snd_soc_acpi_mach *alt_machines;
0108
0109 bool use_acpi_target_states;
0110
0111
0112
0113 int resindex_lpe_base;
0114 int resindex_pcicfg_base;
0115 int resindex_imr_base;
0116 int irqindex_host_ipc;
0117
0118
0119 int ipc_timeout;
0120 int boot_timeout;
0121
0122
0123 const void *chip_info;
0124
0125
0126 const char *nocodec_tplg_filename;
0127
0128
0129 unsigned int ipc_supported_mask;
0130 enum sof_ipc_type ipc_default;
0131
0132
0133 const char *default_fw_path[SOF_IPC_TYPE_COUNT];
0134 const char *default_tplg_path[SOF_IPC_TYPE_COUNT];
0135
0136
0137 const char *default_fw_filename[SOF_IPC_TYPE_COUNT];
0138
0139 struct snd_sof_dsp_ops *ops;
0140 int (*ops_init)(struct snd_sof_dev *sdev);
0141 void (*ops_free)(struct snd_sof_dev *sdev);
0142 };
0143
0144 int sof_dai_get_mclk(struct snd_soc_pcm_runtime *rtd);
0145 int sof_dai_get_bclk(struct snd_soc_pcm_runtime *rtd);
0146
0147 #endif