|
Sound Open Firmware
|
Audio component operations table. More...
#include <src/include/sof/audio/component.h>

Data Fields | |
| struct comp_dev *(* | create )(const struct comp_driver *drv, const struct comp_ipc_config *ipc_config, const void *spec) |
| Creates a new component device. | |
| void(* | free )(struct comp_dev *dev) |
| Called to delete the specified component device. | |
| int(* | params )(struct comp_dev *dev, struct sof_ipc_stream_params *params) |
| Sets component audio stream parameters. | |
| int(* | dai_get_hw_params )(struct comp_dev *dev, struct sof_ipc_stream_params *params, int dir) |
| Fetches hardware stream parameters. | |
| int(* | dai_config )(struct dai_data *dd, struct comp_dev *dev, struct ipc_config_dai *dai_config, const void *dai_spec_config) |
| Configures attached DAI. | |
| int(* | cmd )(struct comp_dev *dev, int cmd, void *data, int max_data_size) |
| Used to pass standard and bespoke commands (with optional data). | |
| int(* | trigger )(struct comp_dev *dev, int cmd) |
| Trigger, atomic - used to start/stop/pause stream operations. | |
| int(* | prepare )(struct comp_dev *dev) |
| Prepares component after params are set. | |
| int(* | reset )(struct comp_dev *dev) |
| Resets component. | |
| int(* | copy )(struct comp_dev *dev) |
| Copy and process stream data from source to sink buffers. | |
| int(* | position )(struct comp_dev *dev, struct sof_ipc_stream_posn *posn) |
| Retrieves component rendering position. | |
| int(* | get_attribute )(struct comp_dev *dev, uint32_t type, void *value) |
| Gets attribute in component. | |
| int(* | set_attribute )(struct comp_dev *dev, uint32_t type, void *value) |
| Sets attribute in component. | |
| int(* | dai_ts_config )(struct comp_dev *dev) |
| Configures timestamping in attached DAI. | |
| int(* | dai_ts_start )(struct comp_dev *dev) |
| Starts timestamping. | |
| int(* | dai_ts_stop )(struct comp_dev *dev) |
| Stops timestamping. | |
| int(* | dai_ts_get )(struct comp_dev *dev, struct timestamp_data *tsd) |
| Gets timestamp. | |
| int(* | bind )(struct comp_dev *dev, const struct bind_info *bind_data) |
| Bind, atomic - used to notify component of bind event. | |
| int(* | unbind )(struct comp_dev *dev, const struct bind_info *unbind_data) |
| Unbind, atomic - used to notify component of unbind event. | |
| int(* | get_large_config )(struct comp_dev *dev, uint32_t param_id, bool first_block, bool last_block, uint32_t *data_offset, char *data) |
| Gets large config in component. | |
| int(* | set_large_config )(struct comp_dev *dev, uint32_t param_id, bool first_block, bool last_block, uint32_t data_offset, const char *data) |
| Set large config in component. | |
| uint64_t(* | get_total_data_processed )(struct comp_dev *dev, uint32_t stream_no, bool input) |
| Returns total data processed in number of bytes. | |
Audio component operations table.
All component operations must return 0 for success, negative values for errors and 1 to stop the pipeline walk operation unless specified otherwise in the operation documentation.
Bind, atomic - used to notify component of bind event.
| [in,out] | dev | Component device. |
| [in] | bind_data | Bind info. |
Used to pass standard and bespoke commands (with optional data).
| [in,out] | dev | Component device. |
| [in] | cmd | Command. |
| [in,out] | data | Command data. |
| [in] | max_data_size | Max size of returned data acceptable by caller for 'get' commands. |
| int(* comp_ops::copy) (struct comp_dev *dev) |
Copy and process stream data from source to sink buffers.
| [in,out] | dev | Component device. |
| struct comp_dev *(* comp_ops::create) (const struct comp_driver *drv, const struct comp_ipc_config *ipc_config, const void *spec) |
Creates a new component device.
| [in] | drv | Parent component driver. |
| [in] | ipc_config | Component parameters. |
| [in] | spec | Pointer to initialization data. |
| int(* comp_ops::dai_config) (struct dai_data *dd, struct comp_dev *dev, struct ipc_config_dai *dai_config, const void *dai_spec_config) |
Configures attached DAI.
| [in,out] | dd | DAI data context. |
| [in,out] | dev | Component device. |
| [in] | dai_config | DAI configuration. |
| [in] | dai_spec_config | DAI specific configuration data. |
| int(* comp_ops::dai_get_hw_params) (struct comp_dev *dev, struct sof_ipc_stream_params *params, int dir) |
Fetches hardware stream parameters.
| [in] | dev | Component device. |
| [out] | params | Receives copy of stream parameters retrieved from DAI HW settings. |
| [in] | dir | Stream direction (enum sof_ipc_stream_direction). |
| int(* comp_ops::dai_ts_config) (struct comp_dev *dev) |
Configures timestamping in attached DAI.
| [in,out] | dev | Component device. |
| int(* comp_ops::dai_ts_get) (struct comp_dev *dev, struct timestamp_data *tsd) |
Gets timestamp.
| [in] | dev | Component device. |
| [out] | tsd | Receives timestamp data. |
| int(* comp_ops::dai_ts_start) (struct comp_dev *dev) |
Starts timestamping.
| [in,out] | dev | Component device. |
| int(* comp_ops::dai_ts_stop) (struct comp_dev *dev) |
Stops timestamping.
| [in,out] | dev | Component device. |
| void(* comp_ops::free) (struct comp_dev *dev) |
Called to delete the specified component device.
| [in,out] | dev | Component device to be deleted. |
Gets attribute in component.
| [in] | dev | Component device. |
| [in] | type | Attribute type. |
| [out] | value | Attribute value buffer. |
| int(* comp_ops::get_large_config) (struct comp_dev *dev, uint32_t param_id, bool first_block, bool last_block, uint32_t *data_offset, char *data) |
Gets large config in component.
| [in,out] | dev | Component device. |
| [in] | param_id | Parameter ID for each component. |
| [in] | first_block | First block of large block. |
| [in] | last_block | Last block of large block. |
| [in,out] | data_offset | Block offset filled by callee. |
| [out] | data | Block data buffer. |
| uint64_t(* comp_ops::get_total_data_processed) (struct comp_dev *dev, uint32_t stream_no, bool input) |
Returns total data processed in number of bytes.
| [in] | dev | Component device. |
| [in] | stream_no | Index of input/output stream. |
| [in] | input | Selects between input (true) or output (false) stream direction. |
| int(* comp_ops::params) (struct comp_dev *dev, struct sof_ipc_stream_params *params) |
Sets component audio stream parameters.
| [in,out] | dev | Component device. |
| [in,out] | params | Audio (PCM) stream parameters to be set. |
| int(* comp_ops::position) (struct comp_dev *dev, struct sof_ipc_stream_posn *posn) |
Retrieves component rendering position.
| [in] | dev | Component device. |
| [out] | posn | Receives reported position. |
| int(* comp_ops::prepare) (struct comp_dev *dev) |
Prepares component after params are set.
| [in,out] | dev | Component device. |
| int(* comp_ops::reset) (struct comp_dev *dev) |
Resets component.
| [in,out] | dev | Component device. |
Sets attribute in component.
| [in,out] | dev | Component device. |
| [in] | type | Attribute type. |
| [in] | value | Attribute value. |
| int(* comp_ops::set_large_config) (struct comp_dev *dev, uint32_t param_id, bool first_block, bool last_block, uint32_t data_offset, const char *data) |
Set large config in component.
| [in,out] | dev | Component device. |
| [in] | param_id | Parameter ID for each component. |
| [in] | first_block | First block of large block. |
| [in] | last_block | Last block of large block. |
| [in] | data_offset | Block offset in large block. |
| [in] | data | Block data payload. |
Trigger, atomic - used to start/stop/pause stream operations.
| [in,out] | dev | Component device. |
| [in] | cmd | Command, one of COMP_TRIGGER_... |
Unbind, atomic - used to notify component of unbind event.
| [in,out] | dev | Component device. |
| [in] | unbind_data | Unbind info. |