linux/sound/soc/sof/ipc3-topology.c

// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
//
// This file is provided under a dual BSD/GPLv2 license.  When using or
// redistributing this file, you may do so under either license.
//
// Copyright(c) 2021 Intel Corporation
//
//

#include <uapi/sound/sof/tokens.h>
#include <sound/pcm_params.h>
#include "sof-priv.h"
#include "sof-audio.h"
#include "ipc3-priv.h"
#include "ops.h"

/* Full volume for default values */
#define VOL_ZERO_DB

/* size of tplg ABI in bytes */
#define SOF_IPC3_TPLG_ABI_SIZE

struct sof_widget_data {};

struct sof_process_types {};

static const struct sof_process_types sof_process[] =;

static enum sof_ipc_process_type find_process(const char *name)
{}

static int get_token_process_type(void *elem, void *object, u32 offset)
{}

/* Buffers */
static const struct sof_topology_token buffer_tokens[] =;

/* DAI */
static const struct sof_topology_token dai_tokens[] =;

/* BE DAI link */
static const struct sof_topology_token dai_link_tokens[] =;

/* scheduling */
static const struct sof_topology_token sched_tokens[] =;

static const struct sof_topology_token pipeline_tokens[] =;

/* volume */
static const struct sof_topology_token volume_tokens[] =;

/* SRC */
static const struct sof_topology_token src_tokens[] =;

/* ASRC */
static const struct sof_topology_token asrc_tokens[] =;

/* EFFECT */
static const struct sof_topology_token process_tokens[] =;

/* PCM */
static const struct sof_topology_token pcm_tokens[] =;

/* Generic components */
static const struct sof_topology_token comp_tokens[] =;

/* SSP */
static const struct sof_topology_token ssp_tokens[] =;

/* ALH */
static const struct sof_topology_token alh_tokens[] =;

/* DMIC */
static const struct sof_topology_token dmic_tokens[] =;

/* ESAI */
static const struct sof_topology_token esai_tokens[] =;

/* SAI */
static const struct sof_topology_token sai_tokens[] =;

/*
 * DMIC PDM Tokens
 * SOF_TKN_INTEL_DMIC_PDM_CTRL_ID should be the first token
 * as it increments the index while parsing the array of pdm tokens
 * and determines the correct offset
 */
static const struct sof_topology_token dmic_pdm_tokens[] =;

/* HDA */
static const struct sof_topology_token hda_tokens[] =;

/* AFE */
static const struct sof_topology_token afe_tokens[] =;

/* ACPDMIC */
static const struct sof_topology_token acpdmic_tokens[] =;

/* ACPI2S */
static const struct sof_topology_token acpi2s_tokens[] =;

/* MICFIL PDM */
static const struct sof_topology_token micfil_pdm_tokens[] =;

/* ACP_SDW */
static const struct sof_topology_token acp_sdw_tokens[] =;

/* Core tokens */
static const struct sof_topology_token core_tokens[] =;

/* Component extended tokens */
static const struct sof_topology_token comp_ext_tokens[] =;

static const struct sof_token_info ipc3_token_list[SOF_TOKEN_COUNT] =;

/**
 * sof_comp_alloc - allocate and initialize buffer for a new component
 * @swidget: pointer to struct snd_sof_widget containing extended data
 * @ipc_size: IPC payload size that will be updated depending on valid
 *  extended data.
 * @index: ID of the pipeline the component belongs to
 *
 * Return: The pointer to the new allocated component, NULL if failed.
 */
static void *sof_comp_alloc(struct snd_sof_widget *swidget, size_t *ipc_size,
			    int index)
{}

static void sof_dbg_comp_config(struct snd_soc_component *scomp, struct sof_ipc_comp_config *config)
{}

static int sof_ipc3_widget_setup_comp_host(struct snd_sof_widget *swidget)
{}

static void sof_ipc3_widget_free_comp(struct snd_sof_widget *swidget)
{}

static int sof_ipc3_widget_setup_comp_tone(struct snd_sof_widget *swidget)
{}

