@@ -215,6 +215,8 @@ struct scmi_xfer_ops {
struct scmi_xfer *xfer);
};
+struct scmi_revision_info *
+scmi_get_revision_area(const struct scmi_protocol_handle *ph);
int scmi_handle_put(const struct scmi_handle *handle);
struct scmi_handle *scmi_handle_get(struct device *dev);
void scmi_set_handle(struct scmi_device *scmi_dev);
@@ -698,6 +698,25 @@ static const struct scmi_xfer_ops xfer_ops = {
.xfer_put = xfer_put,
};
+/**
+ * scmi_get_revision_area - Retrieve version memory area.
+ *
+ * @ph: A reference to the protocol handle.
+ *
+ * A helper to grab the version memory area reference during SCMI Base protocol
+ * initialization.
+ *
+ * Return: A reference to the version memory area associated to the SCMI
+ * instance underlying this protocol handle.
+ */
+struct scmi_revision_info *
+scmi_get_revision_area(const struct scmi_protocol_handle *ph)
+{
+ const struct scmi_protocol_instance *pi = ph_to_pi(ph);
+
+ return pi->handle->version;
+}
+
/**
* scmi_get_protocol_instance - Protocol initialization helper.
* @handle: A reference to the SCMI platform instance.
Add an helper to grab, from a protocol handle, the handle common memory area allocated to store SCMI version data which is exposed on sysfs. Such helper will be needed by SCMI Base protocol initialization once it will be moved to new protocol handles scheme. Signed-off-by: Cristian Marussi <cristian.marussi@arm.com> --- drivers/firmware/arm_scmi/common.h | 2 ++ drivers/firmware/arm_scmi/driver.c | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+)