summaryrefslogtreecommitdiff
path: root/drivers/iio/magnetometer/st_magn_buffer.c
diff options
context:
space:
mode:
authorGiuseppe Barba <giuseppe.barba@st.com>2015-07-21 11:35:43 +0300
committerJonathan Cameron <jic23@kernel.org>2015-07-23 22:43:13 +0300
commit74f5683f35fe6feae33b96815c1d40f13468d614 (patch)
treec61d0e3f3e7455cf5542bcb7cb14b7f667ac5457 /drivers/iio/magnetometer/st_magn_buffer.c
parentbb602f8c61e289389e7c2af1b577303a841f6d34 (diff)
downloadlinux-74f5683f35fe6feae33b96815c1d40f13468d614.tar.xz
iio: st_magn: Add irq trigger handling
Add irq trigger handling for magnetometer also Signed-off-by: Giuseppe Barba <giuseppe.barba@st.com> Acked-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/magnetometer/st_magn_buffer.c')
-rw-r--r--drivers/iio/magnetometer/st_magn_buffer.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/iio/magnetometer/st_magn_buffer.c b/drivers/iio/magnetometer/st_magn_buffer.c
index bf427dc0d226..ecd3bd0a9769 100644
--- a/drivers/iio/magnetometer/st_magn_buffer.c
+++ b/drivers/iio/magnetometer/st_magn_buffer.c
@@ -23,6 +23,13 @@
#include <linux/iio/common/st_sensors.h>
#include "st_magn.h"
+int st_magn_trig_set_state(struct iio_trigger *trig, bool state)
+{
+ struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig);
+
+ return st_sensors_set_dataready_irq(indio_dev, state);
+}
+
static int st_magn_buffer_preenable(struct iio_dev *indio_dev)
{
return st_sensors_set_enable(indio_dev, true);