linux/drivers/iio/light
Hans de Goede ab77f8541e iio/hid-sensors: Fix IIO_CHAN_INFO_RAW returning wrong values for signed numbers
commit 0145b50566 upstream.

Before this commit sensor_hub_input_attr_get_raw_value() failed to take
the signedness of 16 and 8 bit values into account, returning e.g.
65436 instead of -100 for the z-axis reading of an accelerometer.

This commit adds a new is_signed parameter to the function and makes all
callers pass the appropriate value for this.

While at it, this commit also fixes up some neighboring lines where
statements were needlessly split over 2 lines to improve readability.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
[bwh: Backported to 3.16:
 - sensor_hub_input_attr_get_raw_value() doesn't take a sync/async flag
   parameter
 - In sensor_hub_input_attr_get_raw_value() keep using data->pending instead of
   hsdev->pending
 - In magn_3d_read_raw() keep using chan->scan_index intstead of chan->address
 - Drop changes in hid-sensor-{custom,humidity,temperature}
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2019-02-11 17:54:05 +00:00
..
adjd_s311.c iio: delete non-required instances of include <linux/init.h> 2014-01-11 11:59:00 +00:00
apds9300.c iio: Remove support for the legacy event config interface 2013-12-08 13:13:52 +00:00
cm32181.c iio: cm32181: Fix read integration time function 2014-03-15 15:16:42 +00:00
cm36651.c iio: cm36651: Fix i2c client leak and possible NULL pointer dereference 2014-03-22 12:22:49 +00:00
gp2ap020a00f.c iio: Fix spelling of illuminance in gp2ap020a00f driver 2014-05-03 11:58:13 +01:00
hid-sensor-als.c iio/hid-sensors: Fix IIO_CHAN_INFO_RAW returning wrong values for signed numbers 2019-02-11 17:54:05 +00:00
hid-sensor-prox.c iio/hid-sensors: Fix IIO_CHAN_INFO_RAW returning wrong values for signed numbers 2019-02-11 17:54:05 +00:00
Kconfig iio: hid-sensors: Added Proximity Sensor Driver 2014-02-22 13:07:01 +00:00
lm3533-als.c iio: light: lm3533-als: Use devm_iio_device_alloc 2013-08-03 18:55:25 +01:00
ltr501.c iio: Add Lite-On ltr501 ambient light / proximity sensor driver 2014-01-12 18:15:40 +00:00
Makefile iio: hid-sensors: Added Proximity Sensor Driver 2014-02-22 13:07:01 +00:00
tcs3472.c iio:tcs3472: Check for buffer enabled and locking 2014-07-07 08:59:16 +01:00
tsl2563.c iio: light: tsl2563: use correct event code 2017-11-11 13:32:52 +00:00
tsl4531.c iio: Add tsl4531 ambient light sensor driver 2013-09-14 21:17:15 +01:00
vcnl4000.c iio:vcnl4000: Mark transfer buffer as __be16 2013-12-03 20:22:27 +00:00