Re: [PATCH] arm64: dts: sun50i-a64-pinephone: Add mount matrix for accelerometer

From: Dragan Simic
Date: Thu Sep 19 2024 - 14:34:55 EST


Hello Andrey,

On 2024-09-18 17:58, Andrey Skvortsov wrote:
On 24-09-18 16:41, Andrey Skvortsov wrote:
On 24-09-18 13:27, Dragan Simic wrote:

> > In device tree mount-matrix documentation [3] there is
> >
> > users would likely expect a value of 9.81 m/s^2 upwards along the (z)
> > axis, i.e. out of the screen when the device is held with its screen
> > flat on the planets surface.
> >

how I read kernel documentation.

Hm, I think I misunderstand this part in kernel
documentation and you were correct.

Picture 2.

up

+--------+
! !
++++++++++
!
!
v
gravity, Z

down

Screen (drawn as ++++++++++) is looking downwards ("its screen flat on
the planets surface"). Gravity and Z axis point into the same
direction and it's expected to read positive value.

Sorry, for the noise.

Oh, no worries at all. It's always good to discuss and iron out
any kinks, to eliminate any possible doubt.

The entire concept of how the values on the z-axis are read is
a bit confusing indeed. When the device is stationary on a level
surface, with the screen pointing upwards, it's like the device is
defying the Earth's gravity pull. Well, not actually the device,
but the surface it's resting on, :) but you get the point.

Actually, unless my analysis is proven wrong, perhaps it would
be better if I'd submit this patch in its final form, because it
has diverged a lot from the original patch. IIUC, Ondrej only
imported the original patch from somewhere, without some kind of
proper attribution. [4]

please, submit your version of this patch. I'd be glad to review it (I
think, I've already did)

Yes, you basically already did that. :) Thanks, I'll send my version
of the patch in the next few hours, with proper attribution included
for you and Ondrej, of course.

[1] https://rimgo.reallyaweso.me/vrBXQPq.png
[2] https://rimgo.reallyaweso.me/uTmT1pr.png
[3] https://www.kernel.org/doc/Documentation/devicetree/bindings/iio/mount-matrix.txt

[4] https://xff.cz/kernels/6.9/patches/0221-arm64-dts-sun50i-a64-pinephone-Add-mount-matrix-for-.patch