Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] arm64: dts: librem5-devkit: add lsm9ds1 mount matrix
@ 2020-01-20 10:07 Martin Kepplinger
  2020-01-27  9:21 ` Martin Kepplinger
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Martin Kepplinger @ 2020-01-20 10:07 UTC (permalink / raw)
  To: robh, mark.rutland, shawnguo
  Cc: devicetree, Martin Kepplinger, linux-arm-kernel, kernel, linux-kernel

The IMU chip on the librem5-devkit is not mounted at the "natural" place
that would match normal phone orientation (see the documentation for the
details about what that is).

Since the lsm9ds1 driver supports providing a mount matrix, we can describe
the orientation on the board in the dts:

Create a right-handed coordinate system (x * -1; see the datasheet for the
axis) and rotate 180 degrees around the y axis because the device sits on
the back side from the display.

Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
---

tested on the librem5-devkit of course, finally fixing the orientation problem
for the accelerometer :)

thanks,

                            martin


 arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
index 703254282b96..6c8ab009081b 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
@@ -457,6 +457,9 @@
 		reg = <0x6a>;
 		vdd-supply = <&reg_3v3_p>;
 		vddio-supply = <&reg_3v3_p>;
+		mount-matrix =  "1",  "0",  "0",
+				"0",  "1",  "0",
+				"0",  "0", "-1";
 	};
 };
 
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: dts: librem5-devkit: add lsm9ds1 mount matrix
  2020-01-20 10:07 [PATCH] arm64: dts: librem5-devkit: add lsm9ds1 mount matrix Martin Kepplinger
@ 2020-01-27  9:21 ` Martin Kepplinger
  2020-02-03 10:19 ` Martin Kepplinger
  2020-02-03 11:05 ` Marco Felsch
  2 siblings, 0 replies; 7+ messages in thread
From: Martin Kepplinger @ 2020-01-27  9:21 UTC (permalink / raw)
  To: robh, mark.rutland, shawnguo
  Cc: devicetree, linux-arm-kernel, kernel, linux-kernel

On 20.01.20 11:07, Martin Kepplinger wrote:
> The IMU chip on the librem5-devkit is not mounted at the "natural" place
> that would match normal phone orientation (see the documentation for the
> details about what that is).
> 
> Since the lsm9ds1 driver supports providing a mount matrix, we can describe
> the orientation on the board in the dts:
> 
> Create a right-handed coordinate system (x * -1; see the datasheet for the
> axis) and rotate 180 degrees around the y axis because the device sits on
> the back side from the display.
> 
> Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
> ---
> 
> tested on the librem5-devkit of course, finally fixing the orientation problem
> for the accelerometer :)
> 
> thanks,
> 
>                             martin
> 
> 
>  arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
> index 703254282b96..6c8ab009081b 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
> +++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
> @@ -457,6 +457,9 @@
>  		reg = <0x6a>;
>  		vdd-supply = <&reg_3v3_p>;
>  		vddio-supply = <&reg_3v3_p>;
> +		mount-matrix =  "1",  "0",  "0",
> +				"0",  "1",  "0",
> +				"0",  "0", "-1";
>  	};
>  };
>  
> 

hi all. are there any questions about this addition?

