[PATCH v6 2/2] iio: ABI: document accelerometer event attributes

Gustavo Silva posted 2 patches 2 weeks, 1 day ago
[PATCH v6 2/2] iio: ABI: document accelerometer event attributes
Posted by Gustavo Silva 2 weeks, 1 day ago
Add ABI documentation for accelerometer event-related sysfs attributes
exposed by the bmi270 driver. These include threshold, period, and
enable controls for adaptive magnitude (any-motion) and rate of change
(no-motion) event detection.

Signed-off-by: Gustavo Silva <gustavograzs@gmail.com>
---
 Documentation/ABI/testing/sysfs-bus-iio | 34 +++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
index 2fb2cea4b19249743398b1ff0b538b03ced0340b..b45d1ba6972848a6024746d7d741146e35a55ebb 100644
--- a/Documentation/ABI/testing/sysfs-bus-iio
+++ b/Documentation/ABI/testing/sysfs-bus-iio
@@ -908,6 +908,7 @@ What:		/sys/.../iio:deviceX/events/in_accel_y_roc_rising_en
 What:		/sys/.../iio:deviceX/events/in_accel_y_roc_falling_en
 What:		/sys/.../iio:deviceX/events/in_accel_z_roc_rising_en
 What:		/sys/.../iio:deviceX/events/in_accel_z_roc_falling_en
+What:		/sys/.../iio:deviceX/events/in_accel_x&y&z_roc_rising_en
 What:		/sys/.../iio:deviceX/events/in_anglvel_x_roc_rising_en
 What:		/sys/.../iio:deviceX/events/in_anglvel_x_roc_falling_en
 What:		/sys/.../iio:deviceX/events/in_anglvel_y_roc_rising_en
@@ -991,6 +992,7 @@ What:		/sys/.../events/in_accel_y_raw_thresh_rising_value
 What:		/sys/.../events/in_accel_y_raw_thresh_falling_value
 What:		/sys/.../events/in_accel_z_raw_thresh_rising_value
 What:		/sys/.../events/in_accel_z_raw_thresh_falling_value
+What:		/sys/.../events/in_accel_mag_adaptive_rising_value
 What:		/sys/.../events/in_anglvel_x_raw_thresh_rising_value
 What:		/sys/.../events/in_anglvel_x_raw_thresh_falling_value
 What:		/sys/.../events/in_anglvel_y_raw_thresh_rising_value
@@ -1129,6 +1131,7 @@ Description:
 		will get activated once in_voltage0_raw goes above 1200 and will become
 		deactivated again once the value falls below 1150.
 
+What:		/sys/.../events/in_accel_roc_rising_value
 What:		/sys/.../events/in_accel_x_raw_roc_rising_value
 What:		/sys/.../events/in_accel_x_raw_roc_falling_value
 What:		/sys/.../events/in_accel_y_raw_roc_rising_value
@@ -1177,6 +1180,7 @@ Description:
 
 What:		/sys/.../events/in_accel_x_thresh_rising_period
 What:		/sys/.../events/in_accel_x_thresh_falling_period
+What:		/sys/.../events/in_accel_roc_rising_period
 What:		/sys/.../events/in_accel_x_roc_rising_period
 What:		/sys/.../events/in_accel_x_roc_falling_period
 What:		/sys/.../events/in_accel_y_thresh_rising_period
@@ -1187,6 +1191,7 @@ What:		/sys/.../events/in_accel_z_thresh_rising_period
 What:		/sys/.../events/in_accel_z_thresh_falling_period
 What:		/sys/.../events/in_accel_z_roc_rising_period
 What:		/sys/.../events/in_accel_z_roc_falling_period
+What:		/sys/.../events/in_accel_mag_adaptive_rising_period
 What:		/sys/.../events/in_anglvel_x_thresh_rising_period
 What:		/sys/.../events/in_anglvel_x_thresh_falling_period
 What:		/sys/.../events/in_anglvel_x_roc_rising_period
