#include <linux/slab.h>
#include <linux/types.h>
#include <linux/firmware.h>
#include <linux/uuid.h>
#include <sound/intel-nhlt.h>
#include <sound/soc.h>
#include <sound/soc-acpi.h>
#include <sound/soc-topology.h>
#include <uapi/sound/snd_sst_tokens.h>
#include <uapi/sound/skl-tplg-interface.h>
#include "skl-sst-dsp.h"
#include "skl-sst-ipc.h"
#include "skl-topology.h"
#include "skl.h"
#include "../common/sst-dsp.h"
#include "../common/sst-dsp-priv.h"
#define SKL_CH_FIXUP_MASK …
#define SKL_RATE_FIXUP_MASK …
#define SKL_FMT_FIXUP_MASK …
#define SKL_IN_DIR_BIT_MASK …
#define SKL_PIN_COUNT_MASK …
static const int mic_mono_list[] = …;
static const int mic_stereo_list[][SKL_CH_STEREO] = …;
static const int mic_trio_list[][SKL_CH_TRIO] = …;
static const int mic_quatro_list[][SKL_CH_QUATRO] = …;
#define CHECK_HW_PARAMS(ch, freq, bps, prm_ch, prm_freq, prm_bps) …
void skl_tplg_d0i3_get(struct skl_dev *skl, enum d0i3_capability caps)
{ … }
void skl_tplg_d0i3_put(struct skl_dev *skl, enum d0i3_capability caps)
{ … }
static int is_skl_dsp_widget_type(struct snd_soc_dapm_widget *w,
struct device *dev)
{ … }
static void skl_dump_mconfig(struct skl_dev *skl, struct skl_module_cfg *mcfg)
{ … }
static void skl_tplg_update_chmap(struct skl_module_fmt *fmt, int chs)
{ … }
static void skl_tplg_update_params(struct skl_module_fmt *fmt,
struct skl_pipe_params *params, int fixup)
{ … }
static void skl_tplg_update_params_fixup(struct skl_module_cfg *m_cfg,
struct skl_pipe_params *params, bool is_fe)
{ … }
static void skl_tplg_update_buffer_size(struct skl_dev *skl,
struct skl_module_cfg *mcfg)
{ … }
static u8 skl_tplg_be_dev_type(int dev_type)
{ … }
static int skl_tplg_update_be_blob(struct snd_soc_dapm_widget *w,
struct skl_dev *skl)
{ … }
static void skl_tplg_update_module_params(struct snd_soc_dapm_widget *w,
struct skl_dev *skl)
{ … }
static int skl_tplg_set_module_params(struct snd_soc_dapm_widget *w,
struct skl_dev *skl)
{ … }
static int skl_tplg_set_module_init_data(struct snd_soc_dapm_widget *w)
{ … }
static int skl_tplg_module_prepare(struct skl_dev *skl, struct skl_pipe *pipe,
struct snd_soc_dapm_widget *w, struct skl_module_cfg *mcfg)
{ … }
static int
skl_tplg_init_pipe_modules(struct skl_dev *skl, struct skl_pipe *pipe)
{ … }
static int skl_tplg_unload_pipe_modules(struct skl_dev *skl,
struct skl_pipe *pipe)
{ … }
static void skl_tplg_set_pipe_config_idx(struct skl_pipe *pipe, int idx)
{ … }
static int
skl_tplg_get_pipe_config(struct skl_dev *skl, struct skl_module_cfg *mconfig)
{ … }
static int skl_tplg_mixer_dapm_pre_pmu_event(struct snd_soc_dapm_widget *w,
struct skl_dev *skl)
{ … }
static int skl_fill_sink_instance_id(struct skl_dev *skl, u32 *params,
int size, struct skl_module_cfg *mcfg)
{ … }
static int skl_tplg_set_module_bind_params(struct snd_soc_dapm_widget *w,
struct skl_module_cfg *mcfg, struct skl_dev *skl)
{ … }
static int skl_get_module_id(struct skl_dev *skl, guid_t *uuid)
{ … }
static int skl_tplg_find_moduleid_from_uuid(struct skl_dev *skl,
const struct snd_kcontrol_new *k)
{ … }
void skl_tplg_add_moduleid_in_bind_params(struct skl_dev *skl,
struct snd_soc_dapm_widget *w)
{ … }
static int skl_tplg_module_add_deferred_bind(struct skl_dev *skl,
struct skl_module_cfg *src, struct skl_module_cfg *dst)
{ … }
static int skl_tplg_bind_sinks(struct snd_soc_dapm_widget *w,
struct skl_dev *skl,
struct snd_soc_dapm_widget *src_w,
struct skl_module_cfg *src_mconfig)
{ … }
static int skl_tplg_pga_dapm_pre_pmu_event(struct snd_soc_dapm_widget *w,
struct skl_dev *skl)
{ … }
static struct snd_soc_dapm_widget *skl_get_src_dsp_widget(
struct snd_soc_dapm_widget *w, struct skl_dev *skl)
{ … }
static int skl_tplg_mixer_dapm_post_pmu_event(struct snd_soc_dapm_widget *w,
struct skl_dev *skl)
{ … }
static int skl_tplg_mixer_dapm_pre_pmd_event(struct snd_soc_dapm_widget *w,
struct skl_dev *skl)
{ … }
static int skl_tplg_mixer_dapm_post_pmd_event(struct snd_soc_dapm_widget *w,
struct skl_dev *skl)
{ … }
static int skl_tplg_pga_dapm_post_pmd_event(struct snd_soc_dapm_widget *w,
struct skl_dev *skl)
{ … }
static int skl_tplg_mixer_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *k, int event)
{ … }
static int skl_tplg_pga_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *k, int event)
{ … }
static int skl_tplg_multi_config_set_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol,
bool is_set)
{ … }
static int skl_tplg_multi_config_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int skl_tplg_multi_config_set(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int skl_tplg_multi_config_get_dmic(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int skl_tplg_multi_config_set_dmic(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int skl_tplg_tlv_control_get(struct snd_kcontrol *kcontrol,
unsigned int __user *data, unsigned int size)
{ … }
#define SKL_PARAM_VENDOR_ID …
static int skl_tplg_tlv_control_set(struct snd_kcontrol *kcontrol,
const unsigned int __user *data, unsigned int size)
{ … }
static int skl_tplg_mic_control_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int skl_fill_mic_sel_params(struct skl_module_cfg *mconfig,
struct skl_mic_sel_config *mic_cfg, struct device *dev)
{ … }
static int skl_tplg_mic_control_set(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static void skl_tplg_fill_dma_id(struct skl_module_cfg *mcfg,
struct skl_pipe_params *params)
{ … }
int skl_tplg_update_pipe_params(struct device *dev,
struct skl_module_cfg *mconfig,
struct skl_pipe_params *params)
{ … }
struct skl_module_cfg *
skl_tplg_fe_get_cpr_module(struct snd_soc_dai *dai, int stream)
{ … }
static struct skl_module_cfg *skl_get_mconfig_pb_cpr(
struct snd_soc_dai *dai, struct snd_soc_dapm_widget *w)
{ … }
static struct skl_module_cfg *skl_get_mconfig_cap_cpr(
struct snd_soc_dai *dai, struct snd_soc_dapm_widget *w)
{ … }
struct skl_module_cfg *
skl_tplg_be_get_cpr_module(struct snd_soc_dai *dai, int stream)
{ … }
static u8 skl_tplg_be_link_type(int dev_type)
{ … }
static int skl_tplg_be_fill_pipe_params(struct snd_soc_dai *dai,
struct skl_module_cfg *mconfig,
struct skl_pipe_params *params)
{ … }
static int skl_tplg_be_set_src_pipe_params(struct snd_soc_dai *dai,
struct snd_soc_dapm_widget *w,
struct skl_pipe_params *params)
{ … }
static int skl_tplg_be_set_sink_pipe_params(struct snd_soc_dai *dai,
struct snd_soc_dapm_widget *w, struct skl_pipe_params *params)
{ … }
int skl_tplg_be_update_params(struct snd_soc_dai *dai,
struct skl_pipe_params *params)
{ … }
static const struct snd_soc_tplg_widget_events skl_tplg_widget_ops[] = …;
static const struct snd_soc_tplg_bytes_ext_ops skl_tlv_ops[] = …;
static const struct snd_soc_tplg_kcontrol_ops skl_tplg_kcontrol_ops[] = …;
static int skl_tplg_fill_pipe_cfg(struct device *dev,
struct skl_pipe *pipe, u32 tkn,
u32 tkn_val, int conf_idx, int dir)
{ … }
static int skl_tplg_fill_pipe_tkn(struct device *dev,
struct skl_pipe *pipe, u32 tkn,
u32 tkn_val)
{ … }
static int skl_tplg_add_pipe(struct device *dev,
struct skl_module_cfg *mconfig, struct skl_dev *skl,
struct snd_soc_tplg_vendor_value_elem *tkn_elem)
{ … }
static int skl_tplg_get_uuid(struct device *dev, guid_t *guid,
struct snd_soc_tplg_vendor_uuid_elem *uuid_tkn)
{ … }
static int skl_tplg_fill_pin(struct device *dev,
struct snd_soc_tplg_vendor_value_elem *tkn_elem,
struct skl_module_pin *m_pin,
int pin_index)
{ … }
static int skl_tplg_fill_pins_info(struct device *dev,
struct skl_module_cfg *mconfig,
struct snd_soc_tplg_vendor_value_elem *tkn_elem,
int dir, int pin_count)
{ … }
static int skl_tplg_fill_fmt(struct device *dev,
struct skl_module_fmt *dst_fmt,
u32 tkn, u32 value)
{ … }
static int skl_tplg_widget_fill_fmt(struct device *dev,
struct skl_module_iface *fmt,
u32 tkn, u32 val, u32 dir, int fmt_idx)
{ … }
static void skl_tplg_fill_pin_dynamic_val(
struct skl_module_pin *mpin, u32 pin_count, u32 value)
{ … }
static int skl_tplg_manifest_pin_res_tkn(struct device *dev,
struct snd_soc_tplg_vendor_value_elem *tkn_elem,
struct skl_module_res *res, int pin_idx, int dir)
{ … }
static int skl_tplg_fill_res_tkn(struct device *dev,
struct snd_soc_tplg_vendor_value_elem *tkn_elem,
struct skl_module_res *res,
int pin_idx, int dir)
{ … }
static int skl_tplg_get_token(struct device *dev,
struct snd_soc_tplg_vendor_value_elem *tkn_elem,
struct skl_dev *skl, struct skl_module_cfg *mconfig)
{ … }
static int skl_tplg_get_tokens(struct device *dev,
char *pvt_data, struct skl_dev *skl,
struct skl_module_cfg *mconfig, int block_size)
{ … }
static int skl_tplg_get_desc_blocks(struct device *dev,
struct snd_soc_tplg_vendor_array *array)
{ … }
static int skl_tplg_get_caps_data(struct device *dev, char *data,
struct skl_module_cfg *mconfig)
{ … }
static int skl_tplg_get_pvt_data(struct snd_soc_tplg_dapm_widget *tplg_w,
struct skl_dev *skl, struct device *dev,
struct skl_module_cfg *mconfig)
{ … }
static void skl_clear_pin_config(struct snd_soc_component *component,
struct snd_soc_dapm_widget *w)
{ … }
void skl_cleanup_resources(struct skl_dev *skl)
{ … }
static int skl_tplg_widget_load(struct snd_soc_component *cmpnt, int index,
struct snd_soc_dapm_widget *w,
struct snd_soc_tplg_dapm_widget *tplg_w)
{ … }
static int skl_init_algo_data(struct device *dev, struct soc_bytes_ext *be,
struct snd_soc_tplg_bytes_control *bc)
{ … }
static int skl_init_enum_data(struct device *dev, struct soc_enum *se,
struct snd_soc_tplg_enum_control *ec)
{ … }
static int skl_tplg_control_load(struct snd_soc_component *cmpnt,
int index,
struct snd_kcontrol_new *kctl,
struct snd_soc_tplg_ctl_hdr *hdr)
{ … }
static int skl_tplg_fill_str_mfest_tkn(struct device *dev,
struct snd_soc_tplg_vendor_string_elem *str_elem,
struct skl_dev *skl)
{ … }
static int skl_tplg_get_str_tkn(struct device *dev,
struct snd_soc_tplg_vendor_array *array,
struct skl_dev *skl)
{ … }
static int skl_tplg_manifest_fill_fmt(struct device *dev,
struct skl_module_iface *fmt,
struct snd_soc_tplg_vendor_value_elem *tkn_elem,
u32 dir, int fmt_idx)
{ … }
static int skl_tplg_fill_mod_info(struct device *dev,
struct snd_soc_tplg_vendor_value_elem *tkn_elem,
struct skl_module *mod)
{ … }
static int skl_tplg_get_int_tkn(struct device *dev,
struct snd_soc_tplg_vendor_value_elem *tkn_elem,
struct skl_dev *skl)
{ … }
static int skl_tplg_get_manifest_tkn(struct device *dev,
char *pvt_data, struct skl_dev *skl,
int block_size)
{ … }
static int skl_tplg_get_manifest_data(struct snd_soc_tplg_manifest *manifest,
struct device *dev, struct skl_dev *skl)
{ … }
static int skl_manifest_load(struct snd_soc_component *cmpnt, int index,
struct snd_soc_tplg_manifest *manifest)
{ … }
static int skl_tplg_complete(struct snd_soc_component *component)
{ … }
static const struct snd_soc_tplg_ops skl_tplg_ops = …;
static int skl_tplg_create_pipe_widget_list(struct snd_soc_component *component)
{ … }
static void skl_tplg_set_pipe_type(struct skl_dev *skl, struct skl_pipe *pipe)
{ … }
int skl_tplg_init(struct snd_soc_component *component, struct hdac_bus *bus)
{ … }
void skl_tplg_exit(struct snd_soc_component *component, struct hdac_bus *bus)
{ … }