mirror of https://gitee.com/openkylin/linux.git
firmware: arm_scmi: Add helper to access protocol revision/version
Add an helper to access from a protocol handle, the 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. Link: https://lore.kernel.org/r/20210316124903.35011-10-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:
parent
a4a20b0975
commit
3d5d6e84ea
|
@ -215,6 +215,8 @@ struct scmi_xfer_ops {
|
|||
struct scmi_xfer *xfer);
|
||||
};
|
||||
|
||||
struct scmi_revision_info *
|
||||
scmi_revision_area_get(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_revision_area_get - 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_revision_area_get(const struct scmi_protocol_handle *ph)
|
||||
{
|
||||
const struct scmi_protocol_instance *pi = ph_to_pi(ph);
|
||||
|
||||
return pi->handle->version;
|
||||
}
|
||||
|
||||
/**
|
||||
* scmi_alloc_init_protocol_instance - Allocate and initialize a protocol
|
||||
* instance descriptor.
|
||||
|
|
Loading…
Reference in New Issue