Re: [PATCH 4/6] iio: accel: bma220: add low-g event detection
From: Jonathan Cameron
Date: Sat Oct 18 2025 - 13:24:52 EST
> @@ -790,6 +884,13 @@ static irqreturn_t bma220_irq_handler(int irq, void *private)
> return IRQ_HANDLED;
> }
>
> + if (FIELD_GET(BMA220_IF_LOW, bma220_reg_if1))
> + iio_push_event(indio_dev,
> + IIO_MOD_EVENT_CODE(IIO_ACCEL, 0,
> + IIO_MOD_X_OR_Y_OR_Z,
I only noticed this when looking at next patch.
Would be unusual to have reporting on 'any' acceleration dropping below
a threshold. Tends to be all drop (which is free fall detection).
I checked the datasheet quickly and looks like this should be
IIO_MOD_X_AND_Y_AND_Z which is what we normally see for an inactivity / freefall
threshold detector.
> + IIO_EV_TYPE_THRESH,
> + IIO_EV_DIR_FALLING),
> + timestamp);
> if (FIELD_GET(BMA220_IF_TT, bma220_reg_if1)) {
>
> if (data->tap_type == BMA220_TAP_TYPE_SINGLE)
>