thanks a lot,

                                martin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: dts: librem5-devkit: add lsm9ds1 mount matrix
  2020-01-20 10:07 [PATCH] arm64: dts: librem5-devkit: add lsm9ds1 mount matrix Martin Kepplinger
  2020-01-27  9:21 ` Martin Kepplinger
@ 2020-02-03 10:19 ` Martin Kepplinger
  2020-02-03 11:05 ` Marco Felsch
  2 siblings, 0 replies; 7+ messages in thread
From: Martin Kepplinger @ 2020-02-03 10:19 UTC (permalink / raw)
  To: robh, mark.rutland, shawnguo
  Cc: devicetree, linux-arm-kernel, kernel, linux-kernel

On 20.01.20 11:07, Martin Kepplinger wrote:
> The IMU chip on the librem5-devkit is not mounted at the "natural" place
> that would match normal phone orientation (see the documentation for the
> details about what that is).
> 
> Since the lsm9ds1 driver supports providing a mount matrix, we can describe
> the orientation on the board in the dts:
> 
> Create a right-handed coordinate system (x * -1; see the datasheet for the
> axis) and rotate 180 degrees around the y axis because the device sits on
> the back side from the display.
> 
> Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
> ---
> 
> tested on the librem5-devkit of course, finally fixing the orientation problem
> for the accelerometer :)
> 
> thanks,
> 
>                             martin
> 
> 
>  arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
> index 703254282b96..6c8ab009081b 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
> +++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
> @@ -457,6 +457,9 @@
>  		reg = <0x6a>;
>  		vdd-supply = <&reg_3v3_p>;
>  		vddio-supply = <&reg_3v3_p>;
> +		mount-matrix =  "1",  "0",  "0",
> +				"0",  "1",  "0",
> +				"0",  "0", "-1";
>  	};
>  };
>  
> 

hi,

again, any questions or comments on this fix?

thanks,
                                       martin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: dts: librem5-devkit: add lsm9ds1 mount matrix
  2020-01-20 10:07 [PATCH] arm64: dts: librem5-devkit: add lsm9ds1 mount matrix Martin Kepplinger
  2020-01-27  9:21 ` Martin Kepplinger
  2020-02-03 10:19 ` Martin Kepplinger
@ 2020-02-03 11:05 ` Marco Felsch
  2020-02-03 11:31   ` Martin Kepplinger
  2 siblings, 1 reply; 7+ messages in thread
From: Marco Felsch @ 2020-02-03 11:05 UTC (permalink / raw)
  To: Martin Kepplinger
  Cc: mark.rutland, robh, devicetree, linux-kernel, kernel, shawnguo,
	linux-arm-kernel

Hi Martin,

On 20-01-20 11:07, Martin Kepplinger wrote:
> The IMU chip on the librem5-devkit is not mounted at the "natural" place
> that would match normal phone orientation (see the documentation for the
> details about what that is).
> 
> Since the lsm9ds1 driver supports providing a mount matrix, we can describe
> the orientation on the board in the dts:

I didn't found the patch which adds the iio_read_mount_matrix()
support. Appart of that your patch looks good so feel free to add my:

Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> 

Regards,
  Marco

> Create a right-handed coordinate system (x * -1; see the datasheet for the
> axis) and rotate 180 degrees around the y axis because the device sits on
> the back side from the display.
> 
> Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
> ---
> 
> tested on the librem5-devkit of course, finally fixing the orientation problem
> for the accelerometer :)
> 
> thanks,
> 
>                             martin
> 
> 
>  arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
> index 703254282b96..6c8ab009081b 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
> +++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
> @@ -457,6 +457,9 @@
>  		reg = <0x6a>;
>  		vdd-supply = <&reg_3v3_p>;
>  		vddio-supply = <&reg_3v3_p>;
> +		mount-matrix =  "1",  "0",  "0",
> +				"0",  "1",  "0",
> +				"0",  "0", "-1";
>  	};
>  };
>  
> -- 
> 2.20.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: dts: librem5-devkit: add lsm9ds1 mount matrix
  2020-02-03 11:05 ` Marco Felsch
@ 2020-02-03 11:31   ` Martin Kepplinger
  2020-02-04 17:24     ` Marco Felsch
  0 siblings, 1 reply; 7+ messages in thread
From: Martin Kepplinger @ 2020-02-03 11:31 UTC (permalink / raw)
  To: Marco Felsch
  Cc: mark.rutland, robh, devicetree, linux-kernel, kernel, shawnguo,
	linux-arm-kernel



On 03.02.20 12:05, Marco Felsch wrote:
> Hi Martin,
> 
> On 20-01-20 11:07, Martin Kepplinger wrote:
>> The IMU chip on the librem5-devkit is not mounted at the "natural" place
>> that would match normal phone orientation (see the documentation for the
>> details about what that is).
>>
>> Since the lsm9ds1 driver supports providing a mount matrix, we can describe
>> the orientation on the board in the dts:
> 
> I didn't found the patch which adds the iio_read_mount_matrix()
> support. Appart of that your patch looks good so feel free to add my:
> 
> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> 
> 
> Regards,
>   Marco
> 

