1313#include <rtos/alloc.h>
1414#include <rtos/init.h>
1515#include <sof/lib/dma.h>
16- #include <sof/lib/notifier.h>
1716#include <sof/lib/uuid.h>
1817#include <sof/ipc/topology.h>
1918#include <sof/ipc/driver.h>
@@ -902,14 +901,12 @@ static ssize_t probe_logging_hook(uint8_t *buffer, size_t length)
902901 * Extraction probe: generate format, header and copy data to probe buffer.
903902 * Injection probe: find corresponding DMA, check avail data, copy data,
904903 * update pointers and request more data from host if needed.
905- * \param[in] arg pointer (not used).
906- * \param[in] type of notify.
907- * \param[in] data pointer.
904+ * \param[in] arg pointer to buffer_id.
905+ * \param[in] cb_data pointer to buffer callback transaction data.
908906 */
909- static void probe_cb_produce (void * arg , enum notify_id type , void * data )
907+ static void probe_cb_produce (void * arg , struct buffer_cb_transact * cb_data )
910908{
911909 struct probe_pdata * _probe = probe_get ();
912- struct buffer_cb_transact * cb_data = data ;
913910 struct comp_buffer * buffer = cb_data -> buffer ;
914911 struct probe_dma_ext * dma ;
915912 uint32_t buffer_id ;
@@ -921,7 +918,7 @@ static void probe_cb_produce(void *arg, enum notify_id type, void *data)
921918 uint32_t format ;
922919 uint64_t checksum ;
923920
924- buffer_id = * (int * )arg ;
921+ buffer_id = * (uint32_t * )arg ;
925922
926923 /* search for probe point connected to this buffer */
927924 for (i = 0 ; i < CONFIG_PROBE_POINTS_MAX ; i ++ )
@@ -1068,13 +1065,11 @@ static void probe_cb_produce(void *arg, enum notify_id type, void *data)
10681065
10691066/**
10701067 * \brief Callback for buffer free, it will remove probe point.
1071- * \param[in] arg pointer (not used).
1072- * \param[in] type of notify.
1073- * \param[in] data pointer.
1068+ * \param[in] arg pointer to buffer_id.
10741069 */
1075- static void probe_cb_free (void * arg , enum notify_id type , void * data )
1070+ static void probe_cb_free (void * arg )
10761071{
1077- uint32_t buffer_id = * (int * )arg ;
1072+ uint32_t buffer_id = * (uint32_t * )arg ;
10781073 int ret ;
10791074
10801075 tr_dbg (& pr_tr , "buffer_id = %u" , buffer_id );
@@ -1315,16 +1310,13 @@ int probe_point_add(uint32_t count, const struct probe_point *probe)
13151310 probe_point_id_t * new_buf_id = & _probe -> probe_points [first_free ].buffer_id ;
13161311
13171312#if CONFIG_IPC_MAJOR_4
1318- notifier_register (& new_buf_id -> full_id , buf , NOTIFIER_ID_BUFFER_PRODUCE ,
1319- & probe_cb_produce , 0 );
1320- notifier_register (& new_buf_id -> full_id , buf , NOTIFIER_ID_BUFFER_FREE ,
1321- & probe_cb_free , 0 );
1313+ struct comp_buffer * probe_buf = buf ;
13221314#else
1323- notifier_register (& new_buf_id -> full_id , dev -> cb , NOTIFIER_ID_BUFFER_PRODUCE ,
1324- & probe_cb_produce , 0 );
1325- notifier_register (& new_buf_id -> full_id , dev -> cb , NOTIFIER_ID_BUFFER_FREE ,
1326- & probe_cb_free , 0 );
1315+ struct comp_buffer * probe_buf = (struct comp_buffer * )dev -> cb ;
13271316#endif
1317+ probe_buf -> probe_cb_produce = probe_cb_produce ;
1318+ probe_buf -> probe_cb_free = probe_cb_free ;
1319+ probe_buf -> probe_cb_arg = & new_buf_id -> full_id ;
13281320 }
13291321 }
13301322
@@ -1444,19 +1436,20 @@ int probe_point_remove(uint32_t count, const uint32_t *buffer_id)
14441436 if (dev ) {
14451437 buf = ipc4_get_buffer (dev , * buf_id );
14461438 if (buf ) {
1447- notifier_unregister (NULL , buf ,
1448- NOTIFIER_ID_BUFFER_PRODUCE );
1449- notifier_unregister (NULL , buf ,
1450- NOTIFIER_ID_BUFFER_FREE );
1439+ buf -> probe_cb_produce = NULL ;
1440+ buf -> probe_cb_free = NULL ;
1441+ buf -> probe_cb_arg = NULL ;
14511442 }
14521443 }
14531444#else
14541445 dev = ipc_get_comp_by_id (ipc_get (), buffer_id [i ]);
14551446 if (dev ) {
1456- notifier_unregister (& buf_id -> full_id , dev -> cb ,
1457- NOTIFIER_ID_BUFFER_PRODUCE );
1458- notifier_unregister (& buf_id -> full_id , dev -> cb ,
1459- NOTIFIER_ID_BUFFER_FREE );
1447+ struct comp_buffer * probe_buf =
1448+ (struct comp_buffer * )dev -> cb ;
1449+
1450+ probe_buf -> probe_cb_produce = NULL ;
1451+ probe_buf -> probe_cb_free = NULL ;
1452+ probe_buf -> probe_cb_arg = NULL ;
14601453 }
14611454#endif
14621455 _probe -> probe_points [j ].stream_tag =
0 commit comments