1
0
Fork 0
remarkable-linux/drivers/iio/common
Lorenzo Bianconi d1f13dcad5 iio: st_sensors: add register mask for status register
[ Upstream commit e72a060151 ]

Introduce register mask for data-ready status register since
pressure sensors (e.g. LPS22HB) export just two channels
(BIT(0) and BIT(1)) and BIT(2) is marked reserved while in
st_sensors_new_samples_available() value read from status register
is masked using 0x7.
Moreover do not mask status register using active_scan_mask since
now status value is properly masked and if the result is not zero the
interrupt has to be consumed by the driver. This fix an issue on LPS25H
and LPS331AP where channel definition is swapped respect to status
register.
Furthermore that change allows to properly support new devices
(e.g LIS2DW12) that report just ZYXDA (data-ready) field in status register
to figure out if the interrupt has been generated by the device.

Fixes: 97865fe413 (iio: st_sensors: verify interrupt event to status)
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-25 14:26:26 +01:00
..
cros_ec_sensors Merge 4.11-rc6 into staging-next 2017-04-10 15:21:55 +02:00
hid-sensors Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2017-09-05 11:54:41 -07:00
ms_sensors iio: common: ms_sensors: Remove unnecessary cast on void pointer 2017-04-02 09:47:57 +01:00
ssp_sensors License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
st_sensors iio: st_sensors: add register mask for status register 2017-12-25 14:26:26 +01:00
Kconfig iio: cros_ec_sensors_core: Add common functions for the ChromeOS EC Sensor Hub. 2016-10-25 18:20:05 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00