Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2401086ybl; Mon, 20 Jan 2020 02:11:34 -0800 (PST) X-Google-Smtp-Source: APXvYqwDvsBctrUcTww25KAhYLKOhT1CykdAbM/D8OWnaKQqJym0MCpSJaGD4iFWQkJ91ED+y5eR X-Received: by 2002:aca:1903:: with SMTP id l3mr12150155oii.16.1579515094310; Mon, 20 Jan 2020 02:11:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579515094; cv=none; d=google.com; s=arc-20160816; b=mEe18/36uy1KlWsUJBg/3Hx1+ew2VWYp+l9BGxE6doIPhfTvZ0BpL/k21FVG+hdqB0 +35BxIO3bIClXFyXgh4EbsdjAgPfHMfhFKEWkWDZ9s1ZbqkCuaBioh6jumjWKkZX5B4+ 3sQ7UD/+3R7AkrBNBBsLpjY9pzNbr5f/UeNnieOVfQTPj7m7v8XPpTuMYB2tJB5bSTlq peHUTL/ozZkuTUOvWGIqyJaMztu5moqMGKZEc6QTulblCE73C3JbtZtp0XhC9b0R+pfU iQuvIKjXRX3MfFFvglG2qzNdHGLf7q4n7p39Hzxf1dRtznKT35z2r+EpnuywHbK1WT// 4DXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:message-id:date :subject:cc:to:from; bh=OXc0P4hR1m5F+P9PN7AsSOMKntESgEElDfORt63htS8=; b=sNZy4GPgf1x/Eop3f1PlHDkEugcPV9dCzkQMts9kI/10nmy6enADVW3jleUaU+k50V UDEVlRpLzWrXtOB0XrbhKPdxRqYL1NFfqn4SgnA7jDmehXeUrzcwhviOAyuoB8bxdTPr DXJXnd+M0je7zAe4m5uwlNhDS5spEoT2IdG1/bo07Obpm1LAgLRp0O6xTdhrdAR6Yn3w fFuxwP+CCL4/0rihBtEkX/06iyvG/wYcVOB1YDsism/mTqIxsO44hUmAScH8X+HEF/jS L2vkabpohMeialPAwJpt9xvQW6H9wNbOIFooQb6HKbh1yNXAsqPQ062ql2yWc27Tme1Z lhoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=puri.sm Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l204si5739255oif.261.2020.01.20.02.11.21; Mon, 20 Jan 2020 02:11:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=puri.sm Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726889AbgATKIB (ORCPT + 99 others); Mon, 20 Jan 2020 05:08:01 -0500 Received: from comms.puri.sm ([159.203.221.185]:40850 "EHLO comms.puri.sm" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726589AbgATKIB (ORCPT ); Mon, 20 Jan 2020 05:08:01 -0500 Received: from localhost (localhost [127.0.0.1]) by comms.puri.sm (Postfix) with ESMTP id 70A74DF2AA; Mon, 20 Jan 2020 02:08:00 -0800 (PST) Received: from comms.puri.sm ([127.0.0.1]) by localhost (comms.puri.sm [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7fE69IKM7W_p; Mon, 20 Jan 2020 02:07:59 -0800 (PST) From: Martin Kepplinger To: robh@kernel.org, mark.rutland@arm.com, shawnguo@kernel.org Cc: kernel@pengutronix.de, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Kepplinger Subject: [PATCH] arm64: dts: librem5-devkit: add lsm9ds1 mount matrix Date: Mon, 20 Jan 2020 11:07:22 +0100 Message-Id: <20200120100722.30359-1-martin.kepplinger@puri.sm> Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 = <®_3v3_p>; vddio-supply = <®_3v3_p>; + mount-matrix = "1", "0", "0", + "0", "1", "0", + "0", "0", "-1"; }; }; -- 2.20.1