static int sof_ipc3_widget_setup_comp_mixer(struct snd_sof_widget *swidget)
{}

static int sof_ipc3_widget_setup_comp_pipeline(struct snd_sof_widget *swidget)
{}

static int sof_ipc3_widget_setup_comp_buffer(struct snd_sof_widget *swidget)
{}

static int sof_ipc3_widget_setup_comp_src(struct snd_sof_widget *swidget)
{}

static int sof_ipc3_widget_setup_comp_asrc(struct snd_sof_widget *swidget)
{}

/*
 * Mux topology
 */
static int sof_ipc3_widget_setup_comp_mux(struct snd_sof_widget *swidget)
{}

/*
 * PGA Topology
 */

static int sof_ipc3_widget_setup_comp_pga(struct snd_sof_widget *swidget)
{}

static int sof_get_control_data(struct snd_soc_component *scomp,
				struct snd_soc_dapm_widget *widget,
				struct sof_widget_data *wdata, size_t *size)
{}

static int sof_process_load(struct snd_soc_component *scomp,
			    struct snd_sof_widget *swidget, int type)
{}

static enum sof_comp_type find_process_comp_type(enum sof_ipc_process_type type)
{}

/*
 * Processing Component Topology - can be "effect", "codec", or general
 * "processing".
 */

static int sof_widget_update_ipc_comp_process(struct snd_sof_widget *swidget)
{}

static int sof_link_hda_load(struct snd_soc_component *scomp, struct snd_sof_dai_link *slink,
			     struct sof_ipc_dai_config *config, struct snd_sof_dai *dai)
{}

static void sof_dai_set_format(struct snd_soc_tplg_hw_config *hw_config,
			       struct sof_ipc_dai_config *config)
{}

static int sof_link_sai_load(struct snd_soc_component *scomp, struct snd_sof_dai_link *slink,
			     struct sof_ipc_dai_config *config, struct snd_sof_dai *dai)
{}

static int sof_link_esai_load(struct snd_soc_component *scomp, struct snd_sof_dai_link *slink,
			      struct sof_ipc_dai_config *config, struct snd_sof_dai *dai)
{}

static int sof_link_micfil_load(struct snd_soc_component *scomp, struct snd_sof_dai_link *slink,
				struct sof_ipc_dai_config *config, struct snd_sof_dai *dai)
{}

static int sof_link_acp_dmic_load(struct snd_soc_component *scomp, struct snd_sof_dai_link *slink,
				  struct sof_ipc_dai_config *config, struct snd_sof_dai *dai)
{}

static int sof_link_acp_bt_load(struct snd_soc_component *scomp, struct snd_sof_dai_link *slink,
				struct sof_ipc_dai_config *config, struct snd_sof_dai *dai)
{}

static int sof_link_acp_sp_load(struct snd_soc_component *scomp, struct snd_sof_dai_link *slink,
				struct sof_ipc_dai_config *config, struct snd_sof_dai *dai)
{}

static int sof_link_acp_hs_load(struct snd_soc_component *scomp, struct snd_sof_dai_link *slink,
				struct sof_ipc_dai_config *config, struct snd_sof_dai *dai)
{}

static int sof_link_acp_sdw_load(struct snd_soc_component *scomp, struct snd_sof_dai_link *slink,
				 struct sof_ipc_dai_config *config, struct snd_sof_dai *dai)
{}

static int sof_link_afe_load(struct snd_soc_component *scomp, struct snd_sof_dai_link *slink,
			     struct sof_ipc_dai_config *config, struct snd_sof_dai *dai)
{}

static int sof_link_ssp_load(struct snd_soc_component *scomp, struct snd_sof_dai_link *slink,
			     struct sof_ipc_dai_config *config, struct snd_sof_dai *dai)
{}

static int sof_link_dmic_load(struct snd_soc_component *scomp, struct snd_sof_dai_link *slink,
			      struct sof_ipc_dai_config *config, struct snd_sof_dai *dai)
{}

