* [PATCH] ARM: dts: omap3-n900: correct the accelerometer orientation
@ 2024-07-22 11:31 Sicelo A. Mhlongo
2024-07-27 18:41 ` Sicelo
2024-08-05 18:08 ` Kevin Hilman
0 siblings, 2 replies; 6+ messages in thread
From: Sicelo A. Mhlongo @ 2024-07-22 11:31 UTC (permalink / raw)
To: tony, linux-omap
Cc: maemo-leste, robh, krzk+dt, conor+dt, devicetree,
Sicelo A. Mhlongo
Negate the values reported for the accelerometer z-axis in order to
match Documentation/devicetree/bindings/iio/mount-matrix.txt.
Fixes: 14a213dcb004 ("ARM: dts: n900: use iio driver for accelerometer")
Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
---
arch/arm/boot/dts/ti/omap/omap3-n900.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/ti/omap/omap3-n900.dts b/arch/arm/boot/dts/ti/omap/omap3-n900.dts
index 07c5b963af78..4bde3342bb95 100644
--- a/arch/arm/boot/dts/ti/omap/omap3-n900.dts
+++ b/arch/arm/boot/dts/ti/omap/omap3-n900.dts
@@ -781,7 +781,7 @@ accelerometer@1d {
mount-matrix = "-1", "0", "0",
"0", "1", "0",
- "0", "0", "1";
+ "0", "0", "-1";
};
cam1: camera@3e {
--
2.45.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] ARM: dts: omap3-n900: correct the accelerometer orientation
2024-07-22 11:31 [PATCH] ARM: dts: omap3-n900: correct the accelerometer orientation Sicelo A. Mhlongo
@ 2024-07-27 18:41 ` Sicelo
2024-07-28 8:06 ` Andreas Kemnade
2024-08-05 18:08 ` Kevin Hilman
1 sibling, 1 reply; 6+ messages in thread
From: Sicelo @ 2024-07-27 18:41 UTC (permalink / raw)
To: tony, linux-omap
Cc: maemo-leste, robh, krzk+dt, conor+dt, devicetree, Andreas Kemnade,
Aaro Koskinen
On Mon, Jul 22, 2024 at 01:31:11PM +0200, Sicelo A. Mhlongo wrote:
> Negate the values reported for the accelerometer z-axis in order to
> match Documentation/devicetree/bindings/iio/mount-matrix.txt.
>
> Fixes: 14a213dcb004 ("ARM: dts: n900: use iio driver for accelerometer")
>
> Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
> ---
> arch/arm/boot/dts/ti/omap/omap3-n900.dts | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/boot/dts/ti/omap/omap3-n900.dts b/arch/arm/boot/dts/ti/omap/omap3-n900.dts
> index 07c5b963af78..4bde3342bb95 100644
> --- a/arch/arm/boot/dts/ti/omap/omap3-n900.dts
> +++ b/arch/arm/boot/dts/ti/omap/omap3-n900.dts
> @@ -781,7 +781,7 @@ accelerometer@1d {
>
> mount-matrix = "-1", "0", "0",
> "0", "1", "0",
> - "0", "0", "1";
> + "0", "0", "-1";
> };
>
> cam1: camera@3e {
> --
> 2.45.2
>
CC: Aaro Koskinen <aaro.koskinen@iki.fi>, Andreas Kemnade <andreas@kemnade.info>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ARM: dts: omap3-n900: correct the accelerometer orientation
2024-07-27 18:41 ` Sicelo
@ 2024-07-28 8:06 ` Andreas Kemnade
2024-07-29 20:40 ` Sicelo
0 siblings, 1 reply; 6+ messages in thread
From: Andreas Kemnade @ 2024-07-28 8:06 UTC (permalink / raw)
To: Sicelo
Cc: tony, linux-omap, maemo-leste, robh, krzk+dt, conor+dt,
devicetree, Aaro Koskinen
On Sat, 27 Jul 2024 20:41:20 +0200
Sicelo <absicsz@gmail.com> wrote:
> On Mon, Jul 22, 2024 at 01:31:11PM +0200, Sicelo A. Mhlongo wrote:
> > Negate the values reported for the accelerometer z-axis in order to
> > match Documentation/devicetree/bindings/iio/mount-matrix.txt.
> >
> > Fixes: 14a213dcb004 ("ARM: dts: n900: use iio driver for
> > accelerometer")
> >
> > Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
> > ---
> > arch/arm/boot/dts/ti/omap/omap3-n900.dts | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/arm/boot/dts/ti/omap/omap3-n900.dts
> > b/arch/arm/boot/dts/ti/omap/omap3-n900.dts index
> > 07c5b963af78..4bde3342bb95 100644 ---
> > a/arch/arm/boot/dts/ti/omap/omap3-n900.dts +++
> > b/arch/arm/boot/dts/ti/omap/omap3-n900.dts @@ -781,7 +781,7 @@
> > accelerometer@1d {
> > mount-matrix = "-1", "0", "0",
> > "0", "1", "0",
> > - "0", "0", "1";
> > + "0", "0", "-1";
> > };
> >
> > cam1: camera@3e {
> > --
> > 2.45.2
> >
>
> CC: Aaro Koskinen <aaro.koskinen@iki.fi>, Andreas Kemnade
> <andreas@kemnade.info>
>
I would expect it to be a rotation matrix but it is not. So maybe this
should be fixed in,the driver?
Regards
Andreas
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ARM: dts: omap3-n900: correct the accelerometer orientation
2024-07-28 8:06 ` Andreas Kemnade
@ 2024-07-29 20:40 ` Sicelo
2024-08-01 6:14 ` Andreas Kemnade
0 siblings, 1 reply; 6+ messages in thread
From: Sicelo @ 2024-07-29 20:40 UTC (permalink / raw)
To: Andreas Kemnade
Cc: tony, linux-omap, maemo-leste, robh, krzk+dt, conor+dt,
devicetree, Aaro Koskinen
Hello Andreas
On Sun, Jul 28, 2024 at 10:06:58AM +0200, Andreas Kemnade wrote:
> > On Mon, Jul 22, 2024 at 01:31:11PM +0200, Sicelo A. Mhlongo wrote:
> > > Negate the values reported for the accelerometer z-axis in order to
> > > match Documentation/devicetree/bindings/iio/mount-matrix.txt.
> > >
> > > Fixes: 14a213dcb004 ("ARM: dts: n900: use iio driver for
> > > accelerometer")
> > >
> > > Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
> > > ---
> > > arch/arm/boot/dts/ti/omap/omap3-n900.dts | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/arch/arm/boot/dts/ti/omap/omap3-n900.dts
> > > b/arch/arm/boot/dts/ti/omap/omap3-n900.dts index
> > > 07c5b963af78..4bde3342bb95 100644 ---
> > > a/arch/arm/boot/dts/ti/omap/omap3-n900.dts +++
> > > b/arch/arm/boot/dts/ti/omap/omap3-n900.dts @@ -781,7 +781,7 @@
> > > accelerometer@1d {
> > > mount-matrix = "-1", "0", "0",
> > > "0", "1", "0",
> > > - "0", "0", "1";
> > > + "0", "0", "-1";
> > > };
> > >
> > > cam1: camera@3e {
> > > --
> > > 2.45.2
> > >
> >
> > CC: Aaro Koskinen <aaro.koskinen@iki.fi>, Andreas Kemnade
> > <andreas@kemnade.info>
> >
> I would expect it to be a rotation matrix but it is not. So maybe this
> should be fixed in,the driver?
The mount matrix is documented in the kernel docs [1], and this patch
implements the suggestion that the z-axis should "be negative under the
screen and positive in front of it, toward the face of the user."
On the N900, the accelerometer is mounted such that the raw z-values are
opposite to the specification in the kernel docs. The driver itself
seems to be correct, and is used on a number of other boards (such as
Motorola Droid 4), reporting expected values when used in conjuction with
mount matrices.
There is not a lot of userspace that uses accelerometer z-axis
information, hence I could not perform thorough testing for the z-values
when I submitted 14a213dcb004 ("ARM: dts: n900: use iio driver for
accelerometer"). The error became evident when Maemo Leste gained
support for face up and face down device states [2]. With the patch in
this thread, userspace reports correct face up/down information.
I hope I have not misunderstood your reply, and please let me know if I
am missing something.
Sicelo A. Mhlongo
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/iio/mount-matrix.txt#n31
[2] https://github.com/maemo-leste/mce/commit/0dac5a7e4286b5e9a4dafc627c49cef8cc92f092
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ARM: dts: omap3-n900: correct the accelerometer orientation
2024-07-29 20:40 ` Sicelo
@ 2024-08-01 6:14 ` Andreas Kemnade
0 siblings, 0 replies; 6+ messages in thread
From: Andreas Kemnade @ 2024-08-01 6:14 UTC (permalink / raw)
To: Sicelo
Cc: tony, linux-omap, maemo-leste, robh, krzk+dt, conor+dt,
devicetree, Aaro Koskinen
On Mon, 29 Jul 2024 22:40:22 +0200
Sicelo <absicsz@gmail.com> wrote:
> Hello Andreas
>
> On Sun, Jul 28, 2024 at 10:06:58AM +0200, Andreas Kemnade wrote:
> > > On Mon, Jul 22, 2024 at 01:31:11PM +0200, Sicelo A. Mhlongo
> > > wrote:
> > > > Negate the values reported for the accelerometer z-axis in
> > > > order to match
> > > > Documentation/devicetree/bindings/iio/mount-matrix.txt.
> > > >
> > > > Fixes: 14a213dcb004 ("ARM: dts: n900: use iio driver for
> > > > accelerometer")
> > > >
> > > > Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
> > > > ---
> > > > arch/arm/boot/dts/ti/omap/omap3-n900.dts | 2 +-
> > > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/arch/arm/boot/dts/ti/omap/omap3-n900.dts
> > > > b/arch/arm/boot/dts/ti/omap/omap3-n900.dts index
> > > > 07c5b963af78..4bde3342bb95 100644 ---
> > > > a/arch/arm/boot/dts/ti/omap/omap3-n900.dts +++
> > > > b/arch/arm/boot/dts/ti/omap/omap3-n900.dts @@ -781,7 +781,7 @@
> > > > accelerometer@1d {
> > > > mount-matrix = "-1", "0", "0",
> > > > "0", "1", "0",
> > > > - "0", "0", "1";
> > > > + "0", "0", "-1";
> > > > };
> > > >
> > > > cam1: camera@3e {
> > > > --
> > > > 2.45.2
> > > >
> > >
> > > CC: Aaro Koskinen <aaro.koskinen@iki.fi>, Andreas Kemnade
> > > <andreas@kemnade.info>
> > >
> > I would expect it to be a rotation matrix but it is not. So maybe
> > this should be fixed in,the driver?
>
> The mount matrix is documented in the kernel docs [1], and this patch
> implements the suggestion that the z-axis should "be negative under
> the screen and positive in front of it, toward the face of the user."
>
> On the N900, the accelerometer is mounted such that the raw z-values
> are opposite to the specification in the kernel docs. The driver
> itself seems to be correct, and is used on a number of other boards
> (such as Motorola Droid 4), reporting expected values when used in
> conjuction with mount matrices.
>
Ok, I did not notice the other -1. It was mirroring before and now it
is a clear 180 deg turn on the y-axis.
So
Reviewed-By: Andreas Kemnade <andreas@kemnade.info>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ARM: dts: omap3-n900: correct the accelerometer orientation
2024-07-22 11:31 [PATCH] ARM: dts: omap3-n900: correct the accelerometer orientation Sicelo A. Mhlongo
2024-07-27 18:41 ` Sicelo
@ 2024-08-05 18:08 ` Kevin Hilman
1 sibling, 0 replies; 6+ messages in thread
From: Kevin Hilman @ 2024-08-05 18:08 UTC (permalink / raw)
To: tony, linux-omap, Sicelo A. Mhlongo
Cc: maemo-leste, robh, krzk+dt, conor+dt, devicetree
On Mon, 22 Jul 2024 13:31:11 +0200, Sicelo A. Mhlongo wrote:
> Negate the values reported for the accelerometer z-axis in order to
> match Documentation/devicetree/bindings/iio/mount-matrix.txt.
>
> Fixes: 14a213dcb004 ("ARM: dts: n900: use iio driver for accelerometer")
>
>
Applied, thanks!
[1/1] ARM: dts: omap3-n900: correct the accelerometer orientation
commit: 5062d9c0cbbc202e495e9b20f147f64ef5cc2897
Best regards,
--
Kevin Hilman <khilman@baylibre.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-08-05 18:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-22 11:31 [PATCH] ARM: dts: omap3-n900: correct the accelerometer orientation Sicelo A. Mhlongo
2024-07-27 18:41 ` Sicelo
2024-07-28 8:06 ` Andreas Kemnade
2024-07-29 20:40 ` Sicelo
2024-08-01 6:14 ` Andreas Kemnade
2024-08-05 18:08 ` Kevin Hilman
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).