From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 58D3CCCD194 for ; Wed, 18 Sep 2024 10:04:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:Message-ID:References:In-Reply-To:Subject:Cc:To:From:Date: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=m/8lONfZx+FNIG6iiP8W/GCBkEVHBI2sFN2P8FB9u3g=; b=JmaPPmT96B0QaNhgZZNwoOJqvV Ob6UrX0L/aCZ7XVfnbZcNe4L92M1PX1sXdgt1HhH5ucMmGvIQ71wM7xP7vRY6BcUELFO+0SfbwCLD HY+68vE+k6Z+uY1xOtPkov0JSoWAB7SOVqS/5wgtL7KEcLZWDCvhtmV6O+4XyqT2C+6cXOXZ3jN1N mHvNaRMCs2u2F0wO8M5UP9ZpYS3U44S85Gx8OKUVvgGZ+y2ApeJrN8ltKL0s7xLRFDO48Rc4cbgul HaJRYckDwjSNHJ01LolAJ+1/nNzfM6C8wubLW8J6xutOVwQyyOIDsCSPTaNpIAakwnA9jlYgqAudI FH8gs4GA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sqrXr-00000007yxg-2oc7; Wed, 18 Sep 2024 10:04:23 +0000 Received: from mail.manjaro.org ([2a01:4f8:c0c:51f3::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sqrWS-00000007ymM-2V0R for linux-arm-kernel@lists.infradead.org; Wed, 18 Sep 2024 10:02:58 +0000 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjaro.org; s=2021; t=1726653773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m/8lONfZx+FNIG6iiP8W/GCBkEVHBI2sFN2P8FB9u3g=; b=mPKghpKewlIiFRrA2nq/WkbEY+k5/KEcn4TeT/fVE8FMl9WBQq9buha7xO/uXkI7a7X7KK EG2ATNC31Ehm5S7iV3RR/gO0ia3+c1h2K9KJ5v0vdYyVKshBNwEmDdvHB3Dh6wlB1Y7Ccn umCo3Q78jicZVMF/reFLq4hDqb1ukGFLJILrUJ0HvBeXm1yotIfG0hpKC3FupkJFV6rF48 w9YHBvnvsGjDnGS9Xj6mmVT3zAHYYkFi0JAlYQKb+7vXZdiHFz8J7JjrxxGU1nHgw4Y0Sp 1QWhedTyCsNBj9UPbxCbQtn+tSPSC4DdtbXnykLNcotFpDbJa1iU2RJVTKqtag== Date: Wed, 18 Sep 2024 12:02:53 +0200 From: Dragan Simic To: Andrey Skvortsov Cc: Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Conor Dooley , =?UTF-8?Q?Ond=C5=99ej_Jirman?= Subject: Re: [PATCH] arm64: dts: sun50i-a64-pinephone: Add mount matrix for accelerometer In-Reply-To: References: <20240916204521.2033218-1-andrej.skvortzov@gmail.com> <6e5d0e9978bff30559c17f30d1495b59@manjaro.org> Message-ID: <64a2bf8f1491e510e93cc4c121975fd9@manjaro.org> X-Sender: dsimic@manjaro.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Authentication-Results: ORIGINATING; auth=pass smtp.auth=dsimic@manjaro.org smtp.mailfrom=dsimic@manjaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240918_030256_947903_BBA872F1 X-CRM114-Status: GOOD ( 30.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2024-09-18 11:27, Dragan Simic wrote: > Hello Andrey, > > On 2024-09-17 19:56, Andrey Skvortsov wrote: >> On 24-09-16 23:08, Dragan Simic wrote: >>> On 2024-09-16 22:45, Andrey Skvortsov wrote: >>> > From: OndÅ™ej Jirman >>> > >>> > accelerometer is mounted the way x and z-axis are invereted, x and y >>> > axis have to be spawed to match device orientation. >>> > The mount matrix is based on PCB drawing and was tested on the device. >>> >>> This commit summary should be copyedited for grammar and style. If >>> you want, I can provide a copyedited version? >> >> It would be helpful to avoid further grammar/style problems in the >> commit message. Thanks in advance. > > Alright, here's how it could be worded... First, the patch summary > should use the common prefix, together with a bit of rewording, so > the patch summary should read like this: > > arm64: dts: allwinner: pinephone: Add mount matrix to accelerometer > > The patch description should be reworded like this, reflown into > proper line lengths, of course: > > The way InvenSense MPU-6050 accelerometer is mounted on the > user-facing side of the Pine64 PinePhone mainboard requires > the accelerometer's x- and y-axis to be swapped, and the > direction of the accelerometer's y-axis to be inverted. > > Rectify this by adding a mount-matrix to the accelerometer > definition in the PinePhone dtsi file. > > [andrey: Picked the patch description provided by dsimic] > Fixes: 91f480d40942 ("arm64: dts: allwinner: Add initial support for > Pine64 PinePhone") > Cc: stable@vger.kernel.org > > Please note the Fixes tag, which will submit this bugfix patch > for inclusion into the long-term/stable kernels. > > Also note that the patch description corrects the way inversion > of the axis direction is described, which should also be corrected > in the patch itself, as described further below. > > After going through the InvenSense MPU-6050 datasheet, [1] the > MPU-6050 evaluation board user guide, the PinePhone schematic, > the PinePhone mainboard component placement, [2] and the kernel > bindings documentation for mount-matrix, [3] I can conslude that > only the direction of the accelerometer's y-axis is inverted, > while the direction of the z-axis remain unchanged, according > to the right-hand rule. > >>> > Signed-off-by: Ondrej Jirman >>> > Signed-off-by: Andrey Skvortsov >>> > --- >>> > arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 3 +++ >>> > 1 file changed, 3 insertions(+) >>> > >>> > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi >>> > b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi >>> > index bc6af17e9267a..1da7506c38cd0 100644 >>> > --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi >>> > +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi >>> > @@ -229,6 +229,9 @@ accelerometer@68 { >>> > interrupts = <7 5 IRQ_TYPE_EDGE_RISING>; /* PH5 */ >>> > vdd-supply = <®_dldo1>; >>> > vddio-supply = <®_dldo1>; >>> > + mount-matrix = "0", "1", "0", >>> > + "-1", "0", "0", >>> > + "0", "0", "-1"; >>> > }; >>> > }; > > With the above-described analysis in mind, the mount-matrix > should be defined like this instead: > > mount-matrix = "0", "1", "0", > "-1", "0", "0", > "0", "0", "1"; > > Please also note the line indentation that was changed a bit. 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] > [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