static int sof_link_alh_load(struct snd_soc_component *scomp, struct snd_sof_dai_link *slink,
			     struct sof_ipc_dai_config *config, struct snd_sof_dai *dai)
{}

static int sof_ipc3_widget_setup_comp_dai(struct snd_sof_widget *swidget)
{}

static void sof_ipc3_widget_free_comp_dai(struct snd_sof_widget *swidget)
{}

static int sof_ipc3_route_setup(struct snd_sof_dev *sdev, struct snd_sof_route *sroute)
{}

static int sof_ipc3_control_load_bytes(struct snd_sof_dev *sdev, struct snd_sof_control *scontrol)
{}

static int sof_ipc3_control_load_volume(struct snd_sof_dev *sdev, struct snd_sof_control *scontrol)
{}

static int sof_ipc3_control_load_enum(struct snd_sof_dev *sdev, struct snd_sof_control *scontrol)
{}

static int sof_ipc3_control_setup(struct snd_sof_dev *sdev, struct snd_sof_control *scontrol)
{}

static int sof_ipc3_control_free(struct snd_sof_dev *sdev, struct snd_sof_control *scontrol)
{}

/* send pcm params ipc */
static int sof_ipc3_keyword_detect_pcm_params(struct snd_sof_widget *swidget, int dir)
{}

 /* send stream trigger ipc */
static int sof_ipc3_keyword_detect_trigger(struct snd_sof_widget *swidget, int cmd)
{}

static int sof_ipc3_keyword_dapm_event(struct snd_soc_dapm_widget *w,
				       struct snd_kcontrol *k, int event)
{}

/* event handlers for keyword detect component */
static const struct snd_soc_tplg_widget_events sof_kwd_events[] =;

static int sof_ipc3_widget_bind_event(struct snd_soc_component *scomp,
				      struct snd_sof_widget *swidget, u16 event_type)
{}

static int sof_ipc3_complete_pipeline(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget)
{}

static int sof_ipc3_widget_free(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget)
{}

static int sof_ipc3_dai_config(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget,
			       unsigned int flags, struct snd_sof_dai_config_data *data)
{}

static int sof_ipc3_widget_setup(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget)
{}

static int sof_ipc3_set_up_all_pipelines(struct snd_sof_dev *sdev, bool verify)
{}

/*
 * Free the PCM, its associated widgets and set the prepared flag to false for all PCMs that
 * did not get suspended(ex: paused streams) so the widgets can be set up again during resume.
 */
static int sof_tear_down_left_over_pipelines(struct snd_sof_dev *sdev)
{}

static int sof_ipc3_free_widgets_in_list(struct snd_sof_dev *sdev, bool include_scheduler,
					 bool *dyn_widgets, bool verify)
{}

/*
 * For older firmware, this function doesn't free widgets for static pipelines during suspend.
 * It only resets use_count for all widgets.
 */
static int sof_ipc3_tear_down_all_pipelines(struct snd_sof_dev *sdev, bool verify)
{}

static int sof_ipc3_dai_get_param(struct snd_sof_dev *sdev, struct snd_sof_dai *dai, int param_type)
{}

static int sof_ipc3_parse_manifest(struct snd_soc_component *scomp, int index,
				   struct snd_soc_tplg_manifest *man)
{}

static int sof_ipc3_link_setup(struct snd_sof_dev *sdev, struct snd_soc_dai_link *link)
{}

/* token list for each topology object */
static enum sof_tokens host_token_list[] =;

static enum sof_tokens comp_generic_token_list[] =;

static enum sof_tokens buffer_token_list[] =;

static enum sof_tokens pipeline_token_list[] =;

static enum sof_tokens asrc_token_list[] =;

static enum sof_tokens src_token_list[] =;

static enum sof_tokens pga_token_list[] =;

static enum sof_tokens dai_token_list[] =;

static enum sof_tokens process_token_list[] =;

static const struct sof_ipc_tplg_widget_ops tplg_ipc3_widget_ops[SND_SOC_DAPM_TYPE_COUNT] =;

const struct sof_ipc_tplg_ops ipc3_tplg_ops =;