summaryrefslogtreecommitdiff
path: root/include/linux/scmi_protocol.h
diff options
context:
space:
mode:
authorCristian Marussi <cristian.marussi@arm.com>2021-03-16 12:48:48 +0000
committerSudeep Holla <sudeep.holla@arm.com>2021-03-30 16:34:55 +0100
commit9694a7f623593425a1559bb7a82bee91dfdd843b (patch)
treed3f00dbfed4656f44037565e0c1104c5a102c087 /include/linux/scmi_protocol.h
parent497ef0cbc6d166cef129b180dd292eec744a04fb (diff)
firmware: arm_scmi: Port sensor protocol to new protocols interface
Convert internals of protocol implementation to use protocol handles and expose a new protocol operations interface for SCMI driver using the new get/put common operations, while keeping the old handle->sensor_ops still around to ease transition. Remove handle->sensor_priv now unused. Link: https://lore.kernel.org/r/20210316124903.35011-24-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>
Diffstat (limited to 'include/linux/scmi_protocol.h')
-rw-r--r--include/linux/scmi_protocol.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h
index c5bf9dc707aa..ead06db7be18 100644
--- a/include/linux/scmi_protocol.h
+++ b/include/linux/scmi_protocol.h
@@ -431,7 +431,7 @@ enum scmi_sensor_class {
};
/**
- * struct scmi_sensor_ops - represents the various operations provided
+ * struct scmi_sensor_proto_ops - represents the various operations provided
* by SCMI Sensor Protocol
*
* @count_get: get the count of sensors provided by SCMI
@@ -446,6 +446,23 @@ enum scmi_sensor_class {
* @config_get: Get sensor current configuration
* @config_set: Set sensor current configuration
*/
+struct scmi_sensor_proto_ops {
+ int (*count_get)(const struct scmi_protocol_handle *ph);
+ const struct scmi_sensor_info *(*info_get)
+ (const struct scmi_protocol_handle *ph, u32 sensor_id);
+ int (*trip_point_config)(const struct scmi_protocol_handle *ph,
+ u32 sensor_id, u8 trip_id, u64 trip_value);
+ int (*reading_get)(const struct scmi_protocol_handle *ph, u32 sensor_id,
+ u64 *value);
+ int (*reading_get_timestamped)(const struct scmi_protocol_handle *ph,
+ u32 sensor_id, u8 count,
+ struct scmi_sensor_reading *readings);
+ int (*config_get)(const struct scmi_protocol_handle *ph,
+ u32 sensor_id, u32 *sensor_config);
+ int (*config_set)(const struct scmi_protocol_handle *ph,
+ u32 sensor_id, u32 sensor_config);
+};
+
struct scmi_sensor_ops {
int (*count_get)(const struct scmi_handle *handle);
const struct scmi_sensor_info *(*info_get)
@@ -611,8 +628,6 @@ struct scmi_notify_ops {
* operations and a dedicated protocol handler
* @devm_protocol_put: devres managed method to release a protocol
* @notify_ops: pointer to set of notifications related operations
- * @sensor_priv: pointer to private data structure specific to sensors
- * protocol(for internal use only)
* @voltage_priv: pointer to private data structure specific to voltage
* protocol(for internal use only)
* @notify_priv: pointer to private data structure specific to notifications
@@ -631,7 +646,6 @@ struct scmi_handle {
const struct scmi_notify_ops *notify_ops;
/* for protocol internal use */
- void *sensor_priv;
void *voltage_priv;
void *notify_priv;
void *system_priv;