firmware: arm_scmi: Remove legacy scmi_power_ops protocol interface
authorCristian Marussi <cristian.marussi@arm.com>
Tue, 16 Mar 2021 12:48:41 +0000 (12:48 +0000)
committerSudeep Holla <sudeep.holla@arm.com>
Mon, 29 Mar 2021 09:00:35 +0000 (10:00 +0100)
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-17-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>
drivers/firmware/arm_scmi/power.c
include/linux/scmi_protocol.h

index c950c1fc0fbe910c1f86d931fcccbddb4e79d371..ecdf49abd981391fb3b3672cb6228f50848a6d83 100644 (file)
@@ -146,15 +146,6 @@ static int scmi_power_state_set(const struct scmi_protocol_handle *ph,
        return ret;
 }
 
-static int __scmi_power_state_set(const struct scmi_handle *handle,
-                                 u32 domain, u32 state)
-{
-       const struct scmi_protocol_handle *ph =
-               scmi_map_protocol_handle(handle, SCMI_PROTOCOL_POWER);
-
-       return scmi_power_state_set(ph, domain, state);
-}
-
 static int scmi_power_state_get(const struct scmi_protocol_handle *ph,
                                u32 domain, u32 *state)
 {
@@ -175,15 +166,6 @@ static int scmi_power_state_get(const struct scmi_protocol_handle *ph,
        return ret;
 }
 
-static int __scmi_power_state_get(const struct scmi_handle *handle,
-                                 u32 domain, u32 *state)
-{
-       const struct scmi_protocol_handle *ph =
-               scmi_map_protocol_handle(handle, SCMI_PROTOCOL_POWER);
-
-       return scmi_power_state_get(ph, domain, state);
-}
-
 static int scmi_power_num_domains_get(const struct scmi_protocol_handle *ph)
 {
        struct scmi_power_info *pi = ph->get_priv(ph);
@@ -191,14 +173,6 @@ static int scmi_power_num_domains_get(const struct scmi_protocol_handle *ph)
        return pi->num_domains;
 }
 
-static int __scmi_power_num_domains_get(const struct scmi_handle *handle)
-{
-       const struct scmi_protocol_handle *ph =
-               scmi_map_protocol_handle(handle, SCMI_PROTOCOL_POWER);
-
-       return scmi_power_num_domains_get(ph);
-}
-
 static char *scmi_power_name_get(const struct scmi_protocol_handle *ph,
                                 u32 domain)
 {
@@ -208,22 +182,6 @@ static char *scmi_power_name_get(const struct scmi_protocol_handle *ph,
        return dom->name;
 }
 
-static char *__scmi_power_name_get(const struct scmi_handle *handle,
-                                  u32 domain)
-{
-       const struct scmi_protocol_handle *ph =
-               scmi_map_protocol_handle(handle, SCMI_PROTOCOL_POWER);
-
-       return scmi_power_name_get(ph, domain);
-}
-
-static const struct scmi_power_ops power_ops = {
-       .num_domains_get = __scmi_power_num_domains_get,
-       .name_get = __scmi_power_name_get,
-       .state_set = __scmi_power_state_set,
-       .state_get = __scmi_power_state_get,
-};
-
 static const struct scmi_power_proto_ops power_proto_ops = {
        .num_domains_get = scmi_power_num_domains_get,
        .name_get = scmi_power_name_get,
@@ -324,7 +282,6 @@ static int scmi_power_protocol_init(const struct scmi_protocol_handle *ph)
        int domain;
        u32 version;
        struct scmi_power_info *pinfo;
-       struct scmi_handle *handle;
 
        ph->xops->version_get(ph, &version);
 
@@ -350,10 +307,6 @@ static int scmi_power_protocol_init(const struct scmi_protocol_handle *ph)
 
        pinfo->version = version;
 
-       /* Transient code for legacy ops interface */
-       handle = scmi_map_scmi_handle(ph);
-       handle->power_ops = &power_ops;
-
        return ph->set_priv(ph, pinfo);
 }
 
index dfb3d2f5e0d33c6bce779459c3e532319507008f..2328d36b7597659aa1ee8a79672f6d22fae18126 100644 (file)
@@ -152,15 +152,6 @@ struct scmi_power_proto_ops {
                         u32 *state);
 };
 
-struct scmi_power_ops {
-       int (*num_domains_get)(const struct scmi_handle *handle);
-       char *(*name_get)(const struct scmi_handle *handle, u32 domain);
-       int (*state_set)(const struct scmi_handle *handle, u32 domain,
-                        u32 state);
-       int (*state_get)(const struct scmi_handle *handle, u32 domain,
-                        u32 *state);
-};
-
 /**
  * scmi_sensor_reading  - represent a timestamped read
  *
@@ -614,7 +605,6 @@ struct scmi_notify_ops {
  *
  * @dev: pointer to the SCMI device
  * @version: pointer to the structure containing SCMI version information
- * @power_ops: pointer to set of power protocol operations
  * @clk_ops: pointer to set of clock protocol operations
  * @sensor_ops: pointer to set of sensor protocol operations
  * @reset_ops: pointer to set of reset protocol operations
@@ -638,7 +628,6 @@ struct scmi_handle {
        struct device *dev;
        struct scmi_revision_info *version;
        const struct scmi_clk_ops *clk_ops;
-       const struct scmi_power_ops *power_ops;
        const struct scmi_sensor_ops *sensor_ops;
        const struct scmi_reset_ops *reset_ops;
        const struct scmi_voltage_ops *voltage_ops;