#ifndef __SOUND_SOC_SOF_AUDIO_H
#define __SOUND_SOC_SOF_AUDIO_H
#include <linux/workqueue.h>
#include <sound/soc.h>
#include <sound/control.h>
#include <sound/sof/stream.h>
#include <sound/sof/control.h>
#include <sound/sof/dai.h>
#include <sound/sof/topology.h>
#include "sof-priv.h"
#define SOF_AUDIO_PCM_DRV_NAME …
#define SOF_WIDGET_MAX_NUM_PINS …
#define SOF_PIN_TYPE_INPUT …
#define SOF_PIN_TYPE_OUTPUT …
#define SOF_BE_PCM_BASE …
#define DMA_CHAN_INVALID …
#define WIDGET_IS_DAI(id) …
#define WIDGET_IS_AIF(id) …
#define WIDGET_IS_AIF_OR_DAI(id) …
#define WIDGET_IS_COPIER(id) …
#define SOF_DAI_PARAM_INTEL_SSP_MCLK …
#define SOF_DAI_PARAM_INTEL_SSP_BCLK …
#define SOF_DAI_PARAM_INTEL_SSP_TDM_SLOTS …
enum sof_widget_op { … };
#define VOLUME_FWL …
#define SOF_TLV_ITEMS …
static inline u32 mixer_to_ipc(unsigned int value, u32 *volume_map, int size)
{ … }
static inline u32 ipc_to_mixer(u32 value, u32 *volume_map, int size)
{ … }
struct snd_sof_widget;
struct snd_sof_route;
struct snd_sof_control;
struct snd_sof_dai;
struct snd_sof_pcm;
struct snd_sof_dai_config_data { … };
struct sof_ipc_pcm_ops { … };
struct sof_ipc_tplg_control_ops { … };
struct sof_ipc_tplg_widget_ops { … };
struct sof_ipc_tplg_ops { … };
struct snd_sof_tuple { … };
enum sof_tokens { … };
struct sof_topology_token { … };
struct sof_token_info { … };
struct snd_sof_pcm_stream_pipeline_list { … };
struct snd_sof_pcm_stream { … };
struct snd_sof_pcm { … };
struct snd_sof_led_control { … };
struct snd_sof_control { … };
struct snd_sof_dai_link { … };
struct snd_sof_widget { … };
struct snd_sof_pipeline { … };
struct snd_sof_route { … };
struct snd_sof_dai { … };
int snd_sof_volume_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol);
int snd_sof_volume_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol);
int snd_sof_volume_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo);
int snd_sof_switch_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol);
int snd_sof_switch_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol);
int snd_sof_enum_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol);
int snd_sof_enum_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol);
int snd_sof_bytes_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol);
int snd_sof_bytes_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol);
int snd_sof_bytes_ext_put(struct snd_kcontrol *kcontrol,
const unsigned int __user *binary_data,
unsigned int size);
int snd_sof_bytes_ext_get(struct snd_kcontrol *kcontrol,
unsigned int __user *binary_data,
unsigned int size);
int snd_sof_bytes_ext_volatile_get(struct snd_kcontrol *kcontrol, unsigned int __user *binary_data,
unsigned int size);
void snd_sof_control_notify(struct snd_sof_dev *sdev,
struct sof_ipc_ctrl_data *cdata);
int snd_sof_load_topology(struct snd_soc_component *scomp, const char *file);
int snd_sof_ipc_stream_posn(struct snd_soc_component *scomp,
struct snd_sof_pcm *spcm, int direction,
struct sof_ipc_stream_posn *posn);
struct snd_sof_widget *snd_sof_find_swidget(struct snd_soc_component *scomp,
const char *name);
struct snd_sof_widget *
snd_sof_find_swidget_sname(struct snd_soc_component *scomp,
const char *pcm_name, int dir);
struct snd_sof_dai *snd_sof_find_dai(struct snd_soc_component *scomp,
const char *name);
static inline
struct snd_sof_pcm *snd_sof_find_spcm_dai(struct snd_soc_component *scomp,
struct snd_soc_pcm_runtime *rtd)
{ … }
struct snd_sof_pcm *snd_sof_find_spcm_name(struct snd_soc_component *scomp,
const char *name);
struct snd_sof_pcm *snd_sof_find_spcm_comp(struct snd_soc_component *scomp,
unsigned int comp_id,
int *direction);
void snd_sof_pcm_period_elapsed(struct snd_pcm_substream *substream);
void snd_sof_pcm_init_elapsed_work(struct work_struct *work);
#if IS_ENABLED(CONFIG_SND_SOC_SOF_COMPRESS)
void snd_sof_compr_fragment_elapsed(struct snd_compr_stream *cstream);
void snd_sof_compr_init_elapsed_work(struct work_struct *work);
#else
static inline void snd_sof_compr_fragment_elapsed(struct snd_compr_stream *cstream) { }
static inline void snd_sof_compr_init_elapsed_work(struct work_struct *work) { }
#endif
int sof_pcm_dai_link_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params);
bool snd_sof_stream_suspend_ignored(struct snd_sof_dev *sdev);
bool snd_sof_dsp_only_d0i3_compatible_stream_active(struct snd_sof_dev *sdev);
int sof_machine_register(struct snd_sof_dev *sdev, void *pdata);
void sof_machine_unregister(struct snd_sof_dev *sdev, void *pdata);
int sof_widget_setup(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget);
int sof_widget_free(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget);
int sof_route_setup(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget *wsource,
struct snd_soc_dapm_widget *wsink);
int sof_widget_list_setup(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm,
struct snd_pcm_hw_params *fe_params,
struct snd_sof_platform_stream_params *platform_params,
int dir);
int sof_widget_list_free(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm, int dir);
int sof_pcm_dsp_pcm_free(struct snd_pcm_substream *substream, struct snd_sof_dev *sdev,
struct snd_sof_pcm *spcm);
int sof_pcm_stream_free(struct snd_sof_dev *sdev, struct snd_pcm_substream *substream,
struct snd_sof_pcm *spcm, int dir, bool free_widget_list);
int get_token_u32(void *elem, void *object, u32 offset);
int get_token_u16(void *elem, void *object, u32 offset);
int get_token_comp_format(void *elem, void *object, u32 offset);
int get_token_dai_type(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);
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);
u32 vol_compute_gain(u32 value, int *tlv);
#endif