#include <linux/bits.h>
#include <linux/device.h>
#include <linux/errno.h>
#include <linux/firmware.h>
#include <linux/workqueue.h>
#include <sound/tlv.h>
#include <uapi/sound/sof/tokens.h>
#include "sof-priv.h"
#include "sof-audio.h"
#include "ops.h"
#define COMP_ID_UNASSIGNED …
#define VOL_TWENTIETH_ROOT_OF_TEN …
#define VOL_FORTIETH_ROOT_OF_TEN …
#define VOL_HALF_DB_STEP …
#define TLV_MIN …
#define TLV_STEP …
#define TLV_MUTE …
int sof_update_ipc_object(struct snd_soc_component *scomp, void *object, enum sof_tokens token_id,
struct snd_sof_tuple *tuples, int num_tuples,
size_t object_size, int token_instance_num)
{ … }
static inline int get_tlv_data(const int *p, int tlv[SOF_TLV_ITEMS])
{ … }
static inline u32 vol_shift_64(u64 i, u32 x)
{ … }
static u32 vol_pow32(u32 a, int exp, u32 fwl)
{ … }
u32 vol_compute_gain(u32 value, int *tlv)
{ … }
static int set_up_volume_table(struct snd_sof_control *scontrol,
int tlv[SOF_TLV_ITEMS], int size)
{ … }
struct sof_dai_types { … };
static const struct sof_dai_types sof_dais[] = …;
static enum sof_ipc_dai_type find_dai(const char *name)
{ … }
struct sof_frame_types { … };
static const struct sof_frame_types sof_frames[] = …;
static enum sof_ipc_frame find_format(const char *name)
{ … }
int get_token_u32(void *elem, void *object, u32 offset)
{ … }
int get_token_u16(void *elem, void *object, u32 offset)
{ … }
int get_token_uuid(void *elem, void *object, u32 offset)
{ … }
int get_token_string(void *elem, void *object, u32 offset)
{
char **dst = (char **)((u8 *)object + offset);
*dst = kstrdup(elem, GFP_KERNEL);
if (!*dst)
return -ENOMEM;
return 0;
};
int get_token_comp_format(void *elem, void *object, u32 offset)
{ … }
int get_token_dai_type(void *elem, void *object, u32 offset)
{ … }
static const struct sof_topology_token stream_tokens[] = …;
static const struct sof_topology_token led_tokens[] = …;
static const struct sof_topology_token comp_pin_tokens[] = …;
static const struct sof_topology_token comp_input_pin_binding_tokens[] = …;
static const struct sof_topology_token comp_output_pin_binding_tokens[] = …;
static int sof_parse_uuid_tokens(struct snd_soc_component *scomp,
void *object, size_t offset,
const struct sof_topology_token *tokens, int num_tokens,
struct snd_soc_tplg_vendor_array *array)
{ … }
static int sof_copy_tuples(struct snd_sof_dev *sdev, struct snd_soc_tplg_vendor_array *array,
int array_size, u32 token_id, int token_instance_num,
struct snd_sof_tuple *tuples, int tuples_size, int *num_copied_tuples)
{ … }
static int sof_parse_string_tokens(struct snd_soc_component *scomp,
void *object, int offset,
const struct sof_topology_token *tokens, int num_tokens,
struct snd_soc_tplg_vendor_array *array)
{ … }
static int sof_parse_word_tokens(struct snd_soc_component *scomp,
void *object, int offset,
const struct sof_topology_token *tokens, int num_tokens,
struct snd_soc_tplg_vendor_array *array)
{ … }
static int sof_parse_token_sets(struct snd_soc_component *scomp,
void *object, const struct sof_topology_token *tokens,
int count, struct snd_soc_tplg_vendor_array *array,
int array_size, int token_instance_num, size_t object_size)
{ … }
static int sof_parse_tokens(struct snd_soc_component *scomp, void *object,
const struct sof_topology_token *tokens, int num_tokens,
struct snd_soc_tplg_vendor_array *array,
int array_size)
{ … }
static int sof_control_load_volume(struct snd_soc_component *scomp,
struct snd_sof_control *scontrol,
struct snd_kcontrol_new *kc,
struct snd_soc_tplg_ctl_hdr *hdr)
{ … }
static int sof_control_load_enum(struct snd_soc_component *scomp,
struct snd_sof_control *scontrol,
struct snd_kcontrol_new *kc,
struct snd_soc_tplg_ctl_hdr *hdr)
{ … }
static int sof_control_load_bytes(struct snd_soc_component *scomp,
struct snd_sof_control *scontrol,
struct snd_kcontrol_new *kc,
struct snd_soc_tplg_ctl_hdr *hdr)
{ … }
static int sof_control_load(struct snd_soc_component *scomp, int index,
struct snd_kcontrol_new *kc,
struct snd_soc_tplg_ctl_hdr *hdr)
{ … }
static int sof_control_unload(struct snd_soc_component *scomp,
struct snd_soc_dobj *dobj)
{ … }
static int sof_connect_dai_widget(struct snd_soc_component *scomp,
struct snd_soc_dapm_widget *w,
struct snd_soc_tplg_dapm_widget *tw,
struct snd_sof_dai *dai)
{ … }
static void sof_disconnect_dai_widget(struct snd_soc_component *scomp,
struct snd_soc_dapm_widget *w)
{ … }
static int spcm_bind(struct snd_soc_component *scomp, struct snd_sof_pcm *spcm,
int dir)
{ … }
static int sof_get_token_value(u32 token_id, struct snd_sof_tuple *tuples, int num_tuples)
{ … }
static int sof_widget_parse_tokens(struct snd_soc_component *scomp, struct snd_sof_widget *swidget,
struct snd_soc_tplg_dapm_widget *tw,
enum sof_tokens *object_token_list, int count)
{ … }
static void sof_free_pin_binding(struct snd_sof_widget *swidget,
bool pin_type)
{ … }
static int sof_parse_pin_binding(struct snd_sof_widget *swidget,
struct snd_soc_tplg_private *priv, bool pin_type)
{ … }
static int get_w_no_wname_in_long_name(void *elem, void *object, u32 offset)
{ … }
static const struct sof_topology_token dapm_widget_tokens[] = …;
static int sof_widget_ready(struct snd_soc_component *scomp, int index,
struct snd_soc_dapm_widget *w,
struct snd_soc_tplg_dapm_widget *tw)
{ … }
static int sof_route_unload(struct snd_soc_component *scomp,
struct snd_soc_dobj *dobj)
{ … }
static int sof_widget_unload(struct snd_soc_component *scomp,
struct snd_soc_dobj *dobj)
{ … }
static int sof_dai_load(struct snd_soc_component *scomp, int index,
struct snd_soc_dai_driver *dai_drv,
struct snd_soc_tplg_pcm *pcm, struct snd_soc_dai *dai)
{ … }
static int sof_dai_unload(struct snd_soc_component *scomp,
struct snd_soc_dobj *dobj)
{ … }
static const struct sof_topology_token common_dai_link_tokens[] = …;
static int sof_link_load(struct snd_soc_component *scomp, int index, struct snd_soc_dai_link *link,
struct snd_soc_tplg_link_config *cfg)
{ … }
static int sof_link_unload(struct snd_soc_component *scomp, struct snd_soc_dobj *dobj)
{ … }
static int sof_route_load(struct snd_soc_component *scomp, int index,
struct snd_soc_dapm_route *route)
{ … }
static int sof_set_widget_pipeline(struct snd_sof_dev *sdev, struct snd_sof_pipeline *spipe,
struct snd_sof_widget *swidget)
{ … }
static int sof_complete(struct snd_soc_component *scomp)
{ … }
static int sof_manifest(struct snd_soc_component *scomp, int index,
struct snd_soc_tplg_manifest *man)
{ … }
static const struct snd_soc_tplg_kcontrol_ops sof_io_ops[] = …;
static const struct snd_soc_tplg_bytes_ext_ops sof_bytes_ext_ops[] = …;
static const struct snd_soc_tplg_ops sof_tplg_ops = …;
static int snd_sof_dspless_kcontrol(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_soc_tplg_kcontrol_ops sof_dspless_io_ops[] = …;
static int snd_sof_dspless_bytes_ext_get(struct snd_kcontrol *kcontrol,
unsigned int __user *binary_data,
unsigned int size)
{ … }
static int snd_sof_dspless_bytes_ext_put(struct snd_kcontrol *kcontrol,
const unsigned int __user *binary_data,
unsigned int size)
{ … }
static const struct snd_soc_tplg_bytes_ext_ops sof_dspless_bytes_ext_ops[] = …;
static int sof_dspless_widget_ready(struct snd_soc_component *scomp, int index,
struct snd_soc_dapm_widget *w,
struct snd_soc_tplg_dapm_widget *tw)
{ … }
static int sof_dspless_widget_unload(struct snd_soc_component *scomp,
struct snd_soc_dobj *dobj)
{ … }
static int sof_dspless_link_load(struct snd_soc_component *scomp, int index,
struct snd_soc_dai_link *link,
struct snd_soc_tplg_link_config *cfg)
{ … }
static const struct snd_soc_tplg_ops sof_dspless_tplg_ops = …;
int snd_sof_load_topology(struct snd_soc_component *scomp, const char *file)
{ … }
EXPORT_SYMBOL(…);