[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250614150453.0d249c67@jic23-huawei>
Date: Sat, 14 Jun 2025 15:04:53 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Lothar Rubusch <l.rubusch@...il.com>
Cc: lars@...afoo.de, Michael.Hennerich@...log.com, dlechner@...libre.com,
nuno.sa@...log.com, andy@...nel.org, corbet@....net,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, eraretuya@...il.com
Subject: Re: [PATCH v9 09/11] iio: accel: adxl345: add coupling detection
for activity/inactivity
On Tue, 10 Jun 2025 21:59:31 +0000
Lothar Rubusch <l.rubusch@...il.com> wrote:
> Add adaptive coupling activity/inactivity detection by setting the AC/DC
> bit. This is an additional configuration to the activity and inactivity
> magnitude events, respectively. DC-coupled event generation takes the
> configured threshold values directly, where AC-coupled event generation
> references to the acceleration value at the start of the activity
> detection. New samples of acceleration are then compared to this
> reference.
>
> Both types are implemented using MAG for DC-coupled activity/inactivity,
> but MAG_ADAPTIVE for AC-coupled activity inactivity events. Threshold and
> periods can be configured by different sysfs handles, but share the same
> registers at the sensor. Therefore activity and inactivity,
> respectively, cannot be configured with AC- and DC-coupling at the same
> time, e.g. configuring DC-coupled and AC-coupled activity will result in
> AC-coupled activity, or generally the most recent one being configured.
>
> This patch implicitly regroups adxl345_read/write_event_value() and
> adxl345_read/write_event_config() where now redundant parts, due to
> similar event handling for AC-coupling, are moved to a separate function
> adxl345_read/write_mag_config() and adxl345_read/write_mag_value(),
> respectively.
Can we introduce these helpers before this patch? It has become rather
hard to read with the code movement and new stuff combined.
Thanks
Jonathan
Powered by blists - more mailing lists