diff options
author | Cristian Marussi <cristian.marussi@arm.com> | 2021-03-16 12:48:28 +0000 |
---|---|---|
committer | Sudeep Holla <sudeep.holla@arm.com> | 2021-03-29 10:00:16 +0100 |
commit | 23934efe3748f6d9d8ac0760178a5ef1ed8320f4 (patch) | |
tree | e4ce4707a5ed15c78028a90ad1e11693c7eb8659 /include/linux/scmi_protocol.h | |
parent | d7b6cc563a600762597ff608f487f90dc8b66f16 (diff) |
firmware: arm_scmi: Introduce devres get/put protocols operations
Expose to the SCMI drivers a new devres managed common protocols API
based on generic get/put methods and protocol handles.
All drivers still keep using the old API, no functional change.
Link: https://lore.kernel.org/r/20210316124903.35011-4-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 | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h index ea301c579c6f..a9becd356fe8 100644 --- a/include/linux/scmi_protocol.h +++ b/include/linux/scmi_protocol.h @@ -57,6 +57,8 @@ struct scmi_clock_info { }; struct scmi_handle; +struct scmi_device; +struct scmi_protocol_handle; /** * struct scmi_clk_ops - represents the various operations provided @@ -593,6 +595,9 @@ struct scmi_notify_ops { * @sensor_ops: pointer to set of sensor protocol operations * @reset_ops: pointer to set of reset protocol operations * @voltage_ops: pointer to set of voltage protocol operations + * @devm_protocol_get: devres managed method to acquire a protocol and get specific + * operations and a dedicated protocol handler + * @devm_protocol_put: devres managed method to release a protocol * @notify_ops: pointer to set of notifications related operations * @perf_priv: pointer to private data structure specific to performance * protocol(for internal use only) @@ -618,6 +623,12 @@ struct scmi_handle { const struct scmi_sensor_ops *sensor_ops; const struct scmi_reset_ops *reset_ops; const struct scmi_voltage_ops *voltage_ops; + + const void __must_check * + (*devm_protocol_get)(struct scmi_device *sdev, u8 proto, + struct scmi_protocol_handle **ph); + void (*devm_protocol_put)(struct scmi_device *sdev, u8 proto); + const struct scmi_notify_ops *notify_ops; /* for protocol internal use */ void *perf_priv; |