[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250525140951.37039f49@jic23-huawei>
Date: Sun, 25 May 2025 14:09:51 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Lothar Rubusch <l.rubusch@...il.com>
Cc: dlechner@...libre.com, nuno.sa@...log.com, andy@...nel.org,
corbet@....net, lucas.p.stankus@...il.com, lars@...afoo.de,
Michael.Hennerich@...log.com, linux-iio@...r.kernel.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 09/12] iio: accel: adxl313: add activity sensing
m adxl313_chans {
> chan_x, chan_y, chan_z,
> };
> @@ -238,6 +264,14 @@ static const struct iio_chan_spec adxl313_channels[] = {
> ADXL313_ACCEL_CHANNEL(0, chan_x, X),
> ADXL313_ACCEL_CHANNEL(1, chan_y, Y),
> ADXL313_ACCEL_CHANNEL(2, chan_z, Z),
> + {
> + .type = IIO_ACCEL,
> + .modified = 1,
> + .channel2 = IIO_MOD_X_AND_Y_AND_Z,
I'm confused. If this is for activity it would be very unusual for it
to be X&Y&Z.
"A setting of 1 enables x-, y-, or z-axis participation in detecting
activity or inactivity. A setting of 0 excludes the selected axis from
participation. If all axes are excluded, the function is disabled. For
activity detection, all participating axes are logically OR’ed, causing
the activity function to trigger when any of the participating axes
exceeds the threshold. For inactivity detection, all participating axes
are logically AND’ed, causing the inactivity function to trigger only
if all participating axes are below the threshold for the specified
period of time."
Which matches with what I'd expect.
> + .scan_index = -1, /* Fake channel for axis AND'ing */
> + .event_spec = adxl313_fake_chan_events,
> + .num_event_specs = ARRAY_SIZE(adxl313_fake_chan_events),
> + },
> };
>
> static const unsigned long adxl313_scan_masks[] = {
> @@ -300,6 +334,60 @@ static int adxl313_read_freq_avail(struct iio_dev *indio_dev,
> }
> }
Powered by blists - more mailing lists