#include <linux/firmware.h>
#include <linux/uuid.h>
#include <sound/soc.h>
#include <sound/soc-acpi.h>
#include <sound/soc-topology.h>
#include <uapi/sound/intel/avs/tokens.h>
#include "avs.h"
#include "control.h"
#include "topology.h"
#include "utils.h"
#define avs_tplg_vendor_array_at(array, offset) …
#define avs_tplg_vendor_array_next(array) …
static int
avs_tplg_vendor_array_lookup(struct snd_soc_tplg_vendor_array *tuples,
u32 block_size, u32 token, u32 *offset)
{ … }
static int
avs_tplg_vendor_array_lookup_next(struct snd_soc_tplg_vendor_array *tuples,
u32 block_size, u32 token, u32 *offset)
{ … }
static int
avs_tplg_vendor_entry_size(struct snd_soc_tplg_vendor_array *tuples,
u32 block_size, u32 entry_id_token, u32 *size)
{ … }
struct avs_tplg_token_parser { … };
static int
avs_parse_uuid_token(struct snd_soc_component *comp, void *elem, void *object, u32 offset)
{ … }
static int
avs_parse_bool_token(struct snd_soc_component *comp, void *elem, void *object, u32 offset)
{ … }
static int
avs_parse_byte_token(struct snd_soc_component *comp, void *elem, void *object, u32 offset)
{ … }
static int
avs_parse_short_token(struct snd_soc_component *comp, void *elem, void *object, u32 offset)
{ … }
static int
avs_parse_word_token(struct snd_soc_component *comp, void *elem, void *object, u32 offset)
{ … }
static int
avs_parse_string_token(struct snd_soc_component *comp, void *elem, void *object, u32 offset)
{ … }
static int avs_parse_uuid_tokens(struct snd_soc_component *comp, void *object,
const struct avs_tplg_token_parser *parsers, int count,
struct snd_soc_tplg_vendor_array *tuples)
{ … }
static int avs_parse_string_tokens(struct snd_soc_component *comp, void *object,
const struct avs_tplg_token_parser *parsers, int count,
struct snd_soc_tplg_vendor_array *tuples)
{ … }
static int avs_parse_word_tokens(struct snd_soc_component *comp, void *object,
const struct avs_tplg_token_parser *parsers, int count,
struct snd_soc_tplg_vendor_array *tuples)
{ … }
static int avs_parse_tokens(struct snd_soc_component *comp, void *object,
const struct avs_tplg_token_parser *parsers, size_t count,
struct snd_soc_tplg_vendor_array *tuples, int priv_size)
{ … }
#define AVS_DEFINE_PTR_PARSER(name, type, member) …
AVS_DEFINE_PTR_PARSER(audio_format, struct avs_audio_format, fmts);
AVS_DEFINE_PTR_PARSER(modcfg_base, struct avs_tplg_modcfg_base, modcfgs_base);
AVS_DEFINE_PTR_PARSER(modcfg_ext, struct avs_tplg_modcfg_ext, modcfgs_ext);
AVS_DEFINE_PTR_PARSER(pplcfg, struct avs_tplg_pplcfg, pplcfgs);
AVS_DEFINE_PTR_PARSER(binding, struct avs_tplg_binding, bindings);
static int
parse_audio_format_bitfield(struct snd_soc_component *comp, void *elem, void *object, u32 offset)
{ … }
static int avs_ssp_sprint(char *buf, size_t size, const char *fmt, int port, int tdm)
{ … }
static int parse_link_formatted_string(struct snd_soc_component *comp, void *elem,
void *object, u32 offset)
{ … }
static int
parse_dictionary_header(struct snd_soc_component *comp,
struct snd_soc_tplg_vendor_array *tuples,
void **dict, u32 *num_entries, size_t entry_size,
u32 num_entries_token)
{ … }
static int
parse_dictionary_entries(struct snd_soc_component *comp,
struct snd_soc_tplg_vendor_array *tuples, u32 block_size,
void *dict, u32 num_entries, size_t entry_size,
u32 entry_id_token,
const struct avs_tplg_token_parser *parsers, size_t num_parsers)
{ … }
static int parse_dictionary(struct snd_soc_component *comp,
struct snd_soc_tplg_vendor_array *tuples, u32 block_size,
void **dict, u32 *num_entries, size_t entry_size,
u32 num_entries_token, u32 entry_id_token,
const struct avs_tplg_token_parser *parsers, size_t num_parsers)
{ … }
static const struct avs_tplg_token_parser library_parsers[] = …;
static int avs_tplg_parse_libraries(struct snd_soc_component *comp,
struct snd_soc_tplg_vendor_array *tuples, u32 block_size)
{ … }
static const struct avs_tplg_token_parser audio_format_parsers[] = …;
static int avs_tplg_parse_audio_formats(struct snd_soc_component *comp,
struct snd_soc_tplg_vendor_array *tuples,
u32 block_size)
{ … }
static const struct avs_tplg_token_parser modcfg_base_parsers[] = …;
static int avs_tplg_parse_modcfgs_base(struct snd_soc_component *comp,
struct snd_soc_tplg_vendor_array *tuples,
u32 block_size)
{ … }
static const struct avs_tplg_token_parser modcfg_ext_parsers[] = …;
static const struct avs_tplg_token_parser pin_format_parsers[] = …;
static void
assign_copier_gtw_instance(struct snd_soc_component *comp, struct avs_tplg_modcfg_ext *cfg)
{ … }
static int avs_tplg_parse_modcfg_ext(struct snd_soc_component *comp,
struct avs_tplg_modcfg_ext *cfg,
struct snd_soc_tplg_vendor_array *tuples,
u32 block_size)
{ … }
static int avs_tplg_parse_modcfgs_ext(struct snd_soc_component *comp,
struct snd_soc_tplg_vendor_array *tuples,
u32 block_size)
{ … }
static const struct avs_tplg_token_parser pplcfg_parsers[] = …;
static int avs_tplg_parse_pplcfgs(struct snd_soc_component *comp,
struct snd_soc_tplg_vendor_array *tuples,
u32 block_size)
{ … }
static const struct avs_tplg_token_parser binding_parsers[] = …;
static int avs_tplg_parse_bindings(struct snd_soc_component *comp,
struct snd_soc_tplg_vendor_array *tuples,
u32 block_size)
{ … }
static const struct avs_tplg_token_parser module_parsers[] = …;
static const struct avs_tplg_token_parser init_config_parsers[] = …;
static struct avs_tplg_module *
avs_tplg_module_create(struct snd_soc_component *comp, struct avs_tplg_pipeline *owner,
struct snd_soc_tplg_vendor_array *tuples, u32 block_size)
{ … }
static const struct avs_tplg_token_parser pipeline_parsers[] = …;
static const struct avs_tplg_token_parser bindings_parsers[] = …;
static struct avs_tplg_pipeline *
avs_tplg_pipeline_create(struct snd_soc_component *comp, struct avs_tplg_path *owner,
struct snd_soc_tplg_vendor_array *tuples, u32 block_size)
{ … }
static const struct avs_tplg_token_parser path_parsers[] = …;
static struct avs_tplg_path *
avs_tplg_path_create(struct snd_soc_component *comp, struct avs_tplg_path_template *owner,
struct snd_soc_tplg_vendor_array *tuples, u32 block_size,
const struct avs_tplg_token_parser *parsers, u32 num_parsers)
{ … }
static const struct avs_tplg_token_parser path_tmpl_parsers[] = …;
static int parse_path_template(struct snd_soc_component *comp,
struct snd_soc_tplg_vendor_array *tuples, u32 block_size,
struct avs_tplg_path_template *template,
const struct avs_tplg_token_parser *tmpl_tokens, u32 num_tmpl_tokens,
const struct avs_tplg_token_parser *path_tokens, u32 num_path_tokens)
{ … }
static struct avs_tplg_path_template *
avs_tplg_path_template_create(struct snd_soc_component *comp, struct avs_tplg *owner,
struct snd_soc_tplg_vendor_array *tuples, u32 block_size)
{ … }
static const struct avs_tplg_token_parser mod_init_config_parsers[] = …;
static int avs_tplg_parse_initial_configs(struct snd_soc_component *comp,
struct snd_soc_tplg_vendor_array *tuples,
u32 block_size)
{ … }
static int avs_route_load(struct snd_soc_component *comp, int index,
struct snd_soc_dapm_route *route)
{ … }
static int avs_widget_load(struct snd_soc_component *comp, int index,
struct snd_soc_dapm_widget *w,
struct snd_soc_tplg_dapm_widget *dw)
{ … }
static int avs_widget_ready(struct snd_soc_component *comp, int index,
struct snd_soc_dapm_widget *w,
struct snd_soc_tplg_dapm_widget *dw)
{ … }
static int avs_dai_load(struct snd_soc_component *comp, int index,
struct snd_soc_dai_driver *dai_drv, struct snd_soc_tplg_pcm *pcm,
struct snd_soc_dai *dai)
{ … }
static int avs_link_load(struct snd_soc_component *comp, int index, struct snd_soc_dai_link *link,
struct snd_soc_tplg_link_config *cfg)
{ … }
static const struct avs_tplg_token_parser manifest_parsers[] = …;
static int avs_manifest(struct snd_soc_component *comp, int index,
struct snd_soc_tplg_manifest *manifest)
{ … }
#define AVS_CONTROL_OPS_VOLUME …
static const struct snd_soc_tplg_kcontrol_ops avs_control_ops[] = …;
static const struct avs_tplg_token_parser control_parsers[] = …;
static int
avs_control_load(struct snd_soc_component *comp, int index, struct snd_kcontrol_new *ctmpl,
struct snd_soc_tplg_ctl_hdr *hdr)
{ … }
static const struct snd_soc_tplg_ops avs_tplg_ops = …;
struct avs_tplg *avs_tplg_new(struct snd_soc_component *comp)
{ … }
int avs_load_topology(struct snd_soc_component *comp, const char *filename)
{ … }
int avs_remove_topology(struct snd_soc_component *comp)
{ … }