]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - sound/soc/intel/skylake/skl-sst-dsp.h
ASoC: Intel: Skylake: Commonize library load
[linux.git] / sound / soc / intel / skylake / skl-sst-dsp.h
index 849410d0823e96ec4cd658263cb0aaeb254a5397..6d9aed23d5cd5f858dbe5a8369c5374638938969 100644 (file)
 #define __SKL_SST_DSP_H__
 
 #include <linux/interrupt.h>
+#include <linux/uuid.h>
+#include <linux/firmware.h>
 #include <sound/memalloc.h>
 #include "skl-sst-cldma.h"
-#include "skl-topology.h"
 
 struct sst_dsp;
 struct skl_sst;
 struct sst_dsp_device;
+struct skl_lib_info;
 
 /* Intel HD Audio General DSP Registers */
 #define SKL_ADSP_GEN_BASE              0x0
@@ -144,7 +146,7 @@ struct skl_dsp_fw_ops {
        int (*load_fw)(struct sst_dsp  *ctx);
        /* FW module parser/loader */
        int (*load_library)(struct sst_dsp *ctx,
-               struct skl_lib_info *linfo, int count);
+               struct skl_lib_info *linfo, int lib_count);
        int (*parse_fw)(struct sst_dsp *ctx);
        int (*set_state_D0)(struct sst_dsp *ctx, unsigned int core_id);
        int (*set_state_D3)(struct sst_dsp *ctx, unsigned int core_id);
@@ -172,6 +174,19 @@ struct skl_dsp_loader_ops {
                                 int stream_tag);
 };
 
+#define MAX_INSTANCE_BUFF 2
+
+struct uuid_module {
+       uuid_le uuid;
+       int id;
+       int is_loadable;
+       int max_instance;
+       u64 pvt_id[MAX_INSTANCE_BUFF];
+       int *instance_id;
+
+       struct list_head list;
+};
+
 struct skl_load_module_info {
        u16 mod_id;
        const struct firmware *fw;
@@ -186,6 +201,7 @@ struct skl_module_table {
 void skl_cldma_process_intr(struct sst_dsp *ctx);
 void skl_cldma_int_disable(struct sst_dsp *ctx);
 int skl_cldma_prepare(struct sst_dsp *ctx);
+int skl_cldma_wait_interruptible(struct sst_dsp *ctx);
 
 void skl_dsp_set_state_locked(struct sst_dsp *ctx, int state);
 struct sst_dsp *skl_dsp_ctx_init(struct device *dev,
@@ -222,17 +238,22 @@ int bxt_sst_init_fw(struct device *dev, struct skl_sst *ctx);
 void skl_sst_dsp_cleanup(struct device *dev, struct skl_sst *ctx);
 void bxt_sst_dsp_cleanup(struct device *dev, struct skl_sst *ctx);
 
-int snd_skl_get_module_info(struct skl_sst *ctx,
-                               struct skl_module_cfg *mconfig);
 int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw,
                                unsigned int offset, int index);
-int skl_get_pvt_id(struct skl_sst *ctx,
-                               struct skl_module_cfg *mconfig);
-int skl_put_pvt_id(struct skl_sst *ctx,
-                               struct skl_module_cfg *mconfig);
+int skl_get_pvt_id(struct skl_sst *ctx, uuid_le *uuid_mod, int instance_id);
+int skl_put_pvt_id(struct skl_sst *ctx, uuid_le *uuid_mod, int *pvt_id);
 int skl_get_pvt_instance_id_map(struct skl_sst *ctx,
                                int module_id, int instance_id);
 void skl_freeup_uuid_list(struct skl_sst *ctx);
 
 int skl_dsp_strip_extended_manifest(struct firmware *fw);
+void skl_dsp_enable_notification(struct skl_sst *ctx, bool enable);
+int skl_sst_ctx_init(struct device *dev, int irq, const char *fw_name,
+               struct skl_dsp_loader_ops dsp_ops, struct skl_sst **dsp,
+               struct sst_dsp_device *skl_dev);
+int skl_prepare_lib_load(struct skl_sst *skl, struct skl_lib_info *linfo,
+                       struct firmware *stripped_fw,
+                       unsigned int hdr_offset, int index);
+void skl_release_library(struct skl_lib_info *linfo, int lib_count);
+
 #endif /*__SKL_SST_DSP_H__*/