#include <linux/slab.h>
#include <linux/pci.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <uapi/sound/skl-tplg-interface.h>
#include "skl-sst-dsp.h"
#include "cnl-sst-dsp.h"
#include "skl-sst-ipc.h"
#include "skl.h"
#include "../common/sst-dsp.h"
#include "../common/sst-dsp-priv.h"
#include "skl-topology.h"
static int skl_alloc_dma_buf(struct device *dev,
struct snd_dma_buffer *dmab, size_t size)
{ … }
static int skl_free_dma_buf(struct device *dev, struct snd_dma_buffer *dmab)
{ … }
#define SKL_ASTATE_PARAM_ID …
void skl_dsp_set_astate_cfg(struct skl_dev *skl, u32 cnt, void *data)
{ … }
static int skl_dsp_setup_spib(struct device *dev, unsigned int size,
int stream_tag, int enable)
{ … }
static int skl_dsp_prepare(struct device *dev, unsigned int format,
unsigned int size, struct snd_dma_buffer *dmab)
{ … }
static int skl_dsp_trigger(struct device *dev, bool start, int stream_tag)
{ … }
static int skl_dsp_cleanup(struct device *dev,
struct snd_dma_buffer *dmab, int stream_tag)
{ … }
static struct skl_dsp_loader_ops skl_get_loader_ops(void)
{
struct skl_dsp_loader_ops loader_ops;
memset(&loader_ops, 0, sizeof(struct skl_dsp_loader_ops));
loader_ops.alloc_dma_buf = skl_alloc_dma_buf;
loader_ops.free_dma_buf = skl_free_dma_buf;
return loader_ops;
};
static struct skl_dsp_loader_ops bxt_get_loader_ops(void)
{
struct skl_dsp_loader_ops loader_ops;
memset(&loader_ops, 0, sizeof(loader_ops));
loader_ops.alloc_dma_buf = skl_alloc_dma_buf;
loader_ops.free_dma_buf = skl_free_dma_buf;
loader_ops.prepare = skl_dsp_prepare;
loader_ops.trigger = skl_dsp_trigger;
loader_ops.cleanup = skl_dsp_cleanup;
return loader_ops;
};
static const struct skl_dsp_ops dsp_ops[] = …;
const struct skl_dsp_ops *skl_get_dsp_ops(int pci_id)
{ … }
int skl_init_dsp(struct skl_dev *skl)
{ … }
int skl_free_dsp(struct skl_dev *skl)
{ … }
int skl_suspend_late_dsp(struct skl_dev *skl)
{ … }
int skl_suspend_dsp(struct skl_dev *skl)
{ … }
int skl_resume_dsp(struct skl_dev *skl)
{ … }
enum skl_bitdepth skl_get_bit_depth(int params)
{ … }
static void skl_set_base_module_format(struct skl_dev *skl,
struct skl_module_cfg *mconfig,
struct skl_base_cfg *base_cfg)
{ … }
static void fill_pin_params(struct skl_audio_data_format *pin_fmt,
struct skl_module_fmt *format)
{ … }
static void skl_set_base_ext_module_format(struct skl_dev *skl,
struct skl_module_cfg *mconfig,
struct skl_base_cfg_ext *base_cfg_ext)
{ … }
static void skl_copy_copier_caps(struct skl_module_cfg *mconfig,
struct skl_cpr_cfg *cpr_mconfig)
{ … }
#define SKL_NON_GATEWAY_CPR_NODE_ID …
static u32 skl_get_node_id(struct skl_dev *skl,
struct skl_module_cfg *mconfig)
{ … }
static void skl_setup_cpr_gateway_cfg(struct skl_dev *skl,
struct skl_module_cfg *mconfig,
struct skl_cpr_cfg *cpr_mconfig)
{ … }
#define DMA_CONTROL_ID …
#define DMA_I2S_BLOB_SIZE …
int skl_dsp_set_dma_control(struct skl_dev *skl, u32 *caps,
u32 caps_size, u32 node_id)
{ … }
EXPORT_SYMBOL_GPL(…);
static void skl_setup_out_format(struct skl_dev *skl,
struct skl_module_cfg *mconfig,
struct skl_audio_data_format *out_fmt)
{ … }
static void skl_set_src_format(struct skl_dev *skl,
struct skl_module_cfg *mconfig,
struct skl_src_module_cfg *src_mconfig)
{ … }
static void skl_set_updown_mixer_format(struct skl_dev *skl,
struct skl_module_cfg *mconfig,
struct skl_up_down_mixer_cfg *mixer_mconfig)
{ … }
static void skl_set_copier_format(struct skl_dev *skl,
struct skl_module_cfg *mconfig,
struct skl_cpr_cfg *cpr_mconfig)
{ … }
static void skl_set_base_outfmt_format(struct skl_dev *skl,
struct skl_module_cfg *mconfig,
struct skl_base_outfmt_cfg *base_outfmt_mcfg)
{ … }
static u16 skl_get_module_param_size(struct skl_dev *skl,
struct skl_module_cfg *mconfig)
{ … }
static int skl_set_module_format(struct skl_dev *skl,
struct skl_module_cfg *module_config,
u16 *module_config_size,
void **param_data)
{ … }
static int skl_get_queue_index(struct skl_module_pin *mpin,
struct skl_module_inst_id id, int max)
{ … }
static int skl_alloc_queue(struct skl_module_pin *mpin,
struct skl_module_cfg *tgt_cfg, int max)
{ … }
static void skl_free_queue(struct skl_module_pin *mpin, int q_index)
{ … }
static void skl_clear_module_state(struct skl_module_pin *mpin, int max,
struct skl_module_cfg *mcfg)
{ … }
int skl_init_module(struct skl_dev *skl,
struct skl_module_cfg *mconfig)
{ … }
static void skl_dump_bind_info(struct skl_dev *skl, struct skl_module_cfg
*src_module, struct skl_module_cfg *dst_module)
{ … }
int skl_unbind_modules(struct skl_dev *skl,
struct skl_module_cfg *src_mcfg,
struct skl_module_cfg *dst_mcfg)
{ … }
#define CPR_SINK_FMT_PARAM_ID …
int skl_bind_modules(struct skl_dev *skl,
struct skl_module_cfg *src_mcfg,
struct skl_module_cfg *dst_mcfg)
{ … }
static int skl_set_pipe_state(struct skl_dev *skl, struct skl_pipe *pipe,
enum skl_ipc_pipeline_state state)
{ … }
int skl_create_pipeline(struct skl_dev *skl, struct skl_pipe *pipe)
{ … }
int skl_delete_pipe(struct skl_dev *skl, struct skl_pipe *pipe)
{ … }
int skl_run_pipe(struct skl_dev *skl, struct skl_pipe *pipe)
{ … }
int skl_stop_pipe(struct skl_dev *skl, struct skl_pipe *pipe)
{ … }
int skl_reset_pipe(struct skl_dev *skl, struct skl_pipe *pipe)
{ … }
int skl_set_module_params(struct skl_dev *skl, u32 *params, int size,
u32 param_id, struct skl_module_cfg *mcfg)
{ … }
int skl_get_module_params(struct skl_dev *skl, u32 *params, int size,
u32 param_id, struct skl_module_cfg *mcfg)
{ … }