@@ -1344,6 +1349,15 @@ Description:
 		number or direction is not specified, applies to all channels of
 		this type.
 
+What:		/sys/.../iio:deviceX/events/in_accel_x_mag_adaptive_rising_en
+What:		/sys/.../iio:deviceX/events/in_accel_y_mag_adaptive_rising_en
+What:		/sys/.../iio:deviceX/events/in_accel_z_mag_adaptive_rising_en
+KernelVersion:	2.6.37
+Contact:	linux-iio@vger.kernel.org
+Description:
+		Similar to in_accel_x_thresh[_rising|_falling]_en, but here the
+		magnitude of the channel is compared to the adaptive threshold.
+
 What:		/sys/.../iio:deviceX/events/in_accel_mag_referenced_en
 What:		/sys/.../iio:deviceX/events/in_accel_mag_referenced_rising_en
 What:		/sys/.../iio:deviceX/events/in_accel_mag_referenced_falling_en
@@ -2386,3 +2400,23 @@ Description:
 		Value representing the user's attention to the system expressed
 		in units as percentage. This usually means if the user is
 		looking at the screen or not.
+
+What:		/sys/.../events/in_accel_value_available
+KernelVersion:	6.18
+Contact:	linux-iio@vger.kernel.org
+Description:
+		List of available threshold values for acceleration event
+		generation. Applies to all event types on in_accel channels.
+		Units after application of scale and offset are m/s^2.
+		Expressed as:
+
+		- a range specified as "[min step max]"
+
+What:		/sys/.../events/in_accel_period_available
+KernelVersion:	6.18
+Contact:	linux-iio@vger.kernel.org
+Description:
+		List of available periods for accelerometer event detection in
+		seconds, expressed as:
+
+		- a range specified as "[min step max]"

-- 
2.51.0
Re: [PATCH v6 2/2] iio: ABI: document accelerometer event attributes
Posted by Andy Shevchenko 2 weeks, 1 day ago
On Tue, Sep 16, 2025 at 08:38:24PM -0300, Gustavo Silva wrote:
> Add ABI documentation for accelerometer event-related sysfs attributes
> exposed by the bmi270 driver. These include threshold, period, and
> enable controls for adaptive magnitude (any-motion) and rate of change
> (no-motion) event detection.

...

> What:		/sys/.../iio:deviceX/events/in_accel_y_roc_rising_en

>  What:		/sys/.../iio:deviceX/events/in_accel_y_roc_falling_en
>  What:		/sys/.../iio:deviceX/events/in_accel_z_roc_rising_en
>  What:		/sys/.../iio:deviceX/events/in_accel_z_roc_falling_en
> +What:		/sys/.../iio:deviceX/events/in_accel_x&y&z_roc_rising_en
>  What:		/sys/.../iio:deviceX/events/in_anglvel_x_roc_rising_en
>  What:		/sys/.../iio:deviceX/events/in_anglvel_x_roc_falling_en
>  What:		/sys/.../iio:deviceX/events/in_anglvel_y_roc_rising_en

> What:		/sys/.../events/in_accel_y_raw_thresh_rising_value

>  What:		/sys/.../events/in_accel_y_raw_thresh_falling_value
>  What:		/sys/.../events/in_accel_z_raw_thresh_rising_value
>  What:		/sys/.../events/in_accel_z_raw_thresh_falling_value
> +What:		/sys/.../events/in_accel_mag_adaptive_rising_value
>  What:		/sys/.../events/in_anglvel_x_raw_thresh_rising_value
>  What:		/sys/.../events/in_anglvel_x_raw_thresh_falling_value
>  What:		/sys/.../events/in_anglvel_y_raw_thresh_rising_value

> +What:		/sys/.../events/in_accel_roc_rising_value
>  What:		/sys/.../events/in_accel_x_raw_roc_rising_value
>  What:		/sys/.../events/in_accel_x_raw_roc_falling_value
>  What:		/sys/.../events/in_accel_y_raw_roc_rising_value

