aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Kepplinger <martink@posteo.de>2015-07-05 13:50:18 -0400
committerJonathan Cameron <jic23@kernel.org>2015-07-19 09:32:18 -0400
commitc5d0db0690ff0a963dc082e7645268c466bf9a84 (patch)
tree4cc357ceac84c391071e95eff8af5bc351f133da
parent41be6a0d5aa3c4fcb472f3d44251683b085b00a3 (diff)
iio: mma8452: use iio event type IIO_EV_TYPE_MAG
IIO_EV_TYPE_THRESH in rising direction describes an event where the threshold is crossed in rising direction, positive or negative values being possible. This is not the case here. Since the threshold is no signed value and only the magnitude is compared, IIO_EV_TYPE_MAG is what describes the behaviour of these devices, see the sysfs-bus-iio ABI Documentation. Signed-off-by: Martin Kepplinger <martin.kepplinger@theobroma-systems.com> Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r--drivers/iio/accel/mma8452.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
index e8e2077c7244..13ea1ea23328 100644
--- a/drivers/iio/accel/mma8452.c
+++ b/drivers/iio/accel/mma8452.c
@@ -557,21 +557,21 @@ static void mma8452_transient_interrupt(struct iio_dev *indio_dev)
557 if (src & MMA8452_TRANSIENT_SRC_XTRANSE) 557 if (src & MMA8452_TRANSIENT_SRC_XTRANSE)
558 iio_push_event(indio_dev, 558 iio_push_event(indio_dev,
559 IIO_MOD_EVENT_CODE(IIO_ACCEL, 0, IIO_MOD_X, 559 IIO_MOD_EVENT_CODE(IIO_ACCEL, 0, IIO_MOD_X,
560 IIO_EV_TYPE_THRESH, 560 IIO_EV_TYPE_MAG,
561 IIO_EV_DIR_RISING), 561 IIO_EV_DIR_RISING),
562 ts); 562 ts);
563 563
564 if (src & MMA8452_TRANSIENT_SRC_YTRANSE) 564 if (src & MMA8452_TRANSIENT_SRC_YTRANSE)
565 iio_push_event(indio_dev, 565 iio_push_event(indio_dev,
566 IIO_MOD_EVENT_CODE(IIO_ACCEL, 0, IIO_MOD_Y, 566 IIO_MOD_EVENT_CODE(IIO_ACCEL, 0, IIO_MOD_Y,
567 IIO_EV_TYPE_THRESH, 567 IIO_EV_TYPE_MAG,
568 IIO_EV_DIR_RISING), 568 IIO_EV_DIR_RISING),
569 ts); 569 ts);
570 570
571 if (src & MMA8452_TRANSIENT_SRC_ZTRANSE) 571 if (src & MMA8452_TRANSIENT_SRC_ZTRANSE)
572 iio_push_event(indio_dev, 572 iio_push_event(indio_dev,
573 IIO_MOD_EVENT_CODE(IIO_ACCEL, 0, IIO_MOD_Z, 573 IIO_MOD_EVENT_CODE(IIO_ACCEL, 0, IIO_MOD_Z,
574 IIO_EV_TYPE_THRESH, 574 IIO_EV_TYPE_MAG,
575 IIO_EV_DIR_RISING), 575 IIO_EV_DIR_RISING),
576 ts); 576 ts);
577} 577}
@@ -644,7 +644,7 @@ static int mma8452_reg_access_dbg(struct iio_dev *indio_dev,
644 644
645static const struct iio_event_spec mma8452_transient_event[] = { 645static const struct iio_event_spec mma8452_transient_event[] = {
646 { 646 {
647 .type = IIO_EV_TYPE_THRESH, 647 .type = IIO_EV_TYPE_MAG,
648 .dir = IIO_EV_DIR_RISING, 648 .dir = IIO_EV_DIR_RISING,
649 .mask_separate = BIT(IIO_EV_INFO_ENABLE), 649 .mask_separate = BIT(IIO_EV_INFO_ENABLE),
650 .mask_shared_by_type = BIT(IIO_EV_INFO_VALUE) | 650 .mask_shared_by_type = BIT(IIO_EV_INFO_VALUE) |