]> git.baikalelectronics.ru Git - kernel.git/commit
iio: st_sensors: verify interrupt event to status
authorLinus Walleij <linus.walleij@linaro.org>
Thu, 24 Mar 2016 13:18:05 +0000 (14:18 +0100)
committerJonathan Cameron <jic23@kernel.org>
Tue, 19 Apr 2016 18:58:12 +0000 (19:58 +0100)
commita4abe606c6a263f130149f4163e727a991d05f96
tree6d14571a7fed1c01d8e6ed74d5817aa5edd6b5d0
parentae78fb915748bfe524611da056ff2abeab2949af
iio: st_sensors: verify interrupt event to status

This makes all ST sensor drivers check that they actually have
new data available for the requested channel(s) before claiming
an IRQ, by reading the status register (which is conveniently
the same for all ST sensors) and check that the channel has new
data before proceeding to read it and fill the buffer.

This way sensors can share an interrupt line: it can be flaged
as shared and then the sensor that did not fire will return
NO_IRQ, and the sensor that fired will handle the IRQ and
return IRQ_HANDLED.

Cc: Giuseppe Barba <giuseppe.barba@st.com>
Cc: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/accel/st_accel_core.c
drivers/iio/common/st_sensors/st_sensors_buffer.c
drivers/iio/gyro/st_gyro_core.c
drivers/iio/magnetometer/st_magn_core.c
drivers/iio/pressure/st_pressure_core.c
include/linux/iio/common/st_sensors.h