diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2018-12-12 00:24:57 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-12-12 00:24:57 +0300 |
commit | 28ab1bb0e8f031dd7dd3462ff8f6b2e93fc77e7f (patch) | |
tree | 3c0d2177d9bfc513c2d06c1efb5ab62c74fd1953 /drivers/iio/light/hid-sensor-prox.c | |
parent | b874155a5fa450bf5e4b5303cbfff05958805bf8 (diff) | |
parent | 40e020c129cfc991e8ab4736d2665351ffd1468d (diff) | |
download | linux-28ab1bb0e8f031dd7dd3462ff8f6b2e93fc77e7f.tar.xz |
Merge tag 'v4.20-rc6' into rdma.git for-next
For dependencies in following patches.
Diffstat (limited to 'drivers/iio/light/hid-sensor-prox.c')
-rw-r--r-- | drivers/iio/light/hid-sensor-prox.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/iio/light/hid-sensor-prox.c b/drivers/iio/light/hid-sensor-prox.c index 45107f7537b5..cf5a0c242609 100644 --- a/drivers/iio/light/hid-sensor-prox.c +++ b/drivers/iio/light/hid-sensor-prox.c @@ -73,6 +73,7 @@ static int prox_read_raw(struct iio_dev *indio_dev, int report_id = -1; u32 address; int ret_type; + s32 min; *val = 0; *val2 = 0; @@ -81,8 +82,8 @@ static int prox_read_raw(struct iio_dev *indio_dev, switch (chan->scan_index) { case CHANNEL_SCAN_INDEX_PRESENCE: report_id = prox_state->prox_attr.report_id; - address = - HID_USAGE_SENSOR_HUMAN_PRESENCE; + min = prox_state->prox_attr.logical_minimum; + address = HID_USAGE_SENSOR_HUMAN_PRESENCE; break; default: report_id = -1; @@ -95,7 +96,8 @@ static int prox_read_raw(struct iio_dev *indio_dev, prox_state->common_attributes.hsdev, HID_USAGE_SENSOR_PROX, address, report_id, - SENSOR_HUB_SYNC); + SENSOR_HUB_SYNC, + min < 0); hid_sensor_power_state(&prox_state->common_attributes, false); } else { |