提交 c3ed5e95 编写于 作者: C Cristian Marussi 提交者: Sudeep Holla

firmware: arm_scmi: Remove legacy scmi_voltage_ops protocol interface

Now that all the SCMI driver users have been migrated to the new interface
remove the legacy interface and all the transient code.

Link: https://lore.kernel.org/r/20210316124903.35011-31-cristian.marussi@arm.comTested-by: NFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: NCristian Marussi <cristian.marussi@arm.com>
Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
上级 59046d15
...@@ -262,15 +262,6 @@ static int scmi_voltage_config_set(const struct scmi_protocol_handle *ph, ...@@ -262,15 +262,6 @@ static int scmi_voltage_config_set(const struct scmi_protocol_handle *ph,
return ret; return ret;
} }
static int __scmi_voltage_config_set(const struct scmi_handle *handle,
u32 domain_id, u32 config)
{
const struct scmi_protocol_handle *ph =
scmi_map_protocol_handle(handle, SCMI_PROTOCOL_VOLTAGE);
return scmi_voltage_config_set(ph, domain_id, config);
}
static int scmi_voltage_config_get(const struct scmi_protocol_handle *ph, static int scmi_voltage_config_get(const struct scmi_protocol_handle *ph,
u32 domain_id, u32 *config) u32 domain_id, u32 *config)
{ {
...@@ -278,15 +269,6 @@ static int scmi_voltage_config_get(const struct scmi_protocol_handle *ph, ...@@ -278,15 +269,6 @@ static int scmi_voltage_config_get(const struct scmi_protocol_handle *ph,
domain_id, config); domain_id, config);
} }
static int __scmi_voltage_config_get(const struct scmi_handle *handle,
u32 domain_id, u32 *config)
{
const struct scmi_protocol_handle *ph =
scmi_map_protocol_handle(handle, SCMI_PROTOCOL_VOLTAGE);
return scmi_voltage_config_get(ph, domain_id, config);
}
static int scmi_voltage_level_set(const struct scmi_protocol_handle *ph, static int scmi_voltage_level_set(const struct scmi_protocol_handle *ph,
u32 domain_id, u32 flags, s32 volt_uV) u32 domain_id, u32 flags, s32 volt_uV)
{ {
...@@ -314,15 +296,6 @@ static int scmi_voltage_level_set(const struct scmi_protocol_handle *ph, ...@@ -314,15 +296,6 @@ static int scmi_voltage_level_set(const struct scmi_protocol_handle *ph,
return ret; return ret;
} }
static int __scmi_voltage_level_set(const struct scmi_handle *handle,
u32 domain_id, u32 flags, s32 volt_uV)
{
const struct scmi_protocol_handle *ph =
scmi_map_protocol_handle(handle, SCMI_PROTOCOL_VOLTAGE);
return scmi_voltage_level_set(ph, domain_id, flags, volt_uV);
}
static int scmi_voltage_level_get(const struct scmi_protocol_handle *ph, static int scmi_voltage_level_get(const struct scmi_protocol_handle *ph,
u32 domain_id, s32 *volt_uV) u32 domain_id, s32 *volt_uV)
{ {
...@@ -330,15 +303,6 @@ static int scmi_voltage_level_get(const struct scmi_protocol_handle *ph, ...@@ -330,15 +303,6 @@ static int scmi_voltage_level_get(const struct scmi_protocol_handle *ph,
domain_id, (u32 *)volt_uV); domain_id, (u32 *)volt_uV);
} }
static int __scmi_voltage_level_get(const struct scmi_handle *handle,
u32 domain_id, s32 *volt_uV)
{
const struct scmi_protocol_handle *ph =
scmi_map_protocol_handle(handle, SCMI_PROTOCOL_VOLTAGE);
return scmi_voltage_level_get(ph, domain_id, volt_uV);
}
static const struct scmi_voltage_info * __must_check static const struct scmi_voltage_info * __must_check
scmi_voltage_info_get(const struct scmi_protocol_handle *ph, u32 domain_id) scmi_voltage_info_get(const struct scmi_protocol_handle *ph, u32 domain_id)
{ {
...@@ -351,15 +315,6 @@ scmi_voltage_info_get(const struct scmi_protocol_handle *ph, u32 domain_id) ...@@ -351,15 +315,6 @@ scmi_voltage_info_get(const struct scmi_protocol_handle *ph, u32 domain_id)
return vinfo->domains + domain_id; return vinfo->domains + domain_id;
} }
static const struct scmi_voltage_info * __must_check
__scmi_voltage_info_get(const struct scmi_handle *handle, u32 domain_id)
{
const struct scmi_protocol_handle *ph =
scmi_map_protocol_handle(handle, SCMI_PROTOCOL_VOLTAGE);
return scmi_voltage_info_get(ph, domain_id);
}
static int scmi_voltage_domains_num_get(const struct scmi_protocol_handle *ph) static int scmi_voltage_domains_num_get(const struct scmi_protocol_handle *ph)
{ {
struct voltage_info *vinfo = ph->get_priv(ph); struct voltage_info *vinfo = ph->get_priv(ph);
...@@ -367,23 +322,6 @@ static int scmi_voltage_domains_num_get(const struct scmi_protocol_handle *ph) ...@@ -367,23 +322,6 @@ static int scmi_voltage_domains_num_get(const struct scmi_protocol_handle *ph)
return vinfo->num_domains; return vinfo->num_domains;
} }
static int __scmi_voltage_domains_num_get(const struct scmi_handle *handle)
{
const struct scmi_protocol_handle *ph =
scmi_map_protocol_handle(handle, SCMI_PROTOCOL_VOLTAGE);
return scmi_voltage_domains_num_get(ph);
}
static struct scmi_voltage_ops voltage_ops = {
.num_domains_get = __scmi_voltage_domains_num_get,
.info_get = __scmi_voltage_info_get,
.config_set = __scmi_voltage_config_set,
.config_get = __scmi_voltage_config_get,
.level_set = __scmi_voltage_level_set,
.level_get = __scmi_voltage_level_get,
};
static struct scmi_voltage_proto_ops voltage_proto_ops = { static struct scmi_voltage_proto_ops voltage_proto_ops = {
.num_domains_get = scmi_voltage_domains_num_get, .num_domains_get = scmi_voltage_domains_num_get,
.info_get = scmi_voltage_info_get, .info_get = scmi_voltage_info_get,
...@@ -398,7 +336,6 @@ static int scmi_voltage_protocol_init(const struct scmi_protocol_handle *ph) ...@@ -398,7 +336,6 @@ static int scmi_voltage_protocol_init(const struct scmi_protocol_handle *ph)
int ret; int ret;
u32 version; u32 version;
struct voltage_info *vinfo; struct voltage_info *vinfo;
struct scmi_handle *handle;
ret = ph->xops->version_get(ph, &version); ret = ph->xops->version_get(ph, &version);
if (ret) if (ret)
...@@ -429,10 +366,6 @@ static int scmi_voltage_protocol_init(const struct scmi_protocol_handle *ph) ...@@ -429,10 +366,6 @@ static int scmi_voltage_protocol_init(const struct scmi_protocol_handle *ph)
dev_warn(ph->dev, "No Voltage domains found.\n"); dev_warn(ph->dev, "No Voltage domains found.\n");
} }
/* Transient code for legacy ops interface */
handle = scmi_map_scmi_handle(ph);
handle->voltage_ops = &voltage_ops;
return ph->set_priv(ph, vinfo); return ph->set_priv(ph, vinfo);
} }
......
...@@ -541,20 +541,6 @@ struct scmi_voltage_proto_ops { ...@@ -541,20 +541,6 @@ struct scmi_voltage_proto_ops {
s32 *volt_uV); s32 *volt_uV);
}; };
struct scmi_voltage_ops {
int (*num_domains_get)(const struct scmi_handle *handle);
const struct scmi_voltage_info __must_check *(*info_get)
(const struct scmi_handle *handle, u32 domain_id);
int (*config_set)(const struct scmi_handle *handle, u32 domain_id,
u32 config);
int (*config_get)(const struct scmi_handle *handle, u32 domain_id,
u32 *config);
int (*level_set)(const struct scmi_handle *handle, u32 domain_id,
u32 flags, s32 volt_uV);
int (*level_get)(const struct scmi_handle *handle, u32 domain_id,
s32 *volt_uV);
};
/** /**
* struct scmi_notify_ops - represents notifications' operations provided by * struct scmi_notify_ops - represents notifications' operations provided by
* SCMI core * SCMI core
...@@ -619,7 +605,6 @@ struct scmi_notify_ops { ...@@ -619,7 +605,6 @@ struct scmi_notify_ops {
* *
* @dev: pointer to the SCMI device * @dev: pointer to the SCMI device
* @version: pointer to the structure containing SCMI version information * @version: pointer to the structure containing SCMI version information
* @voltage_ops: pointer to set of voltage protocol operations
* @devm_protocol_get: devres managed method to acquire a protocol and get specific * @devm_protocol_get: devres managed method to acquire a protocol and get specific
* operations and a dedicated protocol handler * operations and a dedicated protocol handler
* @devm_protocol_put: devres managed method to release a protocol * @devm_protocol_put: devres managed method to release a protocol
...@@ -630,7 +615,6 @@ struct scmi_notify_ops { ...@@ -630,7 +615,6 @@ struct scmi_notify_ops {
struct scmi_handle { struct scmi_handle {
struct device *dev; struct device *dev;
struct scmi_revision_info *version; struct scmi_revision_info *version;
const struct scmi_voltage_ops *voltage_ops;
const void __must_check * const void __must_check *
(*devm_protocol_get)(struct scmi_device *sdev, u8 proto, (*devm_protocol_get)(struct scmi_device *sdev, u8 proto,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册