summaryrefslogtreecommitdiffstats
path: root/include/linux/scmi_protocol.h
diff options
context:
space:
mode:
authorCristian Marussi <cristian.marussi@arm.com>2020-11-19 17:49:04 +0000
committerSudeep Holla <sudeep.holla@arm.com>2020-11-22 18:00:25 +0000
commite2083d36739168f7b612312160cf7bb45b251408 (patch)
tree222440565f0e1c8915bb4cdcc9ae518588787ed9 /include/linux/scmi_protocol.h
parentd7971d57d2737002dc0ef2f9d9c9494184d41348 (diff)
downloadlinux-e2083d36739168f7b612312160cf7bb45b251408.tar.bz2
firmware: arm_scmi: Add SCMI v3.0 sensors timestamped reads
Add new .reading_get_timestamped() method to sensor_ops to support SCMI v3.0 timestamped reads. Link: https://lore.kernel.org/r/20201119174906.43862-5-cristian.marussi@arm.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, 22 insertions, 0 deletions
diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h
index 0792b0be25a3..0c52bf0cbee4 100644
--- a/include/linux/scmi_protocol.h
+++ b/include/linux/scmi_protocol.h
@@ -150,6 +150,20 @@ struct scmi_power_ops {
};
/**
+ * scmi_sensor_reading - represent a timestamped read
+ *
+ * Used by @reading_get_timestamped method.
+ *
+ * @value: The signed value sensor read.
+ * @timestamp: An unsigned timestamp for the sensor read, as provided by
+ * SCMI platform. Set to zero when not available.
+ */
+struct scmi_sensor_reading {
+ long long value;
+ unsigned long long timestamp;
+};
+
+/**
* scmi_range_attrs - specifies a sensor or axis values' range
* @min_range: The minimum value which can be represented by the sensor/axis.
* @max_range: The maximum value which can be represented by the sensor/axis.
@@ -390,6 +404,11 @@ enum scmi_sensor_class {
* @info_get: get the information of the specified sensor
* @trip_point_config: selects and configures a trip-point of interest
* @reading_get: gets the current value of the sensor
+ * @reading_get_timestamped: gets the current value and timestamp, when
+ * available, of the sensor. (as of v3.0 spec)
+ * Supports multi-axis sensors for sensors which
+ * supports it and if the @reading array size of
+ * @count entry equals the sensor num_axis
*/
struct scmi_sensor_ops {
int (*count_get)(const struct scmi_handle *handle);
@@ -399,6 +418,9 @@ struct scmi_sensor_ops {
u32 sensor_id, u8 trip_id, u64 trip_value);
int (*reading_get)(const struct scmi_handle *handle, u32 sensor_id,
u64 *value);
+ int (*reading_get_timestamped)(const struct scmi_handle *handle,
+ u32 sensor_id, u8 count,
+ struct scmi_sensor_reading *readings);
};
/**