ASoC: Intel: Skylake: Add helper routines to handle module params
[deliverable/linux.git] / sound / soc / intel / skylake / skl-topology.h
index 76053a8de41cf255bfe77d24673c320cf5d2fd0a..5ba985b362276da382bd9e23a5aa3df556480fb7 100644 (file)
@@ -36,6 +36,9 @@
 /* Maximum number of coefficients up down mixer module */
 #define UP_DOWN_MIXER_MAX_COEFF                6
 
+#define MODULE_MAX_IN_PINS     8
+#define MODULE_MAX_OUT_PINS    8
+
 enum skl_channel_index {
        SKL_CHANNEL_LEFT = 0,
        SKL_CHANNEL_RIGHT = 1,
@@ -55,12 +58,6 @@ enum skl_bitdepth {
        SKL_DEPTH_INVALID
 };
 
-enum skl_interleaving {
-       /* [s1_ch1...s1_chN,...,sM_ch1...sM_chN] */
-       SKL_INTERLEAVING_PER_CHANNEL = 0,
-       /* [s1_ch1...sM_ch1,...,s1_chN...sM_chN] */
-       SKL_INTERLEAVING_PER_SAMPLE = 1,
-};
 
 enum skl_s_freq {
        SKL_FS_8000 = 8000,
@@ -178,18 +175,29 @@ struct skl_module_fmt {
        u32 bit_depth;
        u32 valid_bit_depth;
        u32 ch_cfg;
+       u32 interleaving_style;
+       u32 sample_type;
+       u32 ch_map;
 };
 
+struct skl_module_cfg;
+
 struct skl_module_inst_id {
        u32 module_id;
        u32 instance_id;
 };
 
+enum skl_module_pin_state {
+       SKL_PIN_UNBIND = 0,
+       SKL_PIN_BIND_DONE = 1,
+};
+
 struct skl_module_pin {
        struct skl_module_inst_id id;
-       u8 pin_index;
        bool is_dynamic;
        bool in_use;
+       enum skl_module_pin_state pin_state;
+       struct skl_module_cfg *tgt_mcfg;
 };
 
 struct skl_specific_cfg {
@@ -238,9 +246,13 @@ enum skl_module_state {
 };
 
 struct skl_module_cfg {
+       char guid[SKL_UUID_STR_SZ];
        struct skl_module_inst_id id;
-       struct skl_module_fmt in_fmt;
-       struct skl_module_fmt out_fmt;
+       u8 domain;
+       bool homogenous_inputs;
+       bool homogenous_outputs;
+       struct skl_module_fmt in_fmt[MODULE_MAX_IN_PINS];
+       struct skl_module_fmt out_fmt[MODULE_MAX_OUT_PINS];
        u8 max_in_queue;
        u8 max_out_queue;
        u8 in_queue_mask;
@@ -272,11 +284,6 @@ struct skl_pipeline {
        struct list_head node;
 };
 
-struct skl_dapm_path_list {
-       struct snd_soc_dapm_path *dapm_path;
-       struct list_head node;
-};
-
 static inline struct skl *get_skl_ctx(struct device *dev)
 {
        struct hdac_ext_bus *ebus = dev_get_drvdata(dev);
@@ -305,8 +312,7 @@ int skl_delete_pipe(struct skl_sst *ctx, struct skl_pipe *pipe);
 
 int skl_stop_pipe(struct skl_sst *ctx, struct skl_pipe *pipe);
 
-int skl_init_module(struct skl_sst *ctx, struct skl_module_cfg *module_config,
-       char *param);
+int skl_init_module(struct skl_sst *ctx, struct skl_module_cfg *module_config);
 
 int skl_bind_modules(struct skl_sst *ctx, struct skl_module_cfg
        *src_module, struct skl_module_cfg *dst_module);
@@ -314,5 +320,8 @@ int skl_bind_modules(struct skl_sst *ctx, struct skl_module_cfg
 int skl_unbind_modules(struct skl_sst *ctx, struct skl_module_cfg
        *src_module, struct skl_module_cfg *dst_module);
 
+int skl_set_module_params(struct skl_sst *ctx, u32 *params, int size,
+                       u32 param_id, struct skl_module_cfg *mcfg);
+
 enum skl_bitdepth skl_get_bit_depth(int params);
 #endif
This page took 0.024472 seconds and 5 git commands to generate.