>  What:		/sys/.../events/in_accel_x_thresh_rising_period
>  What:		/sys/.../events/in_accel_x_thresh_falling_period
> +What:		/sys/.../events/in_accel_roc_rising_period
>  What:		/sys/.../events/in_accel_x_roc_rising_period
>  What:		/sys/.../events/in_accel_x_roc_falling_period
>  What:		/sys/.../events/in_accel_y_thresh_rising_period

With the given context (above and below) I'm not sure this is the best place of
putting an attribute in the list. Perhaps something below will not disrupt the
xyz structure (like mag cases)?

> What:		/sys/.../events/in_accel_z_thresh_rising_period

>  What:		/sys/.../events/in_accel_z_thresh_falling_period
>  What:		/sys/.../events/in_accel_z_roc_rising_period
>  What:		/sys/.../events/in_accel_z_roc_falling_period
> +What:		/sys/.../events/in_accel_mag_adaptive_rising_period
>  What:		/sys/.../events/in_anglvel_x_thresh_rising_period
>  What:		/sys/.../events/in_anglvel_x_thresh_falling_period
>  What:		/sys/.../events/in_anglvel_x_roc_rising_period

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH v6 2/2] iio: ABI: document accelerometer event attributes
Posted by Jonathan Cameron 4 days, 19 hours ago
On Wed, 17 Sep 2025 11:47:30 +0300
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:

> On Tue, Sep 16, 2025 at 08:38:24PM -0300, Gustavo Silva wrote:
> > Add ABI documentation for accelerometer event-related sysfs attributes
> > exposed by the bmi270 driver. These include threshold, period, and
> > enable controls for adaptive magnitude (any-motion) and rate of change
> > (no-motion) event detection.  
> 
> ...
> 
> > What:		/sys/.../iio:deviceX/events/in_accel_y_roc_rising_en  
> 
> >  What:		/sys/.../iio:deviceX/events/in_accel_y_roc_falling_en
> >  What:		/sys/.../iio:deviceX/events/in_accel_z_roc_rising_en
> >  What:		/sys/.../iio:deviceX/events/in_accel_z_roc_falling_en
> > +What:		/sys/.../iio:deviceX/events/in_accel_x&y&z_roc_rising_en
> >  What:		/sys/.../iio:deviceX/events/in_anglvel_x_roc_rising_en
> >  What:		/sys/.../iio:deviceX/events/in_anglvel_x_roc_falling_en
> >  What:		/sys/.../iio:deviceX/events/in_anglvel_y_roc_rising_en  
> 
> > What:		/sys/.../events/in_accel_y_raw_thresh_rising_value  
> 
> >  What:		/sys/.../events/in_accel_y_raw_thresh_falling_value
> >  What:		/sys/.../events/in_accel_z_raw_thresh_rising_value
> >  What:		/sys/.../events/in_accel_z_raw_thresh_falling_value
> > +What:		/sys/.../events/in_accel_mag_adaptive_rising_value
> >  What:		/sys/.../events/in_anglvel_x_raw_thresh_rising_value
> >  What:		/sys/.../events/in_anglvel_x_raw_thresh_falling_value
> >  What:		/sys/.../events/in_anglvel_y_raw_thresh_rising_value  
> 
> > +What:		/sys/.../events/in_accel_roc_rising_value
> >  What:		/sys/.../events/in_accel_x_raw_roc_rising_value
> >  What:		/sys/.../events/in_accel_x_raw_roc_falling_value
> >  What:		/sys/.../events/in_accel_y_raw_roc_rising_value  
> 
> >  What:		/sys/.../events/in_accel_x_thresh_rising_period
> >  What:		/sys/.../events/in_accel_x_thresh_falling_period
> > +What:		/sys/.../events/in_accel_roc_rising_period
> >  What:		/sys/.../events/in_accel_x_roc_rising_period
> >  What:		/sys/.../events/in_accel_x_roc_falling_period
> >  What:		/sys/.../events/in_accel_y_thresh_rising_period  
> 
> With the given context (above and below) I'm not sure this is the best place of
> putting an attribute in the list. Perhaps something below will not disrupt the
> xyz structure (like mag cases)?

