diff options
author | Cristian Marussi <cristian.marussi@arm.com> | 2021-03-16 12:48:30 +0000 |
---|---|---|
committer | Sudeep Holla <sudeep.holla@arm.com> | 2021-03-29 10:00:35 +0100 |
commit | 5ad3d1cf7d34c00aa5b425d93373b5c0044aa0a9 (patch) | |
tree | 149cb0aff8338111d4af067cca0f9f4538ff7a0d /include/linux/scmi_protocol.h | |
parent | 3dd2c81475564e604fd5b0a21813b9c2f2950fa3 (diff) |
firmware: arm_scmi: Introduce new devres notification ops
Expose to the SCMI drivers a new alternative devres managed notifications
API based on protocol handles.
All drivers still keep using the old API, no functional change.
Link: https://lore.kernel.org/r/20210316124903.35011-6-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Diffstat (limited to 'include/linux/scmi_protocol.h')
-rw-r--r-- | include/linux/scmi_protocol.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h index a9becd356fe8..2b66b243e841 100644 --- a/include/linux/scmi_protocol.h +++ b/include/linux/scmi_protocol.h @@ -544,6 +544,10 @@ struct scmi_voltage_ops { /** * struct scmi_notify_ops - represents notifications' operations provided by * SCMI core + * @devm_event_notifier_register: Managed registration of a notifier_block for + * the requested event + * @devm_event_notifier_unregister: Managed unregistration of a notifier_block + * for the requested event * @register_event_notifier: Register a notifier_block for the requested event * @unregister_event_notifier: Unregister a notifier_block for the requested * event @@ -553,7 +557,9 @@ struct scmi_voltage_ops { * tuple: (proto_id, evt_id, src_id) using the provided register/unregister * interface where: * - * @handle: The handle identifying the platform instance to use + * @sdev: The scmi_device to use when calling the devres managed ops devm_ + * @handle: The handle identifying the platform instance to use, when not + * calling the managed ops devm_ * @proto_id: The protocol ID as in SCMI Specification * @evt_id: The message ID of the desired event as in SCMI Specification * @src_id: A pointer to the desired source ID if different sources are @@ -576,11 +582,21 @@ struct scmi_voltage_ops { * @report: A custom struct describing the specific event delivered */ struct scmi_notify_ops { + int (*devm_event_notifier_register)(struct scmi_device *sdev, + u8 proto_id, u8 evt_id, + const u32 *src_id, + struct notifier_block *nb); + int (*devm_event_notifier_unregister)(struct scmi_device *sdev, + u8 proto_id, u8 evt_id, + const u32 *src_id, + struct notifier_block *nb); int (*register_event_notifier)(const struct scmi_handle *handle, - u8 proto_id, u8 evt_id, u32 *src_id, + u8 proto_id, u8 evt_id, + const u32 *src_id, struct notifier_block *nb); int (*unregister_event_notifier)(const struct scmi_handle *handle, - u8 proto_id, u8 evt_id, u32 *src_id, + u8 proto_id, u8 evt_id, + const u32 *src_id, struct notifier_block *nb); }; |