FROMLIST: 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.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I3867be1ada472e5d09335cb8be25cbcac84763b1
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
This commit is contained in:
Cristian Marussi
2021-02-02 22:15:24 +00:00
committed by Todd Kjos
parent d25dc33d27
commit 0c203b198e
2 changed files with 137 additions and 1 deletions

View File

@@ -544,6 +544,10 @@ struct scmi_voltage_ops {
/**
* struct scmi_notify_ops - represents notifications' operations provided by
* SCMI core
* @devm_register_event_notifier: Managed registration of a notifier_block for
* the requested event
* @devm_unregister_event_notifier: 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,6 +582,13 @@ struct scmi_voltage_ops {
* @report: A custom struct describing the specific event delivered
*/
struct scmi_notify_ops {
int (*devm_register_event_notifier)(struct scmi_device *sdev,
u8 proto_id, u8 evt_id, u32 *src_id,
struct notifier_block *nb);
int (*devm_unregister_event_notifier)(struct scmi_device *sdev,
u8 proto_id, u8 evt_id,
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,
struct notifier_block *nb);