From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796423105; b=SKvjxoRrhigoESZNyFmx59ACaSfRS3nqiqpGMGSbhEvFhM0GiA+R3SqHcwtNghGdMsCN uhwl1aYbzmr09uL51n+N/VVIVCwpcyW0lGrqBgIWjODQe2jwtOlr6H6TfT5hkUSqEENkM DdDTQBb/lm30SFr8oF245zZFADv/tA0lhtGO8o2o75Yq3lr5il+tQkfK0l3JjFaH59/dD m84QWkD4wrfGf8ENcjlaZtWTBQYatLiNBemOMrYKTWRFbShYnh5kvtoP6++NrUkgM7Dfb /RkrbTjzJwUvdvP7L6XfyyA6xppYDKJ1kzuuF4BAfTbZfCs2vhlC7n5DyN2hDyyt6aw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796423105; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=EfGrdR+TxkR5BjfvzAS3ZruePe2Bnf2vmnMaZUjyHz0=; b=GJtQ8/lxjGzRywDsZW9k0/UiAsJ0Pog55o8Y0RPSUzlD+qUimeX3D4m3/1kG31mYueq3 qF7gpxMmJBdQoaZ+xikmplikLCKf23Lrl4XKNmShnRC1C509wYEzFsWfMlCZfQouIbBwS Zw1lKIEOCnI7PQnrMjqlM79kDR1GtGsed1uu83ScQB3gnjrGB+0RsC9zSzobfxQ0sY7dT jP8P5ThsbquX6n1Psaj0abW1c0xPLRgbXxdPdaklPrVkypwCTwZHDSqC6oA7hZd6q3QIl oW6yvhvqOywY7S5C4HCLNmkMEaKRly+23axOs53Z7EGnHsTcBoraXcza/MxZNP5fM6Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="RvS/HgiK"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B68CB606A322; Fri, 4 Dec 2026 22:25:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=RvS/HgiK Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A1601F00936; Fri, 4 Dec 2026 22:25:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796423105; bh=EfGrdR+TxkR5BjfvzAS3ZruePe2Bnf2vmnMaZUjyHz0=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=RvS/HgiKXGMMB84w77kp1zhJvVYL5vdkfpwGRnMMXgFaw+fFzYoW1Mam0UIni7fE0 1f/CHsDIcdXhMYRvFZOB9+4uqKHd/w3qik8LrF9K6FsYOVBuc/6dGqUnWSVz965vrE JJHFRCc8t6PVv74mR1IYsc4ECfwrQi1TTuH+L0q1FQQhd7rXrCHzgZU4774WG0K3Fd 4pod4EnDi1xcH+/w2TMqFFOdVseyxogcFj9DOd8+PjCj53xBTZK/ZE2jwEG9NnVk6Y IAMTCANqcwxWhQxrV3vdysmwNRNv2ESEj+ndXAEPk1I/1sOyY0wDNWJyF5CGG+ulLU nv2dUu0ldvGCQ== Date: Fri, 4 Dec 2026 16:25:01 -0600 From: Bjorn Andersson To: emcp@enser.io Cc: Konrad Dybcio , Abel Vesa , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Weiss Subject: Re: [PATCH] ARM: dts: qcom: msm8974-hammerhead: Fix the IMU mount matrix Message-ID: References: <20261122-b4-hammerhead-imu-mount-matrix-v1-1-fa38561de9ca@enser.io> X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261122-b4-hammerhead-imu-mount-matrix-v1-1-fa38561de9ca@enser.io> On Sun, Nov 22, 2026 at 05:12:54AM +0000, EMCP333 via B4 Relay wrote: > From: EMCP333 > > The mount matrix added for the MPU6515 is the negative of the one the > vendor kernel uses. LG's hammerhead device tree maps the axes as > > axis_map_x = <1>; axis_map_y = <0>; axis_map_z = <2>; > negate_x = <0>; negate_y = <0>; negate_z = <1>; > > that is x = y_raw, y = x_raw, z = -z_raw, while the current matrix gives > x = -y_raw, y = -x_raw, z = z_raw. Every axis is inverted, so a phone > lying face up reads -1 g on z (face down), and held upright in portrait > it reads -1 g on y, which orientation daemons take as upside down: the > screen rotates to 180 degrees when the phone is held normally. > > The current matrix also has determinant -1, a reflection, which no > physical mounting can produce. The vendor mapping is a proper rotation > and gives +1 g out of the screen when face up, as > Documentation/devicetree/bindings/iio/mount-matrix.txt expects. > > Tested on a Nexus 5 running the postmarketOS 6.16 kernel with only this > matrix changed in its DTB. Held upright, sideways both ways and lying > face up, it read +9.7 m/s^2 on y, +9.7 and -9.7 on x, and +9.4 to +10.0 > on z, and the orientation daemon turned the screen the right way up in > each case. With the old matrix, portrait was shown upside down. On > v7.4-rc2 the DTB builds with no new dtbs_check warnings. > > The code and this changelog were prepared with the help of an AI coding > assistant. The submitter has reviewed both and takes responsibility for > them. > > Fixes: 73c9729f0fb5 ("ARM: dts: qcom: msm8974-hammerhead: add mount matrix for IMU") > Signed-off-by: EMCP333 Please use your real/full name. Thanks, Bjorn > --- > arch/arm/boot/dts/qcom/qcom-msm8974-lge-nexus5-hammerhead.dts | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/arm/boot/dts/qcom/qcom-msm8974-lge-nexus5-hammerhead.dts b/arch/arm/boot/dts/qcom/qcom-msm8974-lge-nexus5-hammerhead.dts > index e34d7b864e..9128c66125 100644 > --- a/arch/arm/boot/dts/qcom/qcom-msm8974-lge-nexus5-hammerhead.dts > +++ b/arch/arm/boot/dts/qcom/qcom-msm8974-lge-nexus5-hammerhead.dts > @@ -213,9 +213,9 @@ mpu6515@68 { > pinctrl-names = "default"; > pinctrl-0 = <&mpu6515_pin>; > > - mount-matrix = "0", "-1", "0", > - "-1", "0", "0", > - "0", "0", "1"; > + mount-matrix = "0", "1", "0", > + "1", "0", "0", > + "0", "0", "-1"; > > i2c-gate { > #address-cells = <1>; > > --- > base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb > change-id: 20261122-b4-hammerhead-imu-mount-matrix-3baa8237755a > > Best regards, > -- > EMCP333 > >