Commit bd31b249 authored by Cristian Marussi's avatar Cristian Marussi Committed by Sudeep Holla

firmware: arm_scmi: Add notification dispatch and delivery

Add the core SCMI notifications dispatch and delivery support logic
which is able to dispatch well-known received events from the Rx
interrupt handler to the dedicated deferred worker. From there, it will
deliver the events to the registered users' callbacks.

Dispatch and delivery support is just added here, still not enabled.

Link: https://lore.kernel.org/r/20200701155348.52864-4-cristian.marussi@arm.comReviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarCristian Marussi <cristian.marussi@arm.com>
Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
parent e7c215f3
This diff is collapsed.
...@@ -35,6 +35,11 @@ struct scmi_event { ...@@ -35,6 +35,11 @@ struct scmi_event {
* @set_notify_enabled: Enable/disable the required evt_id/src_id notifications * @set_notify_enabled: Enable/disable the required evt_id/src_id notifications
* using the proper custom protocol commands. * using the proper custom protocol commands.
* Return 0 on Success * Return 0 on Success
* @fill_custom_report: fills a custom event report from the provided
* event message payld identifying the event
* specific src_id.
* Return NULL on failure otherwise @report now fully
* populated
* *
* Context: Helpers described in &struct scmi_event_ops are called only in * Context: Helpers described in &struct scmi_event_ops are called only in
* process context. * process context.
...@@ -42,6 +47,9 @@ struct scmi_event { ...@@ -42,6 +47,9 @@ struct scmi_event {
struct scmi_event_ops { struct scmi_event_ops {
int (*set_notify_enabled)(const struct scmi_handle *handle, int (*set_notify_enabled)(const struct scmi_handle *handle,
u8 evt_id, u32 src_id, bool enabled); u8 evt_id, u32 src_id, bool enabled);
void *(*fill_custom_report)(const struct scmi_handle *handle,
u8 evt_id, u64 timestamp, const void *payld,
size_t payld_sz, void *report, u32 *src_id);
}; };
int scmi_notification_init(struct scmi_handle *handle); int scmi_notification_init(struct scmi_handle *handle);
...@@ -52,5 +60,7 @@ int scmi_register_protocol_events(const struct scmi_handle *handle, ...@@ -52,5 +60,7 @@ int scmi_register_protocol_events(const struct scmi_handle *handle,
const struct scmi_event_ops *ops, const struct scmi_event_ops *ops,
const struct scmi_event *evt, int num_events, const struct scmi_event *evt, int num_events,
int num_sources); int num_sources);
int scmi_notify(const struct scmi_handle *handle, u8 proto_id, u8 evt_id,
const void *buf, size_t len, u64 ts);
#endif /* _SCMI_NOTIFY_H */ #endif /* _SCMI_NOTIFY_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment