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

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: Icd8d74fb4b40318f0acfcd882728d1ea1f33f363
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
This commit is contained in:
Cristian Marussi
2021-02-02 22:15:21 +00:00
committed by Todd Kjos
parent bd376903a5
commit bfacf9cff5
2 changed files with 103 additions and 0 deletions

View File

@@ -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_get_protocol: devres managed method to acquire a protocol and get specific
* operations and a dedicated protocol handler
* @devm_put_protocol: 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_get_protocol)(struct scmi_device *sdev, u8 proto,
struct scmi_protocol_handle **ph);
void (*devm_put_protocol)(struct scmi_device *sdev, u8 proto);
const struct scmi_notify_ops *notify_ops;
/* for protocol internal use */
void *perf_priv;