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>
This commit is contained in:
Cristian Marussi
2021-03-16 12:48:30 +00:00
committed by Sudeep Holla
parent 3dd2c81475
commit 5ad3d1cf7d
2 changed files with 146 additions and 5 deletions

View File

@@ -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);
};