I took a look at the broader context and it was a bit tricky but I think this
is the best we can do to maintain current ordering (which is fuzzily defined at best).

At some point that whole doc needs a rethink wrt to how we break the different blocks
up and order the elements within them.

With this change, series applied to the testing branch of iio.git.
That will be rebased on rc1 once available and then become the togreg branch.

thanks,

Jonathan



diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
index 89b4740dcfa1..352ab7b8476c 100644
--- a/Documentation/ABI/testing/sysfs-bus-iio
+++ b/Documentation/ABI/testing/sysfs-bus-iio
@@ -926,6 +926,7 @@ What:               /sys/.../iio:deviceX/events/in_accel_y_roc_rising_en
 What:          /sys/.../iio:deviceX/events/in_accel_y_roc_falling_en
 What:          /sys/.../iio:deviceX/events/in_accel_z_roc_rising_en
 What:          /sys/.../iio:deviceX/events/in_accel_z_roc_falling_en
+What:          /sys/.../iio:deviceX/events/in_accel_x&y&z_roc_rising_en
 What:          /sys/.../iio:deviceX/events/in_anglvel_x_roc_rising_en
 What:          /sys/.../iio:deviceX/events/in_anglvel_x_roc_falling_en
 What:          /sys/.../iio:deviceX/events/in_anglvel_y_roc_rising_en
@@ -1001,6 +1002,7 @@ Description:
                to the raw signal, allowing slow tracking to resume and the
                adaptive threshold event detection to function as expected.
 
+What:          /sys/.../events/in_accel_mag_adaptive_rising_value
 What:          /sys/.../events/in_accel_thresh_rising_value
 What:          /sys/.../events/in_accel_thresh_falling_value
 What:          /sys/.../events/in_accel_x_raw_thresh_rising_value
@@ -1147,6 +1149,7 @@ Description:
                will get activated once in_voltage0_raw goes above 1200 and will become
                deactivated again once the value falls below 1150.
 
+What:          /sys/.../events/in_accel_roc_rising_value
 What:          /sys/.../events/in_accel_x_raw_roc_rising_value
 What:          /sys/.../events/in_accel_x_raw_roc_falling_value
 What:          /sys/.../events/in_accel_y_raw_roc_rising_value
@@ -1193,6 +1196,8 @@ Description:
                value is in raw device units or in processed units (as _raw
                and _input do on sysfs direct channel read attributes).
 
+What:          /sys/.../events/in_accel_mag_adaptive_rising_period
+What:          /sys/.../events/in_accel_roc_rising_period
 What:          /sys/.../events/in_accel_x_thresh_rising_period
 What:          /sys/.../events/in_accel_x_thresh_falling_period
 What:          /sys/.../events/in_accel_x_roc_rising_period
@@ -1362,6 +1367,15 @@ Description:
                number or direction is not specified, applies to all channels of
                this type.
 
+What:          /sys/.../iio:deviceX/events/in_accel_x_mag_adaptive_rising_en

t

> 
> > What:		/sys/.../events/in_accel_z_thresh_rising_period  
> 
> >  What:		/sys/.../events/in_accel_z_thresh_falling_period
> >  What:		/sys/.../events/in_accel_z_roc_rising_period
> >  What:		/sys/.../events/in_accel_z_roc_falling_period
> > +What:		/sys/.../events/in_accel_mag_adaptive_rising_period
> >  What:		/sys/.../events/in_anglvel_x_thresh_rising_period
> >  What:		/sys/.../events/in_anglvel_x_thresh_falling_period
> >  What:		/sys/.../events/in_anglvel_x_roc_rising_period  
>