Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
0002 /*
0003  * This file is provided under a dual BSD/GPLv2 license.  When using or
0004  * redistributing this file, you may do so under either license.
0005  *
0006  * Copyright(c) 2019 Intel Corporation. All rights reserved.
0007  *
0008  * Author: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
0009  */
0010 
0011 #ifndef __SOUND_SOC_SOF_AUDIO_H
0012 #define __SOUND_SOC_SOF_AUDIO_H
0013 
0014 #include <linux/workqueue.h>
0015 
0016 #include <sound/soc.h>
0017 #include <sound/control.h>
0018 #include <sound/sof/stream.h> /* needs to be included before control.h */
0019 #include <sound/sof/control.h>
0020 #include <sound/sof/dai.h>
0021 #include <sound/sof/topology.h>
0022 #include "sof-priv.h"
0023 
0024 #define SOF_AUDIO_PCM_DRV_NAME  "sof-audio-component"
0025 
0026 /* max number of FE PCMs before BEs */
0027 #define SOF_BE_PCM_BASE     16
0028 
0029 #define DMA_CHAN_INVALID    0xFFFFFFFF
0030 
0031 #define WIDGET_IS_DAI(id) ((id) == snd_soc_dapm_dai_in || (id) == snd_soc_dapm_dai_out)
0032 #define WIDGET_IS_AIF(id) ((id) == snd_soc_dapm_aif_in || (id) == snd_soc_dapm_aif_out)
0033 #define WIDGET_IS_AIF_OR_DAI(id) (WIDGET_IS_DAI(id) || WIDGET_IS_AIF(id))
0034 
0035 #define SOF_DAI_CLK_INTEL_SSP_MCLK  0
0036 #define SOF_DAI_CLK_INTEL_SSP_BCLK  1
0037 
0038 enum sof_widget_op {
0039     SOF_WIDGET_PREPARE,
0040     SOF_WIDGET_SETUP,
0041     SOF_WIDGET_FREE,
0042     SOF_WIDGET_UNPREPARE,
0043 };
0044 
0045 /*
0046  * Volume fractional word length define to 16 sets
0047  * the volume linear gain value to use Qx.16 format
0048  */
0049 #define VOLUME_FWL  16
0050 
0051 #define SOF_TLV_ITEMS 3
0052 
0053 static inline u32 mixer_to_ipc(unsigned int value, u32 *volume_map, int size)
0054 {
0055     if (value >= size)
0056         return volume_map[size - 1];
0057 
0058     return volume_map[value];
0059 }
0060 
0061 static inline u32 ipc_to_mixer(u32 value, u32 *volume_map, int size)
0062 {
0063     int i;
0064 
0065     for (i = 0; i < size; i++) {
0066         if (volume_map[i] >= value)
0067             return i;
0068     }
0069 
0070     return i - 1;
0071 }
0072 
0073 struct snd_sof_widget;
0074 struct snd_sof_route;
0075 struct snd_sof_control;
0076 struct snd_sof_dai;
0077 
0078 struct snd_sof_dai_config_data {
0079     int dai_index;
0080     int dai_data; /* contains DAI-specific information */
0081 };
0082 
0083 /**
0084  * struct sof_ipc_pcm_ops - IPC-specific PCM ops
0085  * @hw_params: Function pointer for hw_params
0086  * @hw_free: Function pointer for hw_free
0087  * @trigger: Function pointer for trigger
0088  * @dai_link_fixup: Function pointer for DAI link fixup
0089  */
0090 struct sof_ipc_pcm_ops {
0091     int (*hw_params)(struct snd_soc_component *component, struct snd_pcm_substream *substream,
0092              struct snd_pcm_hw_params *params,
0093              struct snd_sof_platform_stream_params *platform_params);
0094     int (*hw_free)(struct snd_soc_component *component, struct snd_pcm_substream *substream);
0095     int (*trigger)(struct snd_soc_component *component,  struct snd_pcm_substream *substream,
0096                int cmd);
0097     int (*dai_link_fixup)(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params);
0098 };
0099 
0100 /**
0101  * struct sof_ipc_tplg_control_ops - IPC-specific ops for topology kcontrol IO
0102  */
0103 struct sof_ipc_tplg_control_ops {
0104     bool (*volume_put)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
0105     int (*volume_get)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
0106     bool (*switch_put)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
0107     int (*switch_get)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
0108     bool (*enum_put)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
0109     int (*enum_get)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
0110     int (*bytes_put)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
0111     int (*bytes_get)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
0112     int (*bytes_ext_get)(struct snd_sof_control *scontrol,
0113                  const unsigned int __user *binary_data, unsigned int size);
0114     int (*bytes_ext_volatile_get)(struct snd_sof_control *scontrol,
0115                       const unsigned int __user *binary_data, unsigned int size);
0116     int (*bytes_ext_put)(struct snd_sof_control *scontrol,
0117                  const unsigned int __user *binary_data, unsigned int size);
0118     /* update control data based on notification from the DSP */
0119     void (*update)(struct snd_sof_dev *sdev, void *ipc_control_message);
0120     /* Optional callback to setup kcontrols associated with an swidget */
0121     int (*widget_kcontrol_setup)(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget);
0122     /* mandatory callback to set up volume table for volume kcontrols */
0123     int (*set_up_volume_table)(struct snd_sof_control *scontrol, int tlv[SOF_TLV_ITEMS],
0124                    int size);
0125 };
0126 
0127 /**
0128  * struct sof_ipc_tplg_widget_ops - IPC-specific ops for topology widgets
0129  * @ipc_setup: Function pointer for setting up widget IPC params
0130  * @ipc_free: Function pointer for freeing widget IPC params
0131  * @token_list: List of token ID's that should be parsed for the widget
0132  * @token_list_size: number of elements in token_list
0133  * @bind_event: Function pointer for binding events to the widget
0134  * @ipc_prepare: Optional op for preparing a widget for set up
0135  * @ipc_unprepare: Optional op for unpreparing a widget
0136  */
0137 struct sof_ipc_tplg_widget_ops {
0138     int (*ipc_setup)(struct snd_sof_widget *swidget);
0139     void (*ipc_free)(struct snd_sof_widget *swidget);
0140     enum sof_tokens *token_list;
0141     int token_list_size;
0142     int (*bind_event)(struct snd_soc_component *scomp, struct snd_sof_widget *swidget,
0143               u16 event_type);
0144     int (*ipc_prepare)(struct snd_sof_widget *swidget,
0145                struct snd_pcm_hw_params *fe_params,
0146                struct snd_sof_platform_stream_params *platform_params,
0147                struct snd_pcm_hw_params *source_params, int dir);
0148     void (*ipc_unprepare)(struct snd_sof_widget *swidget);
0149 };
0150 
0151 /**
0152  * struct sof_ipc_tplg_ops - IPC-specific topology ops
0153  * @widget: Array of pointers to IPC-specific ops for widgets. This should always be of size
0154  *      SND_SOF_DAPM_TYPE_COUNT i.e one per widget type. Unsupported widget types will be
0155  *      initialized to 0.
0156  * @control: Pointer to the IPC-specific ops for topology kcontrol IO
0157  * @route_setup: Function pointer for setting up pipeline connections
0158  * @route_free: Optional op for freeing pipeline connections.
0159  * @token_list: List of all tokens supported by the IPC version. The size of the token_list
0160  *      array should be SOF_TOKEN_COUNT. The unused elements in the array will be
0161  *      initialized to 0.
0162  * @control_setup: Function pointer for setting up kcontrol IPC-specific data
0163  * @control_free: Function pointer for freeing kcontrol IPC-specific data
0164  * @pipeline_complete: Function pointer for pipeline complete IPC
0165  * @widget_setup: Function pointer for setting up setup in the DSP
0166  * @widget_free: Function pointer for freeing widget in the DSP
0167  * @dai_config: Function pointer for sending DAI config IPC to the DSP
0168  * @dai_get_clk: Function pointer for getting the DAI clock setting
0169  * @set_up_all_pipelines: Function pointer for setting up all topology pipelines
0170  * @tear_down_all_pipelines: Function pointer for tearing down all topology pipelines
0171  * @parse_manifest: Optional function pointer for ipc4 specific parsing of topology manifest
0172  */
0173 struct sof_ipc_tplg_ops {
0174     const struct sof_ipc_tplg_widget_ops *widget;
0175     const struct sof_ipc_tplg_control_ops *control;
0176     int (*route_setup)(struct snd_sof_dev *sdev, struct snd_sof_route *sroute);
0177     int (*route_free)(struct snd_sof_dev *sdev, struct snd_sof_route *sroute);
0178     const struct sof_token_info *token_list;
0179     int (*control_setup)(struct snd_sof_dev *sdev, struct snd_sof_control *scontrol);
0180     int (*control_free)(struct snd_sof_dev *sdev, struct snd_sof_control *scontrol);
0181     int (*pipeline_complete)(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget);
0182     int (*widget_setup)(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget);
0183     int (*widget_free)(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget);
0184     int (*dai_config)(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget,
0185               unsigned int flags, struct snd_sof_dai_config_data *data);
0186     int (*dai_get_clk)(struct snd_sof_dev *sdev, struct snd_sof_dai *dai, int clk_type);
0187     int (*set_up_all_pipelines)(struct snd_sof_dev *sdev, bool verify);
0188     int (*tear_down_all_pipelines)(struct snd_sof_dev *sdev, bool verify);
0189     int (*parse_manifest)(struct snd_soc_component *scomp, int index,
0190                   struct snd_soc_tplg_manifest *man);
0191 };
0192 
0193 /** struct snd_sof_tuple - Tuple info
0194  * @token:  Token ID
0195  * @value:  union of a string or a u32 values
0196  */
0197 struct snd_sof_tuple {
0198     u32 token;
0199     union {
0200         u32 v;
0201         const char *s;
0202     } value;
0203 };
0204 
0205 /*
0206  * List of SOF token ID's. The order of ID's does not matter as token arrays are looked up based on
0207  * the ID.
0208  */
0209 enum sof_tokens {
0210     SOF_PCM_TOKENS,
0211     SOF_PIPELINE_TOKENS,
0212     SOF_SCHED_TOKENS,
0213     SOF_ASRC_TOKENS,
0214     SOF_SRC_TOKENS,
0215     SOF_COMP_TOKENS,
0216     SOF_BUFFER_TOKENS,
0217     SOF_VOLUME_TOKENS,
0218     SOF_PROCESS_TOKENS,
0219     SOF_DAI_TOKENS,
0220     SOF_DAI_LINK_TOKENS,
0221     SOF_HDA_TOKENS,
0222     SOF_SSP_TOKENS,
0223     SOF_ALH_TOKENS,
0224     SOF_DMIC_TOKENS,
0225     SOF_DMIC_PDM_TOKENS,
0226     SOF_ESAI_TOKENS,
0227     SOF_SAI_TOKENS,
0228     SOF_AFE_TOKENS,
0229     SOF_CORE_TOKENS,
0230     SOF_COMP_EXT_TOKENS,
0231     SOF_IN_AUDIO_FORMAT_TOKENS,
0232     SOF_OUT_AUDIO_FORMAT_TOKENS,
0233     SOF_AUDIO_FORMAT_BUFFER_SIZE_TOKENS,
0234     SOF_COPIER_GATEWAY_CFG_TOKENS,
0235     SOF_COPIER_TOKENS,
0236     SOF_AUDIO_FMT_NUM_TOKENS,
0237     SOF_COPIER_FORMAT_TOKENS,
0238     SOF_GAIN_TOKENS,
0239     SOF_ACPDMIC_TOKENS,
0240 
0241     /* this should be the last */
0242     SOF_TOKEN_COUNT,
0243 };
0244 
0245 /**
0246  * struct sof_topology_token - SOF topology token definition
0247  * @token:      Token number
0248  * @type:       Token type
0249  * @get_token:      Function pointer to parse the token value and save it in a object
0250  * @offset:     Offset within an object to save the token value into
0251  */
0252 struct sof_topology_token {
0253     u32 token;
0254     u32 type;
0255     int (*get_token)(void *elem, void *object, u32 offset);
0256     u32 offset;
0257 };
0258 
0259 struct sof_token_info {
0260     const char *name;
0261     const struct sof_topology_token *tokens;
0262     int count;
0263 };
0264 
0265 /* PCM stream, mapped to FW component  */
0266 struct snd_sof_pcm_stream {
0267     u32 comp_id;
0268     struct snd_dma_buffer page_table;
0269     struct sof_ipc_stream_posn posn;
0270     struct snd_pcm_substream *substream;
0271     struct snd_compr_stream *cstream;
0272     struct work_struct period_elapsed_work;
0273     struct snd_soc_dapm_widget_list *list; /* list of connected DAPM widgets */
0274     bool d0i3_compatible; /* DSP can be in D0I3 when this pcm is opened */
0275     /*
0276      * flag to indicate that the DSP pipelines should be kept
0277      * active or not while suspending the stream
0278      */
0279     bool suspend_ignored;
0280 };
0281 
0282 /* ALSA SOF PCM device */
0283 struct snd_sof_pcm {
0284     struct snd_soc_component *scomp;
0285     struct snd_soc_tplg_pcm pcm;
0286     struct snd_sof_pcm_stream stream[2];
0287     struct list_head list;  /* list in sdev pcm list */
0288     struct snd_pcm_hw_params params[2];
0289     bool prepared[2]; /* PCM_PARAMS set successfully */
0290 };
0291 
0292 struct snd_sof_led_control {
0293     unsigned int use_led;
0294     unsigned int direction;
0295     int led_value;
0296 };
0297 
0298 /* ALSA SOF Kcontrol device */
0299 struct snd_sof_control {
0300     struct snd_soc_component *scomp;
0301     const char *name;
0302     int comp_id;
0303     int min_volume_step; /* min volume step for volume_table */
0304     int max_volume_step; /* max volume step for volume_table */
0305     int num_channels;
0306     unsigned int access;
0307     int info_type;
0308     int index; /* pipeline ID */
0309     void *priv; /* private data copied from topology */
0310     size_t priv_size; /* size of private data */
0311     size_t max_size;
0312     void *ipc_control_data;
0313     int max; /* applicable to volume controls */
0314     u32 size;   /* cdata size */
0315     u32 *volume_table; /* volume table computed from tlv data*/
0316 
0317     struct list_head list;  /* list in sdev control list */
0318 
0319     struct snd_sof_led_control led_ctl;
0320 
0321     /* if true, the control's data needs to be updated from Firmware */
0322     bool comp_data_dirty;
0323 };
0324 
0325 /** struct snd_sof_dai_link - DAI link info
0326  * @tuples: array of parsed tuples
0327  * @num_tuples: number of tuples in the tuples array
0328  * @link: Pointer to snd_soc_dai_link
0329  * @hw_configs: Pointer to hw configs in topology
0330  * @num_hw_configs: Number of hw configs in topology
0331  * @default_hw_cfg_id: Default hw config ID
0332  * @type: DAI type
0333  * @list: item in snd_sof_dev dai_link list
0334  */
0335 struct snd_sof_dai_link {
0336     struct snd_sof_tuple *tuples;
0337     int num_tuples;
0338     struct snd_soc_dai_link *link;
0339     struct snd_soc_tplg_hw_config *hw_configs;
0340     int num_hw_configs;
0341     int default_hw_cfg_id;
0342     int type;
0343     struct list_head list;
0344 };
0345 
0346 /* ASoC SOF DAPM widget */
0347 struct snd_sof_widget {
0348     struct snd_soc_component *scomp;
0349     int comp_id;
0350     int pipeline_id;
0351     /*
0352      * complete flag is used to indicate that pipeline set up is complete for scheduler type
0353      * widgets. It is unused for all other widget types.
0354      */
0355     int complete;
0356     /*
0357      * the prepared flag is used to indicate that a widget has been prepared for getting set
0358      * up in the DSP.
0359      */
0360     bool prepared;
0361     int use_count; /* use_count will be protected by the PCM mutex held by the core */
0362     int core;
0363     int id; /* id is the DAPM widget type */
0364     /*
0365      * Instance ID is set dynamically when the widget gets set up in the FW. It should be
0366      * unique for each module type across all pipelines. This will not be used in SOF_IPC.
0367      */
0368     int instance_id;
0369 
0370     /*
0371      * Flag indicating if the widget should be set up dynamically when a PCM is opened.
0372      * This flag is only set for the scheduler type widget in topology. During topology
0373      * loading, this flag is propagated to all the widgets belonging to the same pipeline.
0374      * When this flag is not set, a widget is set up at the time of topology loading
0375      * and retained until the DSP enters D3. It will need to be set up again when resuming
0376      * from D3.
0377      */
0378     bool dynamic_pipeline_widget;
0379 
0380     struct snd_soc_dapm_widget *widget;
0381     struct list_head list;  /* list in sdev widget list */
0382     struct snd_sof_widget *pipe_widget;
0383     void *module_info;
0384 
0385     const guid_t uuid;
0386 
0387     int num_tuples;
0388     struct snd_sof_tuple *tuples;
0389 
0390     void *private;      /* core does not touch this */
0391 };
0392 
0393 /* ASoC SOF DAPM route */
0394 struct snd_sof_route {
0395     struct snd_soc_component *scomp;
0396 
0397     struct snd_soc_dapm_route *route;
0398     struct list_head list;  /* list in sdev route list */
0399     struct snd_sof_widget *src_widget;
0400     struct snd_sof_widget *sink_widget;
0401     bool setup;
0402 
0403     void *private;
0404 };
0405 
0406 /* ASoC DAI device */
0407 struct snd_sof_dai {
0408     struct snd_soc_component *scomp;
0409     const char *name;
0410 
0411     int number_configs;
0412     int current_config;
0413     struct list_head list;  /* list in sdev dai list */
0414     void *private;
0415 };
0416 
0417 /*
0418  * Kcontrols.
0419  */
0420 
0421 int snd_sof_volume_get(struct snd_kcontrol *kcontrol,
0422                struct snd_ctl_elem_value *ucontrol);
0423 int snd_sof_volume_put(struct snd_kcontrol *kcontrol,
0424                struct snd_ctl_elem_value *ucontrol);
0425 int snd_sof_volume_info(struct snd_kcontrol *kcontrol,
0426             struct snd_ctl_elem_info *uinfo);
0427 int snd_sof_switch_get(struct snd_kcontrol *kcontrol,
0428                struct snd_ctl_elem_value *ucontrol);
0429 int snd_sof_switch_put(struct snd_kcontrol *kcontrol,
0430                struct snd_ctl_elem_value *ucontrol);
0431 int snd_sof_enum_get(struct snd_kcontrol *kcontrol,
0432              struct snd_ctl_elem_value *ucontrol);
0433 int snd_sof_enum_put(struct snd_kcontrol *kcontrol,
0434              struct snd_ctl_elem_value *ucontrol);
0435 int snd_sof_bytes_get(struct snd_kcontrol *kcontrol,
0436               struct snd_ctl_elem_value *ucontrol);
0437 int snd_sof_bytes_put(struct snd_kcontrol *kcontrol,
0438               struct snd_ctl_elem_value *ucontrol);
0439 int snd_sof_bytes_ext_put(struct snd_kcontrol *kcontrol,
0440               const unsigned int __user *binary_data,
0441               unsigned int size);
0442 int snd_sof_bytes_ext_get(struct snd_kcontrol *kcontrol,
0443               unsigned int __user *binary_data,
0444               unsigned int size);
0445 int snd_sof_bytes_ext_volatile_get(struct snd_kcontrol *kcontrol, unsigned int __user *binary_data,
0446                    unsigned int size);
0447 void snd_sof_control_notify(struct snd_sof_dev *sdev,
0448                 struct sof_ipc_ctrl_data *cdata);
0449 
0450 /*
0451  * Topology.
0452  * There is no snd_sof_free_topology since topology components will
0453  * be freed by snd_soc_unregister_component,
0454  */
0455 int snd_sof_load_topology(struct snd_soc_component *scomp, const char *file);
0456 
0457 /*
0458  * Stream IPC
0459  */
0460 int snd_sof_ipc_stream_posn(struct snd_soc_component *scomp,
0461                 struct snd_sof_pcm *spcm, int direction,
0462                 struct sof_ipc_stream_posn *posn);
0463 
0464 struct snd_sof_widget *snd_sof_find_swidget(struct snd_soc_component *scomp,
0465                         const char *name);
0466 struct snd_sof_widget *
0467 snd_sof_find_swidget_sname(struct snd_soc_component *scomp,
0468                const char *pcm_name, int dir);
0469 struct snd_sof_dai *snd_sof_find_dai(struct snd_soc_component *scomp,
0470                      const char *name);
0471 
0472 static inline
0473 struct snd_sof_pcm *snd_sof_find_spcm_dai(struct snd_soc_component *scomp,
0474                       struct snd_soc_pcm_runtime *rtd)
0475 {
0476     struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
0477     struct snd_sof_pcm *spcm;
0478 
0479     list_for_each_entry(spcm, &sdev->pcm_list, list) {
0480         if (le32_to_cpu(spcm->pcm.dai_id) == rtd->dai_link->id)
0481             return spcm;
0482     }
0483 
0484     return NULL;
0485 }
0486 
0487 struct snd_sof_pcm *snd_sof_find_spcm_name(struct snd_soc_component *scomp,
0488                        const char *name);
0489 struct snd_sof_pcm *snd_sof_find_spcm_comp(struct snd_soc_component *scomp,
0490                        unsigned int comp_id,
0491                        int *direction);
0492 void snd_sof_pcm_period_elapsed(struct snd_pcm_substream *substream);
0493 void snd_sof_pcm_init_elapsed_work(struct work_struct *work);
0494 
0495 #if IS_ENABLED(CONFIG_SND_SOC_SOF_COMPRESS)
0496 void snd_sof_compr_fragment_elapsed(struct snd_compr_stream *cstream);
0497 void snd_sof_compr_init_elapsed_work(struct work_struct *work);
0498 #else
0499 static inline void snd_sof_compr_fragment_elapsed(struct snd_compr_stream *cstream) { }
0500 static inline void snd_sof_compr_init_elapsed_work(struct work_struct *work) { }
0501 #endif
0502 
0503 /* DAI link fixup */
0504 int sof_pcm_dai_link_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params);
0505 
0506 /* PM */
0507 bool snd_sof_stream_suspend_ignored(struct snd_sof_dev *sdev);
0508 bool snd_sof_dsp_only_d0i3_compatible_stream_active(struct snd_sof_dev *sdev);
0509 
0510 /* Machine driver enumeration */
0511 int sof_machine_register(struct snd_sof_dev *sdev, void *pdata);
0512 void sof_machine_unregister(struct snd_sof_dev *sdev, void *pdata);
0513 
0514 int sof_widget_setup(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget);
0515 int sof_widget_free(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget);
0516 int sof_route_setup(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget *wsource,
0517             struct snd_soc_dapm_widget *wsink);
0518 
0519 /* PCM */
0520 int sof_widget_list_setup(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm,
0521               struct snd_pcm_hw_params *fe_params,
0522               struct snd_sof_platform_stream_params *platform_params,
0523               int dir);
0524 int sof_widget_list_free(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm, int dir);
0525 int sof_pcm_dsp_pcm_free(struct snd_pcm_substream *substream, struct snd_sof_dev *sdev,
0526              struct snd_sof_pcm *spcm);
0527 int sof_pcm_stream_free(struct snd_sof_dev *sdev, struct snd_pcm_substream *substream,
0528             struct snd_sof_pcm *spcm, int dir, bool free_widget_list);
0529 int get_token_u32(void *elem, void *object, u32 offset);
0530 int get_token_u16(void *elem, void *object, u32 offset);
0531 int get_token_comp_format(void *elem, void *object, u32 offset);
0532 int get_token_dai_type(void *elem, void *object, u32 offset);
0533 int get_token_uuid(void *elem, void *object, u32 offset);
0534 int sof_update_ipc_object(struct snd_soc_component *scomp, void *object, enum sof_tokens token_id,
0535               struct snd_sof_tuple *tuples, int num_tuples,
0536               size_t object_size, int token_instance_num);
0537 u32 vol_compute_gain(u32 value, int *tlv);
0538 #endif