Sound Open Firmware
Loading...
Searching...
No Matches
component_ext.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 *
3 * Copyright(c) 2016 Intel Corporation. All rights reserved.
4 *
5 * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
6 * Keyon Jie <yang.jie@linux.intel.com>
7 */
8
16#ifndef __SOF_AUDIO_COMPONENT_INT_H__
17#define __SOF_AUDIO_COMPONENT_INT_H__
18
19#include <sof/audio/component.h>
20#include <ipc/topology.h>
21/* TODO: the cross-core helpers below send IDC messages, which is kernel only */
22#include <rtos/idc.h>
23#include <sof/lib/dai.h>
25
32 struct list_item list;
33};
34
40#define comp_buffer_list(comp, dir) \
41 ((dir) == PPL_DIR_DOWNSTREAM ? &(comp)->bsink_list : \
42 &(comp)->bsource_list)
43
44#if CONFIG_IPC_MAJOR_3
50struct comp_dev *comp_new(struct sof_ipc_comp *comp);
51#elif CONFIG_IPC_MAJOR_4
57struct comp_dev *comp_new_ipc4(const struct ipc4_module_init_instance *module_init);
58#endif
59
64static inline void comp_free(struct comp_dev *dev)
65{
66 const struct comp_driver *drv = dev->drv;
67
68 assert(drv->ops.free);
69
70 /*
71 * In DP case this will run in DP thread context, so the task can only
72 * be freed after this.
73 */
74 drv->ops.free(dev);
75}
76
83static inline int comp_params_remote(struct comp_dev *dev,
84 struct sof_ipc_stream_params *params)
85{
87 dev->ipc_config.core, sizeof(*params), params, };
88
89 return idc_send_msg(&msg, IDC_BLOCKING);
90}
91
98static inline int comp_params(struct comp_dev *dev,
99 struct sof_ipc_stream_params *params)
100{
101 int ret = 0;
102
103 if (dev->is_shared && !cpu_is_me(dev->ipc_config.core)) {
104 ret = comp_params_remote(dev, params);
105 } else {
106 if (dev->drv->ops.params) {
107 ret = dev->drv->ops.params(dev, params);
108 } else {
109 /* not defined, run the default handler */
110 ret = comp_verify_params(dev, 0, params);
111
112/* BugLink: https://github.com/zephyrproject-rtos/zephyr/issues/43786
113 * TODO: Remove this once the bug gets fixed.
114 */
115#ifndef __ZEPHYR__
116 if (ret < 0)
117 comp_err(dev, "pcm params verification failed");
118#endif
119 }
120 }
121
122 return ret;
123}
124
132static inline int comp_dai_get_hw_params(struct comp_dev *dev,
133 struct sof_ipc_stream_params *params,
134 int dir)
135{
136 if (dev->drv->ops.dai_get_hw_params)
137 return dev->drv->ops.dai_get_hw_params(dev, params, dir);
138
139 return -EINVAL;
140}
141
142#if CONFIG_IPC_MAJOR_3
151static inline int comp_cmd(struct comp_dev *dev, int cmd, void *data,
152 int max_data_size)
153{
154 LOG_MODULE_DECLARE(component, CONFIG_SOF_LOG_LEVEL);
155
156 struct sof_ipc_ctrl_data *cdata = ASSUME_ALIGNED(data, 4);
157
158 if (cmd == COMP_CMD_SET_DATA &&
159 (cdata->data->magic != SOF_ABI_MAGIC ||
161 comp_err(dev, "comp_cmd(): invalid version, data->magic = %u, data->abi = %u",
162 cdata->data->magic, cdata->data->abi);
163 return -EINVAL;
164 }
165
166 if (dev->drv->ops.cmd)
167 return dev->drv->ops.cmd(dev, cmd, data, max_data_size);
168
169 return -EINVAL;
170}
171#endif
172
179static inline int comp_trigger_remote(struct comp_dev *dev, int cmd)
180{
181 struct idc_msg msg = { IDC_MSG_TRIGGER,
182 IDC_MSG_TRIGGER_EXT(dev->ipc_config.id), dev->ipc_config.core, sizeof(cmd),
183 &cmd, };
184
185 return idc_send_msg(&msg, IDC_BLOCKING);
186}
187
194static inline int comp_trigger_local(struct comp_dev *dev, int cmd)
195{
196 int ret;
197
198 ret = dev->drv->ops.trigger(dev, cmd);
199 if (ret)
200 return ret;
201
202 /* start a thread in case of shared component or DP scheduling */
203 if (dev->task) {
204 /* schedule or cancel task */
205 switch (cmd) {
207 ret = schedule_task(dev->task, 0, dev->period);
208 break;
213 break;
214 }
215 }
216
217 return ret;
218}
219
226static inline int comp_trigger(struct comp_dev *dev, int cmd)
227{
228 int ret;
229 assert(dev->drv->ops.trigger);
230
231 if (dev->is_shared && !cpu_is_me(dev->ipc_config.core))
232 ret = comp_trigger_remote(dev, cmd);
233 else
234 ret = comp_trigger_local(dev, cmd);
235
236 return ret;
237}
238
244static inline int comp_prepare_remote(struct comp_dev *dev)
245{
246 struct idc_msg msg = { IDC_MSG_PREPARE,
248
249 return idc_send_msg(&msg, IDC_BLOCKING);
250}
251
257static inline int comp_prepare(struct comp_dev *dev)
258{
259 if (dev->drv->ops.prepare)
260 return (dev->is_shared && !cpu_is_me(dev->ipc_config.core)) ?
261 comp_prepare_remote(dev) : dev->drv->ops.prepare(dev);
262
263 return 0;
264}
265
271int comp_copy(struct comp_dev *dev);
272
273#if CONFIG_IPC_MAJOR_4
278 uint32_t type;
279 void *value;
280};
281
289static inline int comp_ipc4_get_attribute_remote(struct comp_dev *dev, uint32_t type,
290 void *value)
291{
292 struct ipc4_base_module_cfg *base_cfg;
293 struct get_attribute_remote_payload payload = {};
294 struct idc_msg msg = { IDC_MSG_GET_ATTRIBUTE,
296 sizeof(payload), &payload};
297 int ret;
298
299 /* Only COMP_ATTR_BASE_CONFIG is supported for remote access */
301 return -EINVAL;
302
303 base_cfg = rzalloc(SOF_MEM_FLAG_USER | SOF_MEM_FLAG_COHERENT, sizeof(*base_cfg));
304 if (!base_cfg)
305 return -ENOMEM;
306
307 payload.type = type;
308 payload.value = base_cfg;
309
310 ret = idc_send_msg(&msg, IDC_BLOCKING);
311
312 if (ret == 0)
313 memcpy_s(value, sizeof(struct ipc4_base_module_cfg),
314 base_cfg, sizeof(struct ipc4_base_module_cfg));
315
316 rfree(base_cfg);
317 return ret;
318}
319#endif /* CONFIG_IPC_MAJOR_4 */
320
328static inline int comp_get_attribute(struct comp_dev *dev, uint32_t type,
329 void *value)
330{
331#if CONFIG_IPC_MAJOR_4
332 if (dev->drv->ops.get_attribute)
333 return cpu_is_me(dev->ipc_config.core) ?
334 dev->drv->ops.get_attribute(dev, type, value) :
336
337 return 0;
338#else
339 if (dev->drv->ops.get_attribute)
340 return dev->drv->ops.get_attribute(dev, type, value);
341
342 return 0;
343#endif
344}
345
353static inline int comp_set_attribute(struct comp_dev *dev, uint32_t type,
354 void *value)
355{
356 if (dev->drv->ops.set_attribute)
357 return dev->drv->ops.set_attribute(dev, type, value);
358
359 return 0;
360}
361
367static inline int comp_reset_remote(struct comp_dev *dev)
368{
369 struct idc_msg msg = { IDC_MSG_RESET,
371
372 return idc_send_msg(&msg, IDC_BLOCKING);
373}
374
380static inline int comp_reset(struct comp_dev *dev)
381{
382 if (dev->drv->ops.reset)
383 return (dev->is_shared && !cpu_is_me(dev->ipc_config.core)) ?
384 comp_reset_remote(dev) : dev->drv->ops.reset(dev);
385
386 return 0;
387}
388
389#if CONFIG_IPC_MAJOR_3
397static inline int comp_dai_config(struct comp_dev *dev, struct ipc_config_dai *config,
398 const void *spec_config)
399{
400 struct dai_data *dd = comp_get_drvdata(dev);
401
402 if (dev->drv->ops.dai_config)
403 return dev->drv->ops.dai_config(dd, dev, config, spec_config);
404
405 return 0;
406}
407#elif CONFIG_IPC_MAJOR_4
416static inline int comp_dai_config(struct dai_data *dd, struct comp_dev *dev,
417 struct ipc_config_dai *config, const void *spec_config)
418{
419 return dai_config(dd, dev, config, spec_config);
420}
421#else
422#error Unknown IPC major version
423#endif
424
431static inline int comp_position(struct comp_dev *dev,
432 struct sof_ipc_stream_posn *posn)
433{
434 if (dev->drv->ops.position)
435 return dev->drv->ops.position(dev, posn);
436
437 return 0;
438}
439
447void sys_comp_init(struct sof *sof);
448
455static inline int comp_is_single_pipeline(struct comp_dev *current,
456 struct comp_dev *previous)
457{
458 return dev_comp_pipe_id(current) == dev_comp_pipe_id(previous);
459}
460
466static inline int comp_is_active(struct comp_dev *current)
467{
468 return current->state == COMP_STATE_ACTIVE;
469}
470
476static inline int comp_get_requested_state(int cmd)
477{
478 int state = COMP_STATE_INIT;
479
480 switch (cmd) {
483 state = COMP_STATE_ACTIVE;
484 break;
487 state = COMP_STATE_PREPARE;
488 break;
490 state = COMP_STATE_PAUSED;
491 break;
494 state = COMP_STATE_READY;
495 break;
498 state = COMP_STATE_PRE_ACTIVE;
499 break;
500 }
501
502 return state;
503}
504
510static inline int comp_get_endpoint_type(struct comp_dev *dev)
511{
512 switch (dev_comp_type(dev)) {
513 case SOF_COMP_HOST:
514 return COMP_ENDPOINT_HOST;
515 case SOF_COMP_DAI:
516 return COMP_ENDPOINT_DAI;
517 default:
518 return COMP_ENDPOINT_NODE;
519 }
520}
521
527static inline bool comp_is_scheduling_source(struct comp_dev *dev)
528{
529 return dev == dev->pipeline->sched_comp;
530}
531
536static inline void comp_make_shared(struct comp_dev *dev)
537{
538 dev->is_shared = true;
539}
540
545#ifdef CONFIG_SOF_USERSPACE_LL
547#else
548static inline struct comp_driver_list *comp_drivers_get(void)
549{
550 return sof_get()->comp_drivers;
551}
552#endif
553
554#if CONFIG_IPC_MAJOR_4
561static inline int comp_ipc4_bind_remote(struct comp_dev *dev, const struct bind_info *bind_data)
562{
563 struct idc_msg msg = { IDC_MSG_BIND,
565 sizeof(*bind_data), bind_data};
566
567 return idc_send_msg(&msg, IDC_BLOCKING);
568}
569#endif
570
577static inline int comp_bind(struct comp_dev *dev, const struct bind_info *bind_data)
578{
579#if CONFIG_IPC_MAJOR_4
580 if (dev->drv->ops.bind)
581 return cpu_is_me(dev->ipc_config.core) ?
582 dev->drv->ops.bind(dev, bind_data) : comp_ipc4_bind_remote(dev, bind_data);
583
584 return 0;
585#else
586 int ret = 0;
587
588 if (dev->drv->ops.bind)
589 ret = dev->drv->ops.bind(dev, bind_data);
590
591 return ret;
592#endif
593}
594
595#if CONFIG_IPC_MAJOR_4
602static inline int comp_ipc4_unbind_remote(struct comp_dev *dev, const struct bind_info *unbind_data)
603{
604 struct idc_msg msg = { IDC_MSG_UNBIND,
606 sizeof(*unbind_data), unbind_data};
607
608 return idc_send_msg(&msg, IDC_BLOCKING);
609}
610#endif
611
618static inline int comp_unbind(struct comp_dev *dev, const struct bind_info *unbind_data)
619{
620#if CONFIG_IPC_MAJOR_4
621 if (dev->drv->ops.unbind)
622 return cpu_is_me(dev->ipc_config.core) ?
623 dev->drv->ops.unbind(dev, unbind_data) :
624 comp_ipc4_unbind_remote(dev, unbind_data);
625
626 return 0;
627#else
628 int ret = 0;
629
630 if (dev->drv->ops.unbind)
631 ret = dev->drv->ops.unbind(dev, unbind_data);
632
633 return ret;
634#endif
635}
636
644static inline uint64_t comp_get_total_data_processed(struct comp_dev *dev, uint32_t stream_no,
645 bool input)
646{
647 uint64_t ret = 0;
648
650 ret = dev->drv->ops.get_total_data_processed(dev, stream_no, input);
651
652 return ret;
653}
654
661static inline bool comp_same_dir(struct comp_dev *comp, enum sof_ipc_stream_direction dir)
662{
663 int end_type = comp_get_endpoint_type(comp->pipeline->sink_comp);
664
665 if (dir == SOF_IPC_STREAM_PLAYBACK && end_type != COMP_ENDPOINT_DAI)
666 return false;
667 if (dir == SOF_IPC_STREAM_CAPTURE && end_type != COMP_ENDPOINT_HOST)
668 return false;
669 return true;
670}
671
674#endif /* __SOF_AUDIO_COMPONENT_INT_H__ */
#define SOF_ABI_MAGIC
SOF ABI magic number "SOF\0".
Definition abi.h:63
#define SOF_ABI_VERSION_INCOMPATIBLE(sof_ver, client_ver)
Definition abi.h:55
#define SOF_ABI_VERSION
Definition abi.h:60
#define ASSUME_ALIGNED(x, a)
Definition common.h:250
Component API definition.
static bool cpu_is_me(int id)
Definition cpu.h:103
int module_init(struct processing_module *mod)
#define COMP_STATE_ACTIVE
Component active.
Definition component.h:57
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.
Definition component_ext.h:455
static int comp_trigger(struct comp_dev *dev, int cmd)
Dispatch trigger command to component (local or remote).
Definition component_ext.h:226
static enum sof_comp_type dev_comp_type(const struct comp_dev *dev)
Retrieves component type from device.
Definition component.h:791
static int comp_params(struct comp_dev *dev, struct sof_ipc_stream_params *params)
Configure audio stream parameters for component device.
Definition component_ext.h:98
static int comp_prepare_remote(struct comp_dev *dev)
Run prepare command on remote core for target component.
Definition component_ext.h:244
#define comp_err(comp_p, __e,...)
Trace error message from component device.
Definition component.h:217
static int comp_get_endpoint_type(struct comp_dev *dev)
Returns endpoint type of given component.
Definition component_ext.h:510
static int comp_trigger_remote(struct comp_dev *dev, int cmd)
Run trigger command on remote core for target component.
Definition component_ext.h:179
#define COMP_STATE_READY
Component inactive, but ready.
Definition component.h:53
static int comp_ipc4_unbind_remote(struct comp_dev *dev, const struct bind_info *unbind_data)
Send unbind message to component on remote core (IPC4).
Definition component_ext.h:602
static int comp_dai_get_hw_params(struct comp_dev *dev, struct sof_ipc_stream_params *params, int dir)
Retrieve DAI hardware parameters from component device.
Definition component_ext.h:132
#define COMP_STATE_PREPARE
Component prepared.
Definition component.h:55
static int comp_reset_remote(struct comp_dev *dev)
Run reset command on remote core for target component.
Definition component_ext.h:367
#define COMP_CMD_SET_DATA
Set data to component.
Definition component.h:97
int comp_verify_params(struct comp_dev *dev, uint32_t flag, struct sof_ipc_stream_params *params)
Verify and set component audio parameters.
static uint32_t dev_comp_pipe_id(const struct comp_dev *dev)
Retrieves Component pipeline ID from device.
Definition component.h:781
static int comp_cmd(struct comp_dev *dev, int cmd, void *data, int max_data_size)
Dispatch IPC3 command to component device.
Definition component_ext.h:151
static void comp_make_shared(struct comp_dev *dev)
Called to mark component as shared between cores.
Definition component_ext.h:536
static int comp_ipc4_get_attribute_remote(struct comp_dev *dev, uint32_t type, void *value)
Retrieve component attribute from a remote core (IPC4).
Definition component_ext.h:289
static int comp_is_active(struct comp_dev *current)
Checks if component device is active.
Definition component_ext.h:466
static int comp_prepare(struct comp_dev *dev)
Prepare component device for streaming (local or remote).
Definition component_ext.h:257
static bool comp_same_dir(struct comp_dev *comp, enum sof_ipc_stream_direction dir)
Returns true if the component's pipeline matches the specified direction.
Definition component_ext.h:661
#define comp_get_drvdata(c)
Retrieves driver private data from component device.
Definition component.h:876
static int comp_position(struct comp_dev *dev, struct sof_ipc_stream_posn *posn)
Retrieve stream position from component.
Definition component_ext.h:431
static bool comp_is_scheduling_source(struct comp_dev *dev)
Called to check whether component schedules its pipeline.
Definition component_ext.h:527
int comp_copy(struct comp_dev *dev)
Process and copy audio data through component.
static void comp_free(struct comp_dev *dev)
Free component device via driver ops.
Definition component_ext.h:64
static struct comp_driver_list * comp_drivers_get(void)
Get the global component driver list.
Definition component_ext.h:548
static int comp_unbind(struct comp_dev *dev, const struct bind_info *unbind_data)
Unbind component from downstream/upstream component or buffer.
Definition component_ext.h:618
static int comp_params_remote(struct comp_dev *dev, struct sof_ipc_stream_params *params)
Parameter initialization for component on remote core.
Definition component_ext.h:83
static uint64_t comp_get_total_data_processed(struct comp_dev *dev, uint32_t stream_no, bool input)
Retrieve total data processed by component.
Definition component_ext.h:644
void sys_comp_init(struct sof *sof)
Allocates and initializes audio component list.
#define COMP_ATTR_BASE_CONFIG
Component base config.
Definition component.h:123
static int comp_set_attribute(struct comp_dev *dev, uint32_t type, void *value)
Set component attribute.
Definition component_ext.h:353
static int comp_get_requested_state(int cmd)
Returns component state based on requested command.
Definition component_ext.h:476
struct comp_dev * comp_new(struct sof_ipc_comp *comp)
Instantiate a new component device from IPC3 descriptor.
static int comp_bind(struct comp_dev *dev, const struct bind_info *bind_data)
Bind component to downstream/upstream component or buffer.
Definition component_ext.h:577
static int comp_ipc4_bind_remote(struct comp_dev *dev, const struct bind_info *bind_data)
Send bind message to component on remote core (IPC4).
Definition component_ext.h:561
#define COMP_STATE_INIT
Component being initialised.
Definition component.h:52
static int comp_get_attribute(struct comp_dev *dev, uint32_t type, void *value)
Get component attribute.
Definition component_ext.h:328
static int comp_reset(struct comp_dev *dev)
Reset component and free runtime resources (local or remote).
Definition component_ext.h:380
static int comp_dai_config(struct comp_dev *dev, struct ipc_config_dai *config, const void *spec_config)
Configure DAI component.
Definition component_ext.h:397
static int comp_trigger_local(struct comp_dev *dev, int cmd)
Run trigger command locally on current core for target component.
Definition component_ext.h:194
#define COMP_STATE_PRE_ACTIVE
Component after early initialisation.
Definition component.h:58
#define COMP_STATE_PAUSED
Component paused.
Definition component.h:56
@ COMP_TRIGGER_STOP
Stop component stream.
Definition component.h:73
@ COMP_TRIGGER_XRUN
XRUN component.
Definition component.h:79
@ COMP_TRIGGER_PAUSE
Pause the component stream.
Definition component.h:75
@ COMP_TRIGGER_RESET
Reset component.
Definition component.h:77
@ COMP_TRIGGER_PREPARE
Prepare component.
Definition component.h:78
@ COMP_TRIGGER_START
Start component stream.
Definition component.h:74
@ COMP_TRIGGER_PRE_START
Prepare to start component stream.
Definition component.h:80
@ COMP_TRIGGER_RELEASE
Release paused component stream.
Definition component.h:76
@ COMP_TRIGGER_PRE_RELEASE
Prepare to release paused component stream.
Definition component.h:81
@ COMP_ENDPOINT_HOST
Connected to host dma.
Definition component.h:255
@ COMP_ENDPOINT_DAI
Connected to dai dma.
Definition component.h:256
@ COMP_ENDPOINT_NODE
No dma connection.
Definition component.h:257
void * rzalloc(uint32_t flags, size_t bytes)
Allocate zero-initialized memory block with default natural alignment.
#define SOF_MEM_FLAG_USER
Base allocation flag denoting memory allocated for user-space threads and module execution.
Definition alloc.h:69
void rfree(void *ptr)
Free memory block allocated by SOF RTOS allocators.
#define SOF_MEM_FLAG_COHERENT
Allocate uncached / coherent memory address.
Definition alloc.h:53
int dai_config(struct dai_data *dd, struct comp_dev *dev, struct ipc_config_dai *common_cfg, const void *spec_cfg)
Configure DAI physical interface.
static int schedule_task(struct task *task, uint64_t start, uint64_t period)
Schedule a task for execution with start delay and period.
Definition schedule.h:306
IDC header file.
#define IDC_MSG_GET_ATTRIBUTE
Definition idc.h:105
#define IDC_MSG_TRIGGER
IDC component trigger message.
Definition idc.h:82
#define IDC_MSG_PARAMS
IDC component params message.
Definition idc.h:74
int idc_send_msg(struct idc_msg *msg, uint32_t mode)
#define IDC_EXTENSION(x)
Definition idc.h:54
#define IDC_MSG_UNBIND
Definition idc.h:104
#define IDC_BLOCKING
IDC send blocking flag.
Definition idc.h:26
#define IDC_MSG_BIND
Definition idc.h:103
#define IDC_MSG_TRIGGER_EXT(x)
Definition idc.h:83
#define IDC_MSG_PREPARE_EXT(x)
Definition idc.h:79
#define IDC_MSG_RESET_EXT(x)
Definition idc.h:87
#define IDC_MSG_RESET
IDC component reset message.
Definition idc.h:86
#define IDC_MSG_PARAMS_EXT(x)
Definition idc.h:75
#define IDC_MSG_PREPARE
IDC component prepare message.
Definition idc.h:78
uint8_t data[0]
Binary byte payload for raw controls.
Definition header.h:5
uint32_t type
Message type, symmetric to the incoming request.
Definition header.h:8
uint32_t value
Control integer value (gain level, mute toggle, enum index).
Definition header.h:1
sof_ipc_stream_direction
Definition stream.h:57
@ SOF_IPC_STREAM_CAPTURE
Definition stream.h:59
@ SOF_IPC_STREAM_PLAYBACK
Definition stream.h:58
@ SOF_COMP_DAI
Definition topology.h:30
@ SOF_COMP_HOST
Definition topology.h:29
#define assert(x)
Definition panic.h:19
Generic scheduler interface, scheduler operations, and task management.
struct sof * sof_get(void)
Get the global Sound Open Firmware runtime instance pointer.
static int memcpy_s(void *dest, size_t dest_size, const void *src, size_t count)
Definition string.h:38
Component module binding metadata and endpoint references.
Definition component.h:287
Audio component base device "class" used by all other component types.
Definition component.h:587
struct comp_ipc_config ipc_config
Component IPC configuration.
Definition component.h:599
bool is_shared
True if component is shared across cores.
Definition component.h:598
uint16_t state
Component state (COMP_STATE_*)
Definition component.h:589
struct task * task
Component processing task (cross-core or DP)
Definition component.h:594
const struct comp_driver * drv
Component driver.
Definition component.h:608
struct pipeline * pipeline
Parent pipeline reference.
Definition component.h:592
uint32_t period
Component processing period in microseconds.
Definition component.h:596
Holds list of registered components' drivers.
Definition component_ext.h:31
struct list_item list
list of component drivers
Definition component_ext.h:32
Audio component base driver "class".
Definition component.h:528
struct comp_ops ops
component operations
Definition component.h:534
uint32_t id
Component ID.
Definition component.h:562
uint32_t core
Core we run on.
Definition component.h:561
int(* set_attribute)(struct comp_dev *dev, uint32_t type, void *value)
Sets attribute in component.
Definition component.h:423
int(* get_attribute)(struct comp_dev *dev, uint32_t type, void *value)
Gets attribute in component.
Definition component.h:413
int(* prepare)(struct comp_dev *dev)
Prepares component after params are set.
Definition component.h:381
int(* reset)(struct comp_dev *dev)
Resets component.
Definition component.h:388
int(* params)(struct comp_dev *dev, struct sof_ipc_stream_params *params)
Sets component audio stream parameters.
Definition component.h:331
int(* bind)(struct comp_dev *dev, const struct bind_info *bind_data)
Bind, atomic - used to notify component of bind event.
Definition component.h:466
int(* dai_get_hw_params)(struct comp_dev *dev, struct sof_ipc_stream_params *params, int dir)
Fetches hardware stream parameters.
Definition component.h:341
int(* position)(struct comp_dev *dev, struct sof_ipc_stream_posn *posn)
Retrieves component rendering position.
Definition component.h:403
uint64_t(* get_total_data_processed)(struct comp_dev *dev, uint32_t stream_no, bool input)
Returns total data processed in number of bytes.
Definition component.h:515
int(* cmd)(struct comp_dev *dev, int cmd, void *data, int max_data_size)
Used to pass standard and bespoke commands (with optional data).
Definition component.h:364
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.
Definition component.h:352
int(* trigger)(struct comp_dev *dev, int cmd)
Trigger, atomic - used to start/stop/pause stream operations.
Definition component.h:374
int(* unbind)(struct comp_dev *dev, const struct bind_info *unbind_data)
Unbind, atomic - used to notify component of unbind event.
Definition component.h:474
void(* free)(struct comp_dev *dev)
Called to delete the specified component device.
Definition component.h:323
DAI runtime data.
Definition dai-zephyr.h:119
struct dma_sg_config config
Definition dai-zephyr.h:123
Remote payload for component get_attribute IPC4 message.
Definition component_ext.h:277
void * value
Pointer to attribute value storage.
Definition component_ext.h:279
uint32_t type
Attribute type (COMP_ATTR_*)
Definition component_ext.h:278
IDC message.
Definition idc.h:158
const void * payload
pointer to payload data
Definition idc.h:163
Base module configuration parameters provided upon module instantiation.
Definition base-config.h:160
Module instance creation command structure (SOF_IPC4_MOD_INIT_INSTANCE).
Definition module.h:162
Definition ipc-config.h:65
Definition list.h:16
struct comp_dev * sched_comp
Component that drives scheduling in this pipe.
Definition pipeline.h:100
struct comp_dev * sink_comp
Sink component for this pipe.
Definition pipeline.h:104
uint32_t magic
Magic number for validation.
Definition header.h:34
uint32_t abi
SOF ABI version.
Definition header.h:41
Definition topology.h:62
Generic control data.
Definition control.h:120
struct sof_abi_hdr data[0]
Definition control.h:153
uint32_t cmd
enum sof_ipc_ctrl_cmd
Definition control.h:126
Definition stream.h:71
Definition stream.h:134
General firmware context.
Definition sof.h:50
struct comp_driver_list * comp_drivers
Definition sof.h:104