Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

firmware: arm_scmi: Drop async flag in sensor_ops->reading_get

SENSOR_DESCRIPTION_GET provides attributes to indicate if the sensor
supports asynchronous read. Ideally we should be able to read that flag
and use asynchronous reads for any sensors with that attribute set.

In order to add that support, let's drop the async flag passed to
sensor_ops->reading_get and dynamically switch between sync and async
flags based on the attributes as provided by the firmware.

Cc: linux-hwmon@vger.kernel.org
Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>

+4 -4
+2 -2
drivers/firmware/arm_scmi/sensors.c
··· 211 211 } 212 212 213 213 static int scmi_sensor_reading_get(const struct scmi_handle *handle, 214 - u32 sensor_id, bool async, u64 *value) 214 + u32 sensor_id, u64 *value) 215 215 { 216 216 int ret; 217 217 struct scmi_xfer *t; ··· 225 225 226 226 sensor = t->tx.buf; 227 227 sensor->id = cpu_to_le32(sensor_id); 228 - sensor->flags = cpu_to_le32(async ? SENSOR_READ_ASYNC : 0); 228 + sensor->flags = cpu_to_le32(0); 229 229 230 230 ret = scmi_do_xfer(handle, t); 231 231 if (!ret) {
+1 -1
drivers/hwmon/scmi-hwmon.c
··· 72 72 const struct scmi_handle *h = scmi_sensors->handle; 73 73 74 74 sensor = *(scmi_sensors->info[type] + channel); 75 - ret = h->sensor_ops->reading_get(h, sensor->id, false, &value); 75 + ret = h->sensor_ops->reading_get(h, sensor->id, &value); 76 76 if (ret) 77 77 return ret; 78 78
+1 -1
include/linux/scmi_protocol.h
··· 182 182 int (*trip_point_config)(const struct scmi_handle *handle, 183 183 u32 sensor_id, u8 trip_id, u64 trip_value); 184 184 int (*reading_get)(const struct scmi_handle *handle, u32 sensor_id, 185 - bool async, u64 *value); 185 + u64 *value); 186 186 }; 187 187 188 188 /**