Skip to content

Commit dc2c3c7

Browse files
committed
audio: make comp_drivers_get() accessible from user-space
Make comp_drivers_get() usable from user-space when SOF is built with CONFIG_SOF_USERSPACE_LL. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
1 parent 239c97d commit dc2c3c7

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/audio/component.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ LOG_MODULE_REGISTER(component, CONFIG_SOF_LOG_LEVEL);
3838

3939
static APP_SYSUSER_BSS SHARED_DATA struct comp_driver_list cd;
4040

41+
#ifdef CONFIG_SOF_USERSPACE_LL
42+
struct comp_driver_list *comp_drivers_get(void)
43+
{
44+
return &cd;
45+
}
46+
#endif
47+
4148
SOF_DEFINE_REG_UUID(component);
4249

4350
DECLARE_TR_CTX(comp_tr, SOF_UUID(component_uuid), LOG_LEVEL_INFO);

src/include/sof/audio/component_ext.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,18 @@ static inline void comp_make_shared(struct comp_dev *dev)
424424
dev->is_shared = true;
425425
}
426426

427+
/**
428+
* Get the global component driver list.
429+
* @return Pointer to the component driver list.
430+
*/
431+
#ifdef CONFIG_SOF_USERSPACE_LL
432+
struct comp_driver_list *comp_drivers_get(void);
433+
#else
427434
static inline struct comp_driver_list *comp_drivers_get(void)
428435
{
429436
return sof_get()->comp_drivers;
430437
}
438+
#endif
431439

432440
#if CONFIG_IPC_MAJOR_4
433441
static inline int comp_ipc4_bind_remote(struct comp_dev *dev, struct bind_info *bind_data)

0 commit comments

Comments
 (0)