summaryrefslogtreecommitdiffstats
path: root/drivers/iio/gyro/hid-sensor-gyro-3d.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-10 10:17:45 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-10 10:17:45 +0100
commit9c96f401e91a4358eb4a5e227c1521dea1c20127 (patch)
treee8a0b78324510ba6133c58cc05b2cb2f3876745e /drivers/iio/gyro/hid-sensor-gyro-3d.c
parent1528e40fd7d382e9668d3a1876a83d30bb04d554 (diff)
parent40e020c129cfc991e8ab4736d2665351ffd1468d (diff)
downloadlinux-9c96f401e91a4358eb4a5e227c1521dea1c20127.tar.bz2
Merge 4.20-rc6 into tty-next
We want the TTY changes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio/gyro/hid-sensor-gyro-3d.c')
-rw-r--r--drivers/iio/gyro/hid-sensor-gyro-3d.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-sensor-gyro-3d.c
index 36941e69f959..88e857c4baf4 100644
--- a/drivers/iio/gyro/hid-sensor-gyro-3d.c
+++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c
@@ -111,6 +111,7 @@ static int gyro_3d_read_raw(struct iio_dev *indio_dev,
int report_id = -1;
u32 address;
int ret_type;
+ s32 min;
*val = 0;
*val2 = 0;
@@ -118,13 +119,15 @@ static int gyro_3d_read_raw(struct iio_dev *indio_dev,
case IIO_CHAN_INFO_RAW:
hid_sensor_power_state(&gyro_state->common_attributes, true);
report_id = gyro_state->gyro[chan->scan_index].report_id;
+ min = gyro_state->gyro[chan->scan_index].logical_minimum;
address = gyro_3d_addresses[chan->scan_index];
if (report_id >= 0)
*val = sensor_hub_input_attr_get_raw_value(
gyro_state->common_attributes.hsdev,
HID_USAGE_SENSOR_GYRO_3D, address,
report_id,
- SENSOR_HUB_SYNC);
+ SENSOR_HUB_SYNC,
+ min < 0);
else {
*val = 0;
hid_sensor_power_state(&gyro_state->common_attributes,