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 CC799CF9C64 for ; Sun, 22 Sep 2024 17:03:13 +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:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=e6OYj2UJLtKO0PzA2lDG8Hf51QXdlmbxTS6bMeQGk50=; b=3oo4U7vtcX5QbGEtRdKCYBfQO8 s1QzMWo367tTUhAmZZwNwjMd2jTTwxBgeUSC8kNf9kL7aZ1RYQVbJoG/Aqd23xXhilqPSh825+a62 AJkTY8tWwfhAweHvYRHF6otTDUn0UW93Md2GHtIUjrA7gEEXKhPMEQ0w0OPN89bTQ43o1GBpx12NO vjcmUqF+gvRYf/o08nayDph6f0K06nXgLv57kVrQPrKdNXK9rzRRexA/Z8NAagjHeicwmXNHhOnjV TDjGny2hI0ATzlL1hQPNLbZxjgodOWGr3phhaYygZqvqlIBEmb+w4tu27CLwVMtSo9Rl5EyV6iTgg S5X7ARPQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1ssPzE-0000000FTCf-269V; Sun, 22 Sep 2024 17:03:04 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1ssPy5-0000000FT5Q-3bGu for linux-arm-kernel@lists.infradead.org; Sun, 22 Sep 2024 17:01:55 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-42e7b7bef42so18888975e9.3 for ; Sun, 22 Sep 2024 10:01:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727024512; x=1727629312; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=e6OYj2UJLtKO0PzA2lDG8Hf51QXdlmbxTS6bMeQGk50=; b=dVFDp+JAea4wVBzzm+cYPWN23gtzyoB4sH4MUnB1CH9F3ztumQEZcYuq77a1BROUZ2 uht7SX7BeRHwovMVx2H4UNEwdskxisSO/8tlwpY4LGNGDkBw37hdNplsz55es1jn6ser QVfjvPSz1bM4wd626Au4X1EB6P/zS/Wui2GLDIbrXtlcERTNowgxgWpREqcNBMPciq3L wrJwUTBLZTeLyIjlJ5khwvn/qIudxtJccHFZRSbLyzzn3S0H0r3W+u3IivV3DKL81j6G zQcJWhHrADLfLIrgVuotNyt6XKJcT20C8/O3SWzCXCecklJyzHWBeTGiQaCZ1iWP8LHw 5I2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727024512; x=1727629312; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=e6OYj2UJLtKO0PzA2lDG8Hf51QXdlmbxTS6bMeQGk50=; b=o0fnMbLubJL1aC5TRm+9DbO+083ePggeHGd1PgolGfEtvWIlWi1UV7EjZK5jT/5uer 4AxjDU1P0JuDU7mUgr65OlrE+PIzQHVCKi5lSXTY5Fno6OUhsOp4S252pmC2bzk9rfTb F4KYS9K3sV7ropm6tynpT1hdzC0OAbwjugNhJIFENuvgjM/fB8HrRwDuVJ6eCFTl0Dt6 eTSwJVeZdMtfS80YsuUzWF/a2JUbZ2hEL5WfPcv3jWIBNup2mh+i36YtfLwcl0G4aGsM WUemEtPgTl544v6y0U25b3s4LIFTwDbHU/Apxe8JqE84l9x+NH3/3DvJcRp/8F/Gf/46 0WQQ== X-Forwarded-Encrypted: i=1; AJvYcCVqQ2j1udkLyN1oZH3z7xAo28/lFTi8JvAV4+WjnrYMVdufV6L/z4eRm3W30nPH11SCnyFsdtgcKMKHENxUtoPg@lists.infradead.org X-Gm-Message-State: AOJu0Yydnydj0j+zWxmzjjfzqSAjSowTGOJhd/awk6eUb48ZYgzmK/pc +rGNtFIMRKvV4xUFsM+kQhfJrQiRkoa+aMkjKVNrX+8r9I5AZuIJ X-Google-Smtp-Source: AGHT+IF+lPG/TGg29MYlU3BmR+FnM5mK3gvHfmebpJCRc6aD+5GdQAF0EcnCJztjRJv/IukZAZEtFw== X-Received: by 2002:a05:600c:358e:b0:428:1310:b6b5 with SMTP id 5b1f17b1804b1-42e7c1a3916mr61839915e9.34.1727024511350; Sun, 22 Sep 2024 10:01:51 -0700 (PDT) Received: from localhost ([94.19.228.143]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e754c643csm104582835e9.45.2024.09.22.10.01.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Sep 2024 10:01:50 -0700 (PDT) Date: Sun, 22 Sep 2024 20:01:49 +0300 From: Andrey Skvortsov To: Dragan Simic Cc: linux-sunxi@lists.linux.dev, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, wens@csie.org, jernej.skrabec@gmail.com, samuel@sholland.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Ondrej Jirman Subject: Re: [PATCH] arm64: dts: allwinner: pinephone: Add mount matrix to accelerometer Message-ID: Mail-Followup-To: Andrey Skvortsov , Dragan Simic , linux-sunxi@lists.linux.dev, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, wens@csie.org, jernej.skrabec@gmail.com, samuel@sholland.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Ondrej Jirman References: <129f0c754d071cca1db5d207d9d4a7bd9831dff7.1726773282.git.dsimic@manjaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <129f0c754d071cca1db5d207d9d4a7bd9831dff7.1726773282.git.dsimic@manjaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240922_100153_921795_31201514 X-CRM114-Status: GOOD ( 20.98 ) 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 24-09-19 21:15, Dragan Simic wrote: > The way InvenSense MPU-6050 accelerometer is mounted on the user-facing side > of the Pine64 PinePhone mainboard, which makes it rotated 90 degrees counter- > clockwise, [1] 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 > Pine64 PinePhone dtsi file. > > [1] https://files.pine64.org/doc/PinePhone/PinePhone%20mainboard%20bottom%20placement%20v1.1%2020191031.pdf > > Fixes: 91f480d40942 ("arm64: dts: allwinner: Add initial support for Pine64 PinePhone") > Cc: stable@vger.kernel.org > Helped-by: Ondrej Jirman > Helped-by: Andrey Skvortsov > Signed-off-by: Dragan Simic > --- > > Notes: > See also the linux-sunxi thread [2] that has led to this patch, which > provides a rather detailed analysis with additional details and pictures. > This patch effectively replaces the patch submitted in that thread. > > [2] https://lore.kernel.org/linux-sunxi/20240916204521.2033218-1-andrej.skvortzov@gmail.com/T/#u > > 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 6eab61a12cd8..b844759f52c0 100644 > --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi > +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi > @@ -212,6 +212,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"; > }; > }; > I've applied the patch to next-20240920, built and run on a device. Sensor now works as expected. Screen rotating in Phosh according to the device orientation. Reviewed-by: Andrey Skvortsov -- Best regards, Andrey Skvortsov