hi Marco, thanks for having a look. there it is:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=04e6fedb18f6899453e59a748fb95be56ef73836

thanks again, for now as long as I don't resend I leave adding the
reviewed-by to maintainers,

                               martin


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: dts: librem5-devkit: add lsm9ds1 mount matrix
  2020-02-03 11:31   ` Martin Kepplinger
@ 2020-02-04 17:24     ` Marco Felsch
  2020-02-05 14:32       ` Martin Kepplinger
  0 siblings, 1 reply; 7+ messages in thread
From: Marco Felsch @ 2020-02-04 17:24 UTC (permalink / raw)
  To: Martin Kepplinger
  Cc: mark.rutland, robh, devicetree, linux-kernel, kernel, shawnguo,
	linux-arm-kernel

On 20-02-03 12:31, Martin Kepplinger wrote:
> 
> 
> On 03.02.20 12:05, Marco Felsch wrote:
> > Hi Martin,
> > 
> > On 20-01-20 11:07, Martin Kepplinger wrote:
> >> The IMU chip on the librem5-devkit is not mounted at the "natural" place
> >> that would match normal phone orientation (see the documentation for the
> >> details about what that is).
> >>
> >> Since the lsm9ds1 driver supports providing a mount matrix, we can describe
> >> the orientation on the board in the dts:
> > 
> > I didn't found the patch which adds the iio_read_mount_matrix()
> > support. Appart of that your patch looks good so feel free to add my:
> > 
> > Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> 
> > 
> > Regards,
> >   Marco
> > 
> 
> hi Marco, thanks for having a look. there it is:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=04e6fedb18f6899453e59a748fb95be56ef73836

I see =)

> thanks again, for now as long as I don't resend I leave adding the
> reviewed-by to maintainers,
> 
>                                martin
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: dts: librem5-devkit: add lsm9ds1 mount matrix
  2020-02-04 17:24     ` Marco Felsch
@ 2020-02-05 14:32       ` Martin Kepplinger
  0 siblings, 0 replies; 7+ messages in thread
From: Martin Kepplinger @ 2020-02-05 14:32 UTC (permalink / raw)
  To: Marco Felsch
  Cc: mark.rutland, robh, devicetree, linux-kernel, kernel, shawnguo,
	linux-arm-kernel

On 04.02.20 18:24, Marco Felsch wrote:
> On 20-02-03 12:31, Martin Kepplinger wrote:
>>
>>
>> On 03.02.20 12:05, Marco Felsch wrote:
>>> Hi Martin,
>>>
>>> On 20-01-20 11:07, Martin Kepplinger wrote:
>>>> The IMU chip on the librem5-devkit is not mounted at the "natural" place
>>>> that would match normal phone orientation (see the documentation for the
>>>> details about what that is).
>>>>
>>>> Since the lsm9ds1 driver supports providing a mount matrix, we can describe
>>>> the orientation on the board in the dts:
>>>
>>> I didn't found the patch which adds the iio_read_mount_matrix()
>>> support. Appart of that your patch looks good so feel free to add my:
>>>
>>> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> 
>>>

btw, I have resent this (and included your tag) as part of a series with
more librem5-devkit dts additions:
https://lore.kernel.org/linux-devicetree/20200205143003.28408-1-martin.kepplinger@puri.sm/T/#t

thanks,
                                 martin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-20 10:07 [PATCH] arm64: dts: librem5-devkit: add lsm9ds1 mount matrix Martin Kepplinger
2020-01-27  9:21 ` Martin Kepplinger
2020-02-03 10:19 ` Martin Kepplinger
2020-02-03 11:05 ` Marco Felsch
2020-02-03 11:31   ` Martin Kepplinger
2020-02-04 17:24     ` Marco Felsch
2020-02-05 14:32       ` Martin Kepplinger

Linux-ARM-Kernel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/0 linux-arm-kernel/git/0.git
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/1 linux-arm-kernel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-kernel linux-arm-kernel/ https://lore.kernel.org/linux-arm-kernel \
		linux-arm-kernel@lists.infradead.org
	public-inbox-index linux-arm-kernel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-arm-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git