Thread (1 message) 1 message, 1 author, 2016-03-10

Re: [PATCH v2 4/5] iio:magnetometer:ak8975: mounting matrix support

From: Rob Herring <hidden>
Date: 2016-03-10 02:15:52
Also in: linux-iio

On Wed, Mar 9, 2016 at 2:46 PM, Jonathan Cameron [off-list ref] wrote:
On 09/03/16 10:56, Gregor Boirie wrote:
quoted
On 03/05/2016 04:36 PM, Jonathan Cameron wrote:
quoted
On 03/03/16 10:44, Gregor Boirie wrote:
quoted
Expose a rotation matrix to indicate userspace the chip placement with
respect to the overall hardware system. This is needed to adjust
coordinates sampled from a magnetometer chip when its position deviates
from the main hardware system.

Final coordinates computation is delegated to userspace since:
* computation may involve floating point arithmetics ;
* it allows an application to combine adjustments with arbitrary
   transformations.

This 3 dimentional space rotation matrix is expressed as 3x3 array of
strings to support floating point numbers. It may be retrieved from a
"in_magn_matrix" sysfs attribute file. It is declared into ak8975 DTS
entry as a "matrix" property.

Signed-off-by: Gregor Boirie <gregor.boirie-ITF29qwbsa/QT0dZR+AlfA@public.gmane.org>
This one definitely wants to go to the device tree list. I'd also like a few
IIO related comments as well. I was sure we'd been through this before and
ended up with some sort of solution, but now I can't find it... Oh well.
I took inv_mpu_core as an example. However matrices are exposed as integers
and we really need floating point support.
A search on the device-tree mailing list archive does not show up with a
solution to encode floating point numbers into DTS either.
Certainly non obvious how to do this.

For anyone device tree related who picks this up (I've added a CC)
we are basically talking about passing a rotation matrix from the device tree
straight through to userspace to describe the relative orientation of
some sensor.  An array of strings clearly works, but is this the best
way to do it?
That's probably okay. I'd format the dts and sysfs to be arranged in a
3x3 matrix rather than a linear list though, but that is just style.

However, there's nothing really preventing us from having floats in
DT. Data is not typed, so it would be a matter of adding the dtc
parsing support. The other aspect would be the limited use of float
types in the kernel (though that should not influence binding design).
Are there cases of the kernel ABI using floats?

Rob
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help