Lines Matching refs:r_evt
359 struct scmi_registered_event *r_evt; member
365 #define IS_HNDL_PENDING(hndl) (!(hndl)->r_evt)
426 struct scmi_registered_event *r_evt; in scmi_process_event_header() local
438 r_evt = SCMI_GET_REVT_FROM_PD(pd, pd->eh->evt_id); in scmi_process_event_header()
439 if (!r_evt) in scmi_process_event_header()
440 r_evt = ERR_PTR(-EINVAL); in scmi_process_event_header()
442 return r_evt; in scmi_process_event_header()
461 struct scmi_registered_event *r_evt) in scmi_process_event_payload() argument
480 if (IS_ERR(r_evt)) { in scmi_process_event_payload()
487 report = REVT_FILL_REPORT(r_evt, pd->eh->evt_id, pd->eh->timestamp, in scmi_process_event_payload()
489 r_evt->report, &src_id); in scmi_process_event_payload()
537 struct scmi_registered_event *r_evt; in scmi_events_dispatcher() local
550 r_evt = scmi_process_event_header(eq, pd); in scmi_events_dispatcher()
551 if (!r_evt) in scmi_events_dispatcher()
553 pd->in_flight = r_evt; in scmi_events_dispatcher()
555 r_evt = pd->in_flight; in scmi_events_dispatcher()
557 } while (scmi_process_event_payload(eq, pd, r_evt)); in scmi_events_dispatcher()
578 struct scmi_registered_event *r_evt; in scmi_notify() local
588 r_evt = SCMI_GET_REVT(ni, proto_id, evt_id); in scmi_notify()
589 if (!r_evt) in scmi_notify()
592 if (len > r_evt->evt->max_payld_sz) { in scmi_notify()
596 if (kfifo_avail(&r_evt->proto->equeue.kfifo) < sizeof(eh) + len) { in scmi_notify()
611 kfifo_in(&r_evt->proto->equeue.kfifo, &eh, sizeof(eh)); in scmi_notify()
612 kfifo_in(&r_evt->proto->equeue.kfifo, buf, len); in scmi_notify()
625 queue_work(r_evt->proto->equeue.wq, in scmi_notify()
626 &r_evt->proto->equeue.notify_work); in scmi_notify()
785 struct scmi_registered_event *r_evt; in scmi_register_protocol_events() local
787 r_evt = devm_kzalloc(ni->handle->dev, sizeof(*r_evt), in scmi_register_protocol_events()
789 if (!r_evt) in scmi_register_protocol_events()
791 r_evt->proto = pd; in scmi_register_protocol_events()
792 r_evt->evt = evt; in scmi_register_protocol_events()
794 r_evt->sources = devm_kcalloc(ni->handle->dev, num_sources, in scmi_register_protocol_events()
796 if (!r_evt->sources) in scmi_register_protocol_events()
798 r_evt->num_sources = num_sources; in scmi_register_protocol_events()
799 mutex_init(&r_evt->sources_mtx); in scmi_register_protocol_events()
801 r_evt->report = devm_kzalloc(ni->handle->dev, in scmi_register_protocol_events()
803 if (!r_evt->report) in scmi_register_protocol_events()
806 pd->registered_events[i] = r_evt; in scmi_register_protocol_events()
810 MAKE_ALL_SRCS_KEY(r_evt->proto->id, r_evt->evt->id)); in scmi_register_protocol_events()
896 struct scmi_registered_event *r_evt; in scmi_bind_event_handler() local
898 r_evt = SCMI_GET_REVT(ni, KEY_XTRACT_PROTO_ID(hndl->key), in scmi_bind_event_handler()
900 if (!r_evt) in scmi_bind_event_handler()
905 hndl->r_evt = r_evt; in scmi_bind_event_handler()
906 mutex_lock(&r_evt->proto->registered_mtx); in scmi_bind_event_handler()
907 hash_add(r_evt->proto->registered_events_handlers, in scmi_bind_event_handler()
909 mutex_unlock(&r_evt->proto->registered_mtx); in scmi_bind_event_handler()
1014 struct scmi_registered_event *r_evt; in __scmi_event_handler_get_ops() local
1017 r_evt = SCMI_GET_REVT(ni, KEY_XTRACT_PROTO_ID(evt_key), in __scmi_event_handler_get_ops()
1022 if (r_evt) { in __scmi_event_handler_get_ops()
1023 mutex_lock(&r_evt->proto->registered_mtx); in __scmi_event_handler_get_ops()
1024 hndl = KEY_FIND(r_evt->proto->registered_events_handlers, in __scmi_event_handler_get_ops()
1028 mutex_unlock(&r_evt->proto->registered_mtx); in __scmi_event_handler_get_ops()
1081 struct scmi_registered_event *r_evt; in scmi_get_active_handler() local
1084 r_evt = SCMI_GET_REVT(ni, KEY_XTRACT_PROTO_ID(evt_key), in scmi_get_active_handler()
1086 if (r_evt) { in scmi_get_active_handler()
1087 mutex_lock(&r_evt->proto->registered_mtx); in scmi_get_active_handler()
1088 hndl = KEY_FIND(r_evt->proto->registered_events_handlers, in scmi_get_active_handler()
1092 mutex_unlock(&r_evt->proto->registered_mtx); in scmi_get_active_handler()
1111 static inline int __scmi_enable_evt(struct scmi_registered_event *r_evt, in __scmi_enable_evt() argument
1120 num_sources = r_evt->num_sources; in __scmi_enable_evt()
1121 } else if (src_id < r_evt->num_sources) { in __scmi_enable_evt()
1127 mutex_lock(&r_evt->sources_mtx); in __scmi_enable_evt()
1132 sid = &r_evt->sources[src_id]; in __scmi_enable_evt()
1134 ret = REVT_NOTIFY_ENABLE(r_evt, r_evt->evt->id, in __scmi_enable_evt()
1145 sid = &r_evt->sources[src_id]; in __scmi_enable_evt()
1147 REVT_NOTIFY_DISABLE(r_evt, in __scmi_enable_evt()
1148 r_evt->evt->id, src_id); in __scmi_enable_evt()
1152 mutex_unlock(&r_evt->sources_mtx); in __scmi_enable_evt()
1162 ret = __scmi_enable_evt(hndl->r_evt, in scmi_enable_events()
1176 ret = __scmi_enable_evt(hndl->r_evt, in scmi_disable_events()
1210 struct scmi_registered_event *r_evt = hndl->r_evt; in scmi_put_handler() local
1213 if (r_evt) in scmi_put_handler()
1214 mutex_lock(&r_evt->proto->registered_mtx); in scmi_put_handler()
1218 if (r_evt) in scmi_put_handler()
1219 mutex_unlock(&r_evt->proto->registered_mtx); in scmi_put_handler()
1226 struct scmi_registered_event *r_evt = hndl->r_evt; in scmi_put_active_handler() local
1228 mutex_lock(&r_evt->proto->registered_mtx); in scmi_put_active_handler()
1230 mutex_unlock(&r_evt->proto->registered_mtx); in scmi_put_active_handler()