linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3]  docs: abi: iio: RFC: Request to add event when offsets calculated by sensorhub change
@ 2020-09-01  3:00 Gwendal Grignou
  2020-09-01  3:00 ` [PATCH v2 1/3] Documentation: ABI: iio: Use What: consistently Gwendal Grignou
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Gwendal Grignou @ 2020-09-01  3:00 UTC (permalink / raw)
  To: jic23, lars, peress, enric.balletbo; +Cc: linux-iio, Gwendal Grignou

Some sensor hubs calculate offsets for some sensors, like hard or
soft iron for magnetometer, or drift for gyroscope (in addition to
factory calibration).
However, the user space application is not aware when the sensorhub
produces a new set of values. Instead of polling at regular interval,
iio driver could send an event when a new offset vector is available.

Gwendal Grignou (3):
  Documentation: ABI: iio: Use What: consistently
  Documentation: ABI: iio: Add offsets for some sensors
  Documentation: ABI: iio: Add event when offset/scale changes

 Documentation/ABI/testing/sysfs-bus-iio | 80 +++++++++++++++++--------
 1 file changed, 56 insertions(+), 24 deletions(-)

-- 
2.28.0.402.g5ffc5be6b7-goog


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 1/3] Documentation: ABI: iio: Use What: consistently
  2020-09-01  3:00 [PATCH v2 0/3] docs: abi: iio: RFC: Request to add event when offsets calculated by sensorhub change Gwendal Grignou
@ 2020-09-01  3:00 ` Gwendal Grignou
  2020-09-06 15:24   ` Jonathan Cameron
  2020-09-01  3:00 ` [PATCH v2 2/3] Documentation: ABI: iio: Add offsets for some sensors Gwendal Grignou
  2020-09-01  3:00 ` [PATCH v2 3/3] Documentation: ABI: iio: Add event when offset/scale changes Gwendal Grignou
  2 siblings, 1 reply; 7+ messages in thread
From: Gwendal Grignou @ 2020-09-01  3:00 UTC (permalink / raw)
  To: jic23, lars, peress, enric.balletbo; +Cc: linux-iio, Gwendal Grignou

Change "[w|W]hat[:| ]" to What: for consistency.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
---
No changes since v1
 Documentation/ABI/testing/sysfs-bus-iio | 48 ++++++++++++-------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
index c3767d4d01a6f..47df16c87862d 100644
--- a/Documentation/ABI/testing/sysfs-bus-iio
+++ b/Documentation/ABI/testing/sysfs-bus-iio
@@ -401,21 +401,21 @@ Description:
 		Hardware applied calibration offset (assumed to fix production
 		inaccuracies).
 
-What		/sys/bus/iio/devices/iio:deviceX/in_voltageY_calibscale
-What		/sys/bus/iio/devices/iio:deviceX/in_voltageY_supply_calibscale
-What		/sys/bus/iio/devices/iio:deviceX/in_voltageY_i_calibscale
-What		/sys/bus/iio/devices/iio:deviceX/in_voltageY_q_calibscale
-What		/sys/bus/iio/devices/iio:deviceX/in_voltage_i_calibscale
-What		/sys/bus/iio/devices/iio:deviceX/in_voltage_q_calibscale
-What		/sys/bus/iio/devices/iio:deviceX/in_voltage_calibscale
-What		/sys/bus/iio/devices/iio:deviceX/in_accel_x_calibscale
-What		/sys/bus/iio/devices/iio:deviceX/in_accel_y_calibscale
-What		/sys/bus/iio/devices/iio:deviceX/in_accel_z_calibscale
-What		/sys/bus/iio/devices/iio:deviceX/in_anglvel_x_calibscale
-What		/sys/bus/iio/devices/iio:deviceX/in_anglvel_y_calibscale
-What		/sys/bus/iio/devices/iio:deviceX/in_anglvel_z_calibscale
-what		/sys/bus/iio/devices/iio:deviceX/in_illuminance0_calibscale
-what		/sys/bus/iio/devices/iio:deviceX/in_proximity0_calibscale
+What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_calibscale
+What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_supply_calibscale
+What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_i_calibscale
+What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_q_calibscale
+What:		/sys/bus/iio/devices/iio:deviceX/in_voltage_i_calibscale
+What:		/sys/bus/iio/devices/iio:deviceX/in_voltage_q_calibscale
+What:		/sys/bus/iio/devices/iio:deviceX/in_voltage_calibscale
+What:		/sys/bus/iio/devices/iio:deviceX/in_accel_x_calibscale
+What:		/sys/bus/iio/devices/iio:deviceX/in_accel_y_calibscale
+What:		/sys/bus/iio/devices/iio:deviceX/in_accel_z_calibscale
+What:		/sys/bus/iio/devices/iio:deviceX/in_anglvel_x_calibscale
+What:		/sys/bus/iio/devices/iio:deviceX/in_anglvel_y_calibscale
+What:		/sys/bus/iio/devices/iio:deviceX/in_anglvel_z_calibscale
+What:		/sys/bus/iio/devices/iio:deviceX/in_illuminance0_calibscale
+What:		/sys/bus/iio/devices/iio:deviceX/in_proximity0_calibscale
 What:		/sys/bus/iio/devices/iio:deviceX/in_pressureY_calibscale
 What:		/sys/bus/iio/devices/iio:deviceX/in_pressure_calibscale
 What:		/sys/bus/iio/devices/iio:deviceX/in_illuminance_calibscale
@@ -483,7 +483,7 @@ Description:
 		If a discrete set of scale values is available, they
 		are listed in this attribute.
 
-What		/sys/bus/iio/devices/iio:deviceX/out_voltageY_hardwaregain
+What:		/sys/bus/iio/devices/iio:deviceX/out_voltageY_hardwaregain
 What:		/sys/bus/iio/devices/iio:deviceX/in_intensity_red_hardwaregain
 What:		/sys/bus/iio/devices/iio:deviceX/in_intensity_green_hardwaregain
 What:		/sys/bus/iio/devices/iio:deviceX/in_intensity_blue_hardwaregain
@@ -750,9 +750,9 @@ What:		/sys/.../events/in_voltageY_raw_thresh_falling_value
 What:		/sys/.../events/in_tempY_raw_thresh_rising_value
 What:		/sys/.../events/in_tempY_raw_thresh_falling_value
 What:		/sys/.../events/in_illuminance0_thresh_falling_value
-what:		/sys/.../events/in_illuminance0_thresh_rising_value
-what:		/sys/.../events/in_proximity0_thresh_falling_value
-what:		/sys/.../events/in_proximity0_thresh_rising_value
+What:		/sys/.../events/in_illuminance0_thresh_rising_value
+What:		/sys/.../events/in_proximity0_thresh_falling_value
+What:		/sys/.../events/in_proximity0_thresh_rising_value
 KernelVersion:	2.6.37
 Contact:	linux-iio@vger.kernel.org
 Description:
@@ -830,11 +830,11 @@ What:		/sys/.../events/in_tempY_thresh_rising_hysteresis
 What:		/sys/.../events/in_tempY_thresh_falling_hysteresis
 What:		/sys/.../events/in_tempY_thresh_either_hysteresis
 What:		/sys/.../events/in_illuminance0_thresh_falling_hysteresis
-what:		/sys/.../events/in_illuminance0_thresh_rising_hysteresis
-what:		/sys/.../events/in_illuminance0_thresh_either_hysteresis
-what:		/sys/.../events/in_proximity0_thresh_falling_hysteresis
-what:		/sys/.../events/in_proximity0_thresh_rising_hysteresis
-what:		/sys/.../events/in_proximity0_thresh_either_hysteresis
+What:		/sys/.../events/in_illuminance0_thresh_rising_hysteresis
+What:		/sys/.../events/in_illuminance0_thresh_either_hysteresis
+What:		/sys/.../events/in_proximity0_thresh_falling_hysteresis
+What:		/sys/.../events/in_proximity0_thresh_rising_hysteresis
+What:		/sys/.../events/in_proximity0_thresh_either_hysteresis
 KernelVersion:	3.13
 Contact:	linux-iio@vger.kernel.org
 Description:
-- 
2.28.0.402.g5ffc5be6b7-goog


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 2/3] Documentation: ABI: iio: Add offsets for some sensors
  2020-09-01  3:00 [PATCH v2 0/3] docs: abi: iio: RFC: Request to add event when offsets calculated by sensorhub change Gwendal Grignou
  2020-09-01  3:00 ` [PATCH v2 1/3] Documentation: ABI: iio: Use What: consistently Gwendal Grignou
@ 2020-09-01  3:00 ` Gwendal Grignou
  2020-09-06 15:38   ` Jonathan Cameron
  2020-09-01  3:00 ` [PATCH v2 3/3] Documentation: ABI: iio: Add event when offset/scale changes Gwendal Grignou
  2 siblings, 1 reply; 7+ messages in thread
From: Gwendal Grignou @ 2020-09-01  3:00 UTC (permalink / raw)
  To: jic23, lars, peress, enric.balletbo; +Cc: linux-iio, Gwendal Grignou

Add offsets for magnetometer and gyroscope.
They can be use to represent online calibration to offset
hard iron or drift.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
---
Changes since v1:
- New, split from 3/3 patch.
 Documentation/ABI/testing/sysfs-bus-iio | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
index 47df16c87862d..f77aee8886c66 100644
--- a/Documentation/ABI/testing/sysfs-bus-iio
+++ b/Documentation/ABI/testing/sysfs-bus-iio
@@ -1716,3 +1716,22 @@ Description:
 		Mass concentration reading of particulate matter in ug / m3.
 		pmX consists of particles with aerodynamic diameter less or
 		equal to X micrometers.
+
+What:		/sys/bus/iio/devices/iio:deviceX/in_anglvel_x_offset
+What:		/sys/bus/iio/devices/iio:deviceX/in_anglvel_y_offset
+What:		/sys/bus/iio/devices/iio:deviceX/in_anglvel_z_offset
+KernelVersion:	x.y
+Contact:	linux-iio@vger.kernel.org
+Description:
+		Gyroscope drift calculated by the sensor. In addition to factory
+		calibration, sensor or sensorhub can
+		detect gyroscope drift and report it to userspace.
+
+What:		/sys/bus/iio/devices/iio:deviceX/in_magn_x_offset
+What:		/sys/bus/iio/devices/iio:deviceX/in_magn_y_offset
+What:		/sys/bus/iio/devices/iio:deviceX/in_magn_z_offset
+KernelVersion:	x.y
+Contact:	linux-iio@vger.kernel.org
+Description:
+		Hard Iron bias calculated by the sensor or sensorhub. To be applied by
+		user space application to the raw data to obtain the geomagnetic field.
-- 
2.28.0.402.g5ffc5be6b7-goog


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 3/3] Documentation: ABI: iio: Add event when offset/scale changes
  2020-09-01  3:00 [PATCH v2 0/3] docs: abi: iio: RFC: Request to add event when offsets calculated by sensorhub change Gwendal Grignou
  2020-09-01  3:00 ` [PATCH v2 1/3] Documentation: ABI: iio: Use What: consistently Gwendal Grignou
  2020-09-01  3:00 ` [PATCH v2 2/3] Documentation: ABI: iio: Add offsets for some sensors Gwendal Grignou
@ 2020-09-01  3:00 ` Gwendal Grignou
  2020-09-06 15:31   ` Jonathan Cameron
  2 siblings, 1 reply; 7+ messages in thread
From: Gwendal Grignou @ 2020-09-01  3:00 UTC (permalink / raw)
  To: jic23, lars, peress, enric.balletbo; +Cc: linux-iio, Gwendal Grignou

Some sensors/sensorhubs can calculate drift or hard iron offsets to
apply to raw data to get the true measure data.
These offsets are applied by the user space application.
When these offsets change, events are raised to tell the application
to update the cached offset values.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
---
Changes since v1:
- Define metadata_en instead of offset/scale_en to limit race
  conditions.
 Documentation/ABI/testing/sysfs-bus-iio | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
index f77aee8886c66..45f456de1621a 100644
--- a/Documentation/ABI/testing/sysfs-bus-iio
+++ b/Documentation/ABI/testing/sysfs-bus-iio
@@ -1735,3 +1735,16 @@ Contact:	linux-iio@vger.kernel.org
 Description:
 		Hard Iron bias calculated by the sensor or sensorhub. To be applied by
 		user space application to the raw data to obtain the geomagnetic field.
+
+What:		/sys/.../iio:deviceX/events/in_accel_metadata_change_en
+What:		/sys/.../iio:deviceX/events/in_magn_metadata_change_en
+What:		/sys/.../iio:deviceX/events/in_anglvel_metadata_change_en
+KernelVersion:	x.y
+Contact:	linux-iio@vger.kernel.org
+Description:
+		Some sensors internally calculate offset to apply to remove bias (for
+		instance, hard/soft-iron bias for magnetometer, online calibration bias for
+		gyroscope or accelerometer).
+		When the sensor computes a new set of offset values, it generates an
+		event for the userspace application to refresh the offsets to apply to raw
+		data.
-- 
2.28.0.402.g5ffc5be6b7-goog


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 1/3] Documentation: ABI: iio: Use What: consistently
  2020-09-01  3:00 ` [PATCH v2 1/3] Documentation: ABI: iio: Use What: consistently Gwendal Grignou
@ 2020-09-06 15:24   ` Jonathan Cameron
  0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2020-09-06 15:24 UTC (permalink / raw)
  To: Gwendal Grignou; +Cc: lars, peress, enric.balletbo, linux-iio

On Mon, 31 Aug 2020 20:00:15 -0700
Gwendal Grignou <gwendal@chromium.org> wrote:

> Change "[w|W]hat[:| ]" to What: for consistency.
> 
> Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
> ---
> No changes since v1
Already applied from v1

Jonathan

>  Documentation/ABI/testing/sysfs-bus-iio | 48 ++++++++++++-------------
>  1 file changed, 24 insertions(+), 24 deletions(-)
> 
> diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
> index c3767d4d01a6f..47df16c87862d 100644
> --- a/Documentation/ABI/testing/sysfs-bus-iio
> +++ b/Documentation/ABI/testing/sysfs-bus-iio
> @@ -401,21 +401,21 @@ Description:
>  		Hardware applied calibration offset (assumed to fix production
>  		inaccuracies).
>  
> -What		/sys/bus/iio/devices/iio:deviceX/in_voltageY_calibscale
> -What		/sys/bus/iio/devices/iio:deviceX/in_voltageY_supply_calibscale
> -What		/sys/bus/iio/devices/iio:deviceX/in_voltageY_i_calibscale
> -What		/sys/bus/iio/devices/iio:deviceX/in_voltageY_q_calibscale
> -What		/sys/bus/iio/devices/iio:deviceX/in_voltage_i_calibscale
> -What		/sys/bus/iio/devices/iio:deviceX/in_voltage_q_calibscale
> -What		/sys/bus/iio/devices/iio:deviceX/in_voltage_calibscale
> -What		/sys/bus/iio/devices/iio:deviceX/in_accel_x_calibscale
> -What		/sys/bus/iio/devices/iio:deviceX/in_accel_y_calibscale
> -What		/sys/bus/iio/devices/iio:deviceX/in_accel_z_calibscale
> -What		/sys/bus/iio/devices/iio:deviceX/in_anglvel_x_calibscale
> -What		/sys/bus/iio/devices/iio:deviceX/in_anglvel_y_calibscale
> -What		/sys/bus/iio/devices/iio:deviceX/in_anglvel_z_calibscale
> -what		/sys/bus/iio/devices/iio:deviceX/in_illuminance0_calibscale
> -what		/sys/bus/iio/devices/iio:deviceX/in_proximity0_calibscale
> +What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_calibscale
> +What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_supply_calibscale
> +What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_i_calibscale
> +What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_q_calibscale
> +What:		/sys/bus/iio/devices/iio:deviceX/in_voltage_i_calibscale
> +What:		/sys/bus/iio/devices/iio:deviceX/in_voltage_q_calibscale
> +What:		/sys/bus/iio/devices/iio:deviceX/in_voltage_calibscale
> +What:		/sys/bus/iio/devices/iio:deviceX/in_accel_x_calibscale
> +What:		/sys/bus/iio/devices/iio:deviceX/in_accel_y_calibscale
> +What:		/sys/bus/iio/devices/iio:deviceX/in_accel_z_calibscale
> +What:		/sys/bus/iio/devices/iio:deviceX/in_anglvel_x_calibscale
> +What:		/sys/bus/iio/devices/iio:deviceX/in_anglvel_y_calibscale
> +What:		/sys/bus/iio/devices/iio:deviceX/in_anglvel_z_calibscale
> +What:		/sys/bus/iio/devices/iio:deviceX/in_illuminance0_calibscale
> +What:		/sys/bus/iio/devices/iio:deviceX/in_proximity0_calibscale
>  What:		/sys/bus/iio/devices/iio:deviceX/in_pressureY_calibscale
>  What:		/sys/bus/iio/devices/iio:deviceX/in_pressure_calibscale
>  What:		/sys/bus/iio/devices/iio:deviceX/in_illuminance_calibscale
> @@ -483,7 +483,7 @@ Description:
>  		If a discrete set of scale values is available, they
>  		are listed in this attribute.
>  
> -What		/sys/bus/iio/devices/iio:deviceX/out_voltageY_hardwaregain
> +What:		/sys/bus/iio/devices/iio:deviceX/out_voltageY_hardwaregain
>  What:		/sys/bus/iio/devices/iio:deviceX/in_intensity_red_hardwaregain
>  What:		/sys/bus/iio/devices/iio:deviceX/in_intensity_green_hardwaregain
>  What:		/sys/bus/iio/devices/iio:deviceX/in_intensity_blue_hardwaregain
> @@ -750,9 +750,9 @@ What:		/sys/.../events/in_voltageY_raw_thresh_falling_value
>  What:		/sys/.../events/in_tempY_raw_thresh_rising_value
>  What:		/sys/.../events/in_tempY_raw_thresh_falling_value
>  What:		/sys/.../events/in_illuminance0_thresh_falling_value
> -what:		/sys/.../events/in_illuminance0_thresh_rising_value
> -what:		/sys/.../events/in_proximity0_thresh_falling_value
> -what:		/sys/.../events/in_proximity0_thresh_rising_value
> +What:		/sys/.../events/in_illuminance0_thresh_rising_value
> +What:		/sys/.../events/in_proximity0_thresh_falling_value
> +What:		/sys/.../events/in_proximity0_thresh_rising_value
>  KernelVersion:	2.6.37
>  Contact:	linux-iio@vger.kernel.org
>  Description:
> @@ -830,11 +830,11 @@ What:		/sys/.../events/in_tempY_thresh_rising_hysteresis
>  What:		/sys/.../events/in_tempY_thresh_falling_hysteresis
>  What:		/sys/.../events/in_tempY_thresh_either_hysteresis
>  What:		/sys/.../events/in_illuminance0_thresh_falling_hysteresis
> -what:		/sys/.../events/in_illuminance0_thresh_rising_hysteresis
> -what:		/sys/.../events/in_illuminance0_thresh_either_hysteresis
> -what:		/sys/.../events/in_proximity0_thresh_falling_hysteresis
> -what:		/sys/.../events/in_proximity0_thresh_rising_hysteresis
> -what:		/sys/.../events/in_proximity0_thresh_either_hysteresis
> +What:		/sys/.../events/in_illuminance0_thresh_rising_hysteresis
> +What:		/sys/.../events/in_illuminance0_thresh_either_hysteresis
> +What:		/sys/.../events/in_proximity0_thresh_falling_hysteresis
> +What:		/sys/.../events/in_proximity0_thresh_rising_hysteresis
> +What:		/sys/.../events/in_proximity0_thresh_either_hysteresis
>  KernelVersion:	3.13
>  Contact:	linux-iio@vger.kernel.org
>  Description:


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 3/3] Documentation: ABI: iio: Add event when offset/scale changes
  2020-09-01  3:00 ` [PATCH v2 3/3] Documentation: ABI: iio: Add event when offset/scale changes Gwendal Grignou
@ 2020-09-06 15:31   ` Jonathan Cameron
  0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2020-09-06 15:31 UTC (permalink / raw)
  To: Gwendal Grignou; +Cc: lars, peress, enric.balletbo, linux-iio

On Mon, 31 Aug 2020 20:00:17 -0700
Gwendal Grignou <gwendal@chromium.org> wrote:

> Some sensors/sensorhubs can calculate drift or hard iron offsets to
> apply to raw data to get the true measure data.
> These offsets are applied by the user space application.
> When these offsets change, events are raised to tell the application
> to update the cached offset values.
> 
> Signed-off-by: Gwendal Grignou <gwendal@chromium.org>

I'm fine with this, but would like to give a bit more time for others to
comment.  Also you left the version number as wild cards.
I guess I can fix that, but I've been known to miss such things
so better to be optimistic and put in 5.10.

However I don't really want to see ABI without a user so I'd rather 
see this patch alongside the driver update.

Thanks,

Jonathan

> ---
> Changes since v1:
> - Define metadata_en instead of offset/scale_en to limit race
>   conditions.
>  Documentation/ABI/testing/sysfs-bus-iio | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
> index f77aee8886c66..45f456de1621a 100644
> --- a/Documentation/ABI/testing/sysfs-bus-iio
> +++ b/Documentation/ABI/testing/sysfs-bus-iio
> @@ -1735,3 +1735,16 @@ Contact:	linux-iio@vger.kernel.org
>  Description:
>  		Hard Iron bias calculated by the sensor or sensorhub. To be applied by
>  		user space application to the raw data to obtain the geomagnetic field.
> +
> +What:		/sys/.../iio:deviceX/events/in_accel_metadata_change_en
> +What:		/sys/.../iio:deviceX/events/in_magn_metadata_change_en
> +What:		/sys/.../iio:deviceX/events/in_anglvel_metadata_change_en

I've just been looking at existing naming of events and thinking about whether
we should have a space between metadata and change. From a human readabilty
point of view it would be nice, but from a parsability viewpoint possibly not.

We do have precedent though for such a space (even if we wouldn't have done
it today) in thresh_adaptive and mag_adaptive (see industrialio-event.c) so
I guess one more probably doesn't hurt too much.


> +KernelVersion:	x.y

Be an optimist for patches like this and put the next cycle in there. That's
better than some maintainers just picking it up with wild cards :)

> +Contact:	linux-iio@vger.kernel.org
> +Description:
> +		Some sensors internally calculate offset to apply to remove bias (for
> +		instance, hard/soft-iron bias for magnetometer, online calibration bias for
> +		gyroscope or accelerometer).
> +		When the sensor computes a new set of offset values, it generates an
> +		event for the userspace application to refresh the offsets to apply to raw
> +		data.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 2/3] Documentation: ABI: iio: Add offsets for some sensors
  2020-09-01  3:00 ` [PATCH v2 2/3] Documentation: ABI: iio: Add offsets for some sensors Gwendal Grignou
@ 2020-09-06 15:38   ` Jonathan Cameron
  0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2020-09-06 15:38 UTC (permalink / raw)
  To: Gwendal Grignou; +Cc: lars, peress, enric.balletbo, linux-iio

On Mon, 31 Aug 2020 20:00:16 -0700
Gwendal Grignou <gwendal@chromium.org> wrote:

> Add offsets for magnetometer and gyroscope.
> They can be use to represent online calibration to offset
> hard iron or drift.
> 
> Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
For these, please put them after the catchall offset block.
It's probably also worth moving the
in_magn_offset from the catch all to this specific one.

Have a go at figuring out when these were introduced as ABI
as well and fill in the version number.

Thanks,

Jonathan

> ---
> Changes since v1:
> - New, split from 3/3 patch.
>  Documentation/ABI/testing/sysfs-bus-iio | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
> index 47df16c87862d..f77aee8886c66 100644
> --- a/Documentation/ABI/testing/sysfs-bus-iio
> +++ b/Documentation/ABI/testing/sysfs-bus-iio
> @@ -1716,3 +1716,22 @@ Description:
>  		Mass concentration reading of particulate matter in ug / m3.
>  		pmX consists of particles with aerodynamic diameter less or
>  		equal to X micrometers.
> +
> +What:		/sys/bus/iio/devices/iio:deviceX/in_anglvel_x_offset
> +What:		/sys/bus/iio/devices/iio:deviceX/in_anglvel_y_offset
> +What:		/sys/bus/iio/devices/iio:deviceX/in_anglvel_z_offset
> +KernelVersion:	x.y
> +Contact:	linux-iio@vger.kernel.org
> +Description:
> +		Gyroscope drift calculated by the sensor. In addition to factory
> +		calibration, sensor or sensorhub can
> +		detect gyroscope drift and report it to userspace.
> +
> +What:		/sys/bus/iio/devices/iio:deviceX/in_magn_x_offset
> +What:		/sys/bus/iio/devices/iio:deviceX/in_magn_y_offset
> +What:		/sys/bus/iio/devices/iio:deviceX/in_magn_z_offset
> +KernelVersion:	x.y
> +Contact:	linux-iio@vger.kernel.org
> +Description:
> +		Hard Iron bias calculated by the sensor or sensorhub. To be applied by
> +		user space application to the raw data to obtain the geomagnetic field.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-09-06 15:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-01  3:00 [PATCH v2 0/3] docs: abi: iio: RFC: Request to add event when offsets calculated by sensorhub change Gwendal Grignou
2020-09-01  3:00 ` [PATCH v2 1/3] Documentation: ABI: iio: Use What: consistently Gwendal Grignou
2020-09-06 15:24   ` Jonathan Cameron
2020-09-01  3:00 ` [PATCH v2 2/3] Documentation: ABI: iio: Add offsets for some sensors Gwendal Grignou
2020-09-06 15:38   ` Jonathan Cameron
2020-09-01  3:00 ` [PATCH v2 3/3] Documentation: ABI: iio: Add event when offset/scale changes Gwendal Grignou
2020-09-06 15:31   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).