Lines Matching refs:ipm

23 	struct ipm_sedi_context *ipm = dev->data;  in set_ipm_dev_busy()  local
26 atomic_set_bit(&ipm->status, is_write ? IPM_WRITE_BUSY_BIT : IPM_READ_BUSY_BIT); in set_ipm_dev_busy()
33 struct ipm_sedi_context *ipm = dev->data; in clear_ipm_dev_busy() local
36 atomic_clear_bit(&ipm->status, is_write ? IPM_WRITE_BUSY_BIT : IPM_READ_BUSY_BIT); in clear_ipm_dev_busy()
37 if ((!atomic_test_bit(&ipm->status, IPM_WRITE_BUSY_BIT)) in clear_ipm_dev_busy()
38 && (!atomic_test_bit(&ipm->status, IPM_READ_BUSY_BIT))) { in clear_ipm_dev_busy()
47 struct ipm_sedi_context *ipm = dev->data; in ipm_event_dispose() local
53 if (ipm->rx_msg_notify_cb != NULL) { in ipm_event_dispose()
57 sedi_ipc_read_msg(device, ipm->incoming_data_buf, len); in ipm_event_dispose()
58 ipm->rx_msg_notify_cb(dev, in ipm_event_dispose()
59 ipm->rx_msg_notify_cb_data, in ipm_event_dispose()
60 drbl_in, ipm->incoming_data_buf); in ipm_event_dispose()
66 if (atomic_test_bit(&ipm->status, IPM_WRITE_IN_PROC_BIT)) { in ipm_event_dispose()
67 k_sem_give(&ipm->device_write_msg_sem); in ipm_event_dispose()
82 struct ipm_sedi_context *ipm = dev->data; in ipm_init() local
85 k_sem_init(&ipm->device_write_msg_sem, 0, 1); in ipm_init()
86 k_mutex_init(&ipm->device_write_lock); in ipm_init()
87 ipm->status = 0; in ipm_init()
90 atomic_set_bit(&ipm->status, IPM_PEER_READY_BIT); in ipm_init()
122 struct ipm_sedi_context *ipm = dev->data; in ipm_sedi_send() local
142 k_mutex_lock(&ipm->device_write_lock, K_FOREVER); in ipm_sedi_send()
145 if (!atomic_test_bit(&ipm->status, IPM_PEER_READY_BIT)) { in ipm_sedi_send()
162 atomic_set_bit(&ipm->status, IPM_WRITE_IN_PROC_BIT); in ipm_sedi_send()
173 ret = k_sem_take(&ipm->device_write_msg_sem, K_MSEC(IPM_TIMEOUT_MS)); in ipm_sedi_send()
180 atomic_clear_bit(&ipm->status, IPM_WRITE_IN_PROC_BIT); in ipm_sedi_send()
184 k_mutex_unlock(&ipm->device_write_lock); in ipm_sedi_send()
197 struct ipm_sedi_context *ipm = dev->data; in ipm_sedi_register_callback() local
204 if (ipm->rx_msg_notify_cb == NULL) { in ipm_sedi_register_callback()
205 ipm->rx_msg_notify_cb = cb; in ipm_sedi_register_callback()
206 ipm->rx_msg_notify_cb_data = user_data; in ipm_sedi_register_callback()
263 static DEVICE_API(ipm, ipm_funcs) = {
287 PM_DEVICE_DT_DEFINE(DT_NODELABEL(ipm##n), ipm_power_ctrl); \
290 PM_DEVICE_DT_GET(DT_NODELABEL(ipm##n)), \