Skip to content

Commit 6a55331

Browse files
committed
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: [email protected] Acked-by: Guenter Roeck <[email protected]> Signed-off-by: Sudeep Holla <[email protected]>
1 parent 58ecdf0 commit 6a55331

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

drivers/firmware/arm_scmi/sensors.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ scmi_sensor_trip_point_config(const struct scmi_handle *handle, u32 sensor_id,
211211
}
212212

213213
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)
215215
{
216216
int ret;
217217
struct scmi_xfer *t;
@@ -225,7 +225,7 @@ static int scmi_sensor_reading_get(const struct scmi_handle *handle,
225225

226226
sensor = t->tx.buf;
227227
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);
229229

230230
ret = scmi_do_xfer(handle, t);
231231
if (!ret) {

drivers/hwmon/scmi-hwmon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static int scmi_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
7272
const struct scmi_handle *h = scmi_sensors->handle;
7373

7474
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);
7676
if (ret)
7777
return ret;
7878

include/linux/scmi_protocol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ struct scmi_sensor_ops {
182182
int (*trip_point_config)(const struct scmi_handle *handle,
183183
u32 sensor_id, u8 trip_id, u64 trip_value);
184184
int (*reading_get)(const struct scmi_handle *handle, u32 sensor_id,
185-
bool async, u64 *value);
185+
u64 *value);
186186
};
187187

188188
/**

0 commit comments

Comments
 (0)