iio: magnetometer: st_magn: fix drdy line configuration for LIS3MDL
authorLorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Tue, 29 Aug 2017 11:45:11 +0000 (13:45 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 3 Sep 2017 16:39:39 +0000 (17:39 +0100)
commitc65e3d6ef4bfdc4c8460509f08507cf7dc026974
treedc3f17d3e73e265983a2a31d8f138d90852de95d
parent3af75db12e3d3537bc01c06bbdc876cb17e82b35
iio: magnetometer: st_magn: fix drdy line configuration for LIS3MDL

Data-ready line in LIS3MDL is routed to drdy pin and it is not possible
to select a different INT pin. st_sensors_set_dataready_irq() assumes
that if drdy int address is not exported in register map, irq trigger
is not supported by the sensor and hw_irq_trigger is always false.
Based on this configuration st_sensors_irq_thread does not consume
generated interrupt causing an unhandled irq.
Fix this taking into account status register address in
st_sensors_set_dataready_irq()

Fixes: 90efe0556292 (iio: st_sensors: harden interrupt handling)
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/common/st_sensors/st_sensors_core.c
drivers/iio/magnetometer/st_magn_core.c