Component API Ext

Location: include/sof/audio/component_ext.h

group component_api_helpers

Defines

comp_buffer_list(comp, dir)

Retrieves the component device buffer list.

Functions

struct comp_dev *comp_new(struct sof_ipc_comp *comp)

See comp_ops::new.

static void comp_free(struct comp_dev *dev)

See comp_ops::free.

static void comp_shared_commit(struct comp_dev *dev)

Commits component’s memory if it’s shared.

Parameters
  • dev: Component device.

static int comp_params_remote(struct comp_dev *dev, struct sof_ipc_stream_params *params)

Parameter init for component on other core.

Return

0 if succeeded, error code otherwise.

Parameters
  • dev: Component device.

  • params: Parameters to be set.

static int comp_params(struct comp_dev *dev, struct sof_ipc_stream_params *params)

See comp_ops::params.

static int comp_dai_get_hw_params(struct comp_dev *dev, struct sof_ipc_stream_params *params, int dir)

See comp_ops::dai_get_hw_params.

static int comp_cmd(struct comp_dev *dev, int cmd, void *data, int max_data_size)

See comp_ops::cmd.

static int comp_trigger_remote(struct comp_dev *dev, int cmd)

Runs comp_ops::trigger on the core the target component is assigned to.

static int comp_trigger(struct comp_dev *dev, int cmd)

See comp_ops::trigger.

static int comp_prepare_remote(struct comp_dev *dev)

Runs comp_ops::prepare on the target component’s core.

static int comp_prepare(struct comp_dev *dev)

See comp_ops::prepare.

static int comp_copy(struct comp_dev *dev)

See comp_ops::copy.

static int comp_get_attribute(struct comp_dev *dev, uint32_t type, void *value)

See comp_ops::get_attribute.

static int comp_set_attribute(struct comp_dev *dev, uint32_t type, void *value)

See comp_ops::set_attribute.

static int comp_reset_remote(struct comp_dev *dev)

Runs comp_ops::reset on the target component’s core.

static int comp_reset(struct comp_dev *dev)

Component reset and free runtime resources.

Return

0 if succeeded, error code otherwise.

Parameters
  • dev: Component device.

static int comp_dai_config(struct comp_dev *dev, struct ipc_config_dai *config, void *spec_config)

See comp_ops::dai_config.

static int comp_position(struct comp_dev *dev, struct sof_ipc_stream_posn *posn)

See comp_ops::position.

void sys_comp_init(struct sof *sof)

Allocates and initializes audio component list.

To be called once at boot time.

static int comp_is_single_pipeline(struct comp_dev *current, struct comp_dev *previous)

Checks if two component devices belong to the same parent pipeline.

Return

1 if children of the same pipeline, 0 otherwise.

Parameters
  • current: Component device.

  • previous: Another component device.

static int comp_is_active(struct comp_dev *current)

Checks if component device is active.

Return

1 if active, 0 otherwise.

Parameters
  • current: Component device.

static int comp_get_requested_state(int cmd)

Returns component state based on requested command.

Return

Component state.

Parameters
  • cmd: Request command.

static int comp_get_endpoint_type(struct comp_dev *dev)

Returns endpoint type of given component.

Return

Endpoint type, one of comp_endpoint_type.

Parameters
  • dev: Component device

static bool comp_is_scheduling_source(struct comp_dev *dev)

Called to check whether component schedules its pipeline.

Return

True if this is scheduling component, false otherwise.

Parameters
  • dev: Component device.

struct comp_dev *comp_make_shared(struct comp_dev *dev)

Called to reallocate component in shared memory.

Return

Pointer to reallocated component device.

Parameters
  • dev: Component device.

static struct comp_driver_list *comp_drivers_get(void)
static int comp_bind(struct comp_dev *dev, void *data)
static int comp_unbind(struct comp_dev *dev, void *data)
struct comp_driver_list
#include <component_ext.h>

Holds list of registered components’ drivers.

Public Members

struct list_item list

list of component drivers

spinlock_t lock

list lock