linux/include/sound/soc-topology.h

/* SPDX-License-Identifier: GPL-2.0
 *
 * linux/sound/soc-topology.h -- ALSA SoC Firmware Controls and DAPM
 *
 * Copyright (C) 2012 Texas Instruments Inc.
 * Copyright (C) 2015 Intel Corporation.
 *
 * Simple file API to load FW that includes mixers, coefficients, DAPM graphs,
 * algorithms, equalisers, DAIs, widgets, FE caps, BE caps, codec link caps etc.
 */

#ifndef __LINUX_SND_SOC_TPLG_H
#define __LINUX_SND_SOC_TPLG_H

#include <sound/asoc.h>
#include <linux/list.h>

struct firmware;
struct snd_kcontrol;
struct snd_soc_tplg_pcm_be;
struct snd_ctl_elem_value;
struct snd_ctl_elem_info;
struct snd_soc_dapm_widget;
struct snd_soc_component;
struct snd_soc_tplg_pcm_fe;
struct snd_soc_dapm_context;
struct snd_soc_card;
struct snd_kcontrol_new;
struct snd_soc_dai_link;
struct snd_soc_dai_driver;
struct snd_soc_dai;
struct snd_soc_dapm_route;

/* dynamic object type */
enum snd_soc_dobj_type {};

/* dynamic control object */
struct snd_soc_dobj_control {};

/* dynamic widget object */
struct snd_soc_dobj_widget {};

/* generic dynamic object - all dynamic objects belong to this struct */
struct snd_soc_dobj {};

/*
 * Kcontrol operations - used to map handlers onto firmware based controls.
 */
struct snd_soc_tplg_kcontrol_ops {};

/* Bytes ext operations, for TLV byte controls */
struct snd_soc_tplg_bytes_ext_ops {};

/*
 * DAPM widget event handlers - used to map handlers onto widgets.
 */
struct snd_soc_tplg_widget_events {};

/*
 * Public API - Used by component drivers to load and unload dynamic objects
 * and their resources.
 */
struct snd_soc_tplg_ops {};

#ifdef CONFIG_SND_SOC_TOPOLOGY

/* gets a pointer to data from the firmware block header */
static inline const void *snd_soc_tplg_get_data(struct snd_soc_tplg_hdr *hdr)
{}

/* Dynamic Object loading and removal for component drivers */
int snd_soc_tplg_component_load(struct snd_soc_component *comp,
	const struct snd_soc_tplg_ops *ops, const struct firmware *fw);
int snd_soc_tplg_component_remove(struct snd_soc_component *comp);

/* Binds event handlers to dynamic widgets */
int snd_soc_tplg_widget_bind_event(struct snd_soc_dapm_widget *w,
	const struct snd_soc_tplg_widget_events *events, int num_events,
	u16 event_type);

#else

static inline int snd_soc_tplg_component_remove(struct snd_soc_component *comp)
{
	return 0;
}

#endif

#endif