Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/audio/copier/copier.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static int mic_privacy_configure(struct processing_module *mod, struct copier_da
cd->mic_priv = mic_priv_data;

ret = notifier_register(cd->mic_priv, NULL, NOTIFIER_ID_MIC_PRIVACY_STATE_CHANGE,
mic_privacy_event, 0);
mic_privacy_event);

if (ret != 0)
mod_free(mod, mic_priv_data);
Expand Down
6 changes: 2 additions & 4 deletions src/audio/dai-legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ int dai_assign_group(struct dai_data *dd, struct comp_dev *dev, uint32_t group_i
group_id, dd->group->num_dais);

/* Register for the atomic trigger event */
notifier_register(dev, dd->group, NOTIFIER_ID_DAI_TRIGGER,
dai_atomic_trigger, 0);
notifier_register(dev, dd->group, NOTIFIER_ID_DAI_TRIGGER, dai_atomic_trigger);

return 0;
}
Expand Down Expand Up @@ -635,8 +634,7 @@ int dai_common_config_prepare(struct dai_data *dd, struct comp_dev *dev)
dd->chan->index);

/* setup callback */
notifier_register(dev, dd->chan, NOTIFIER_ID_DMA_COPY,
dai_dma_cb, 0);
notifier_register(dev, dd->chan, NOTIFIER_ID_DMA_COPY, dai_dma_cb);

return 0;
}
Expand Down
3 changes: 1 addition & 2 deletions src/audio/dai-zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ __cold int dai_assign_group(struct dai_data *dd, struct comp_dev *dev, uint32_t
group_id, dd->group->num_dais);

/* Register for the atomic trigger event */
notifier_register(dev, dd->group, NOTIFIER_ID_DAI_TRIGGER,
dai_atomic_trigger, 0);
notifier_register(dev, dd->group, NOTIFIER_ID_DAI_TRIGGER, dai_atomic_trigger);

return 0;
}
Expand Down
3 changes: 1 addition & 2 deletions src/audio/host-legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -876,8 +876,7 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev,

if (err >= 0)
/* set up callback */
notifier_register(dev, hd->chan, NOTIFIER_ID_DMA_COPY,
cb ? : host_dma_cb, 0);
notifier_register(dev, hd->chan, NOTIFIER_ID_DMA_COPY, cb ? : host_dma_cb);

return err;
}
Expand Down
3 changes: 1 addition & 2 deletions src/audio/kpb.c
Original file line number Diff line number Diff line change
Expand Up @@ -938,8 +938,7 @@ static int kpb_prepare(struct comp_dev *dev)
kpb_ams_kpd_notification);
#else
/* Register KPB for notification *on the current core* */
ret = notifier_register(dev, NULL, NOTIFIER_ID_KPB_CLIENT_EVT,
kpb_event_handler, 0);
ret = notifier_register(dev, NULL, NOTIFIER_ID_KPB_CLIENT_EVT, kpb_event_handler);
#endif /* CONFIG_AMS */
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/drivers/dw/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ static struct dma_chan_data *dw_dma_channel_get(struct dma *dma,
atomic_add(&dma->num_channels_busy, 1);
#if !CONFIG_DMA_HW_LLI
notifier_register(&dma->chan[i], &dma->chan[i],
NOTIFIER_ID_DMA_IRQ, dw_dma_chan_reload_lli_cb, 0);
NOTIFIER_ID_DMA_IRQ, dw_dma_chan_reload_lli_cb);
#endif

/* return channel */
Expand Down
6 changes: 1 addition & 5 deletions src/include/sof/lib/notifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
#define NOTIFIER_TARGET_CORE_LOCAL NOTIFIER_TARGET_CORE_MASK(cpu_get_id())
#define NOTIFIER_TARGET_CORE_ALL_MASK 0xFFFFFFFF

/** \brief Notifier flags. */
#define NOTIFIER_FLAG_AGGREGATE BIT(0)

enum notify_id {
NOTIFIER_ID_CPU_FREQ = 0, /* struct clock_notify_data * */
NOTIFIER_ID_SSP_FREQ, /* struct clock_notify_data * */
Expand Down Expand Up @@ -71,10 +68,9 @@ typedef void (*notifier_callback_t)(void *receiver_data, enum notify_id event_ty
* some specific notifier_event() calls when not NULL.
* @param event_type list of callbacks to be added to
* @param callback callback function
* @param flags see NOTIFIER_FLAG_* above
*/
int notifier_register(void *receiver_data, void *caller_id_filter, enum notify_id event_type,
notifier_callback_t callback, uint32_t flags);
notifier_callback_t callback);

/** Unregister all callbacks matching that arguments tuple. NULL acts
* as a wildcard.
Expand Down
16 changes: 2 additions & 14 deletions src/lib/notifier.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ struct callback_handle {
};

int notifier_register(void *receiver, void *caller, enum notify_id type,
void (*cb)(void *arg, enum notify_id type, void *data),
uint32_t flags)
void (*cb)(void *arg, enum notify_id type, void *data))
{
struct notify *notify = *arch_notify_get();
struct callback_handle *handle;
Expand All @@ -50,18 +49,7 @@ int notifier_register(void *receiver, void *caller, enum notify_id type,

key = k_spin_lock(&notify->lock);

/* Find already registered event of this type */
if (flags & NOTIFIER_FLAG_AGGREGATE &&
!list_is_empty(&notify->list[type])) {
handle = container_of((&notify->list[type])->next,
struct callback_handle, list);
handle->num_registrations++;

goto out;
}

handle = rzalloc(SOF_MEM_FLAG_USER,
sizeof(*handle));
handle = rzalloc(SOF_MEM_FLAG_USER, sizeof(*handle));

if (!handle) {
tr_err(&nt_tr, "callback handle allocation failed.");
Expand Down
3 changes: 1 addition & 2 deletions src/schedule/dma_single_chan_domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,7 @@ static int dma_single_chan_domain_register(struct ll_schedule_domain *domain,

/* register for source change notifications */
if (register_needed)
notifier_register(domain, NULL, NOTIFIER_ID_DMA_DOMAIN_CHANGE,
dma_domain_changed, 0);
notifier_register(domain, NULL, NOTIFIER_ID_DMA_DOMAIN_CHANGE, dma_domain_changed);

dma_domain->owner = channel->core;

Expand Down
3 changes: 1 addition & 2 deletions src/schedule/ll_schedule_xtos.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,8 +796,7 @@ int scheduler_init_ll(struct ll_schedule_domain *domain)
sch->domain = domain;

/* notification of clock changes */
notifier_register(sch, NULL, NOTIFIER_CLK_CHANGE_ID(domain->clk),
ll_scheduler_notify, 0);
notifier_register(sch, NULL, NOTIFIER_CLK_CHANGE_ID(domain->clk), ll_scheduler_notify);

scheduler_init(domain->type, &schedule_ll_ops, sch);

Expand Down
2 changes: 1 addition & 1 deletion test/cmocka/src/notifier_mocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void notifier_event(const void *caller, enum notify_id type, uint32_t core_mask,
}

int notifier_register(void *receiver, void *caller, enum notify_id type,
void (*cb)(void *arg, enum notify_id type, void *data), uint32_t flags)
void (*cb)(void *arg, enum notify_id type, void *data))
{
struct notify *notify = *arch_notify_get();
struct callback_handle *handle;
Expand Down
Loading