From patchwork Sun Sep 8 21:47:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Skvortsov X-Patchwork-Id: 13795667 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 D7BCBECE577 for ; Sun, 8 Sep 2024 21:50:05 +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: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=K3h/dy8U8KeKo9pl0s6GpX+Ff1bmWBiKnyAT/bdQlUo=; b=kZH9VYCXuyhszDldIM5wjYoG76 VqG2gdhcUK44sJnBniC/xhi3wd0SjaT7m5IDlLXuGYmpySiCAjKIl5GSibVu14OZ/hoKitpfzN6qe tWcOmZAhEm+1b91yr4TheO6qRLf7MH66D5Dv0oYd/RwK6t/rgOdKAmWQZRE2Ha0wXugNFJgCFRYAY pIDjWD2qmpDAyMQulZppI0lFnc5O+WjScdxjEImqgqpncEIYG3fOcwjdI/fi3sfx2/ZpiS430RAOX xAJBksbReOtCoeOzpGyyp7YUv1oc44T8zyn7LtotWKIXSiEIdTEvP4/nIB3yfEJaRN4TbGbyeUlT1 YOhBdFUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1snPnB-0000000HWte-0Xgs; Sun, 08 Sep 2024 21:49:57 +0000 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1snPlJ-0000000HWdy-0hFc for linux-arm-kernel@lists.infradead.org; Sun, 08 Sep 2024 21:48:03 +0000 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2f762de00fbso7787941fa.2 for ; Sun, 08 Sep 2024 14:48:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725832079; x=1726436879; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=K3h/dy8U8KeKo9pl0s6GpX+Ff1bmWBiKnyAT/bdQlUo=; b=J39kfog6pKN9gR/N36XON19pIlWBtWfG0rG/Mgj54cBLav0hxFa/Z6GQFBnQ61i39f gaUkMAe79BxN/i8g9A6BnYWdXH+uyLZDG+m/NyOD48Yqr/KOE1ghNdNkYh/kSs7es+Uu PPs0ZSEo0ixdhv4k9jdF4NuwQljecg2E3lFoGG5LYdgC4O00aYCl0xtbAUg7dHyOQuGD fXf0PoWnra5YOiXzbpkd2olKcVf+yjqLCJYjITWjgsqAq672f7JDYPX82Axcc9799L40 raFQcIo4WIYaawNVNR2llzrCaLlC6c8jI7lJkfwoblPESC/ebSEBdP85oOy1KUGiEQxu +/7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725832079; x=1726436879; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K3h/dy8U8KeKo9pl0s6GpX+Ff1bmWBiKnyAT/bdQlUo=; b=SzHUlOjJI3YvQY9MEQg/Yf4AItuxG5rGNXUtTPHFO6K/3MtWn5JjG++E7mzOeqaRwc uqwKx3M+M1cAyVyzFbq2AJZEa55BLRo/x9HWwKijrWORXVU1Z94YEjXcSJ5Ao14F3Kev 6sGqGyqI8neohwHwmfzKPKYNn2FzCzm2lYBwu59oQ7EQ0q1aFqMyCJnenEuC7doXnQ/G 25ttSE4dqqgPLJrhoSe6MurVVP4kI3qs0DaREXLhYBEijQqT/JfvUtVp+JFGLYwONUok vymIVZkjIzddSnwwby1DJjqXxA695M9a/lvbN+WUjkePAXyadJWevnAnMiPtkeyhlWzs 93xw== X-Forwarded-Encrypted: i=1; AJvYcCWSNOXDmYa1gvbAEDorZj4fJGXfOczKToXVwnToNmeB6HJ7u6OUrvY5XAhJcTVEPthiO7+av2SKF06AdHhBoVH0@lists.infradead.org X-Gm-Message-State: AOJu0YyPQRPkgNZOige/2WRHY5011egAmLPJalqavN4qBLubnPHIBtf7 PLwvm9Mb1UfGL1YLEsZWD8tbjjfH2JRLpDTv9mWSCymcxLUkmNcW X-Google-Smtp-Source: AGHT+IGrW/26G4fqJ55LEXa+E3HPJe1Oq8TWJKGljblgXwZFH5PCcrjxnSDxIUyY7RjRWG/956715A== X-Received: by 2002:a2e:a58e:0:b0:2f3:d82b:1959 with SMTP id 38308e7fff4ca-2f751f00b02mr77757571fa.23.1725832078203; Sun, 08 Sep 2024 14:47:58 -0700 (PDT) Received: from localhost.localdomain ([94.19.228.143]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2f75c009a5dsm6094001fa.72.2024.09.08.14.47.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Sep 2024 14:47:57 -0700 (PDT) From: Andrey Skvortsov To: Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Cc: Shoji Keita , Icenowy Zheng , Andre Przywara , Andrey Skvortsov Subject: [PATCH 1/2] arm64: dts: sun50i-a64-pinephone: Add AF8133J to PinePhone Date: Mon, 9 Sep 2024 00:47:17 +0300 Message-ID: <20240908214718.36316-2-andrej.skvortzov@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240908214718.36316-1-andrej.skvortzov@gmail.com> References: <20240908214718.36316-1-andrej.skvortzov@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240908_144801_239074_12EF71D5 X-CRM114-Status: GOOD ( 12.64 ) 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 From: Icenowy Zheng New batches of PinePhones switched the magnetometer to AF8133J from LIS3MDL because lack of ST components. Both chips use the same PB1 pin, but in different modes. LIS3MDL uses it as an gpio input to handle interrupt. AF8133J uses it as an gpio output as a reset signal. It wasn't possible at runtime to enable both device tree nodes and detect supported sensor at probe time, because both drivers try to acquire the same gpio in different modes. Device tree fixup will be done in firmware without introducing new board revision and new dts. Signed-off-by: Icenowy Zheng Signed-off-by: Andrey Skvortsov Link: https://patchwork.ozlabs.org/project/uboot/patch/20240211092824.395155-1-andrej.skvortzov@gmail.com/ --- .../boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi index 6eab61a12cd8f..66fbb35a7fae9 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi @@ -188,6 +188,18 @@ touchscreen@5d { &i2c1 { status = "okay"; + /* Alternative magnetometer */ + af8133j: magnetometer@1c { + compatible = "voltafield,af8133j"; + reg = <0x1c>; + reset-gpios = <&pio 1 1 GPIO_ACTIVE_LOW>; + avdd-supply = <®_dldo1>; + dvdd-supply = <®_dldo1>; + + /* status will be fixed up in firmware */ + status = "disabled"; + }; + /* Magnetometer */ lis3mdl: magnetometer@1e { compatible = "st,lis3mdl-magn"; From patchwork Sun Sep 8 21:47:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Skvortsov X-Patchwork-Id: 13795668 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 82034ECE577 for ; Sun, 8 Sep 2024 21:51:06 +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: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+5lHdD1vu8tp19LY7L9NdChS/5uF8VF0FGda3xCecrM=; b=yZ8jDnqdK9aJV5P0QqqKZ+5MQP EWBp7Swjw05k0Tt/DJM4c041iXg7W+aFXd0jMIKu4gGxl6VsgYBkg0K1KJGpTGVO+TvB8IftJOlxc pt6LOxkNeBNyh3Iff/41MQsf8OGVrLIF4gaEqx03qGeEO2vLlZgL+D2JfIN/5AZe7ncrHSRCmEvkj Um+uAqlpvYHkvaL8DaA3jNQ5Rt/qv+5DvLw9klATdYSj9OcnUYv/R2TXWxOhs1twELAGQ3EN9lwkj eb3L0I0M4Cv2VriGwhqztepeUWV2Vh+mD82/oOv521szJELkOkKuU7EnUS5PHE7d9cq+tRy+Ryz1+ BBUjhr9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1snPo8-0000000HX0e-2PyR; Sun, 08 Sep 2024 21:50:56 +0000 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1snPlN-0000000HWfz-3ppI for linux-arm-kernel@lists.infradead.org; Sun, 08 Sep 2024 21:48:07 +0000 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2f75a81b6d5so15273921fa.1 for ; Sun, 08 Sep 2024 14:48:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725832084; x=1726436884; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+5lHdD1vu8tp19LY7L9NdChS/5uF8VF0FGda3xCecrM=; b=MMF1mY1izTMyvZM1cIk8YqWRZ3d4bhgwhZO1Fd3XJZXb1THAD+Whf+9LRqEpAWip2L jK5H1L2cYDE+hF7zAGYNI5Uf2nufmpA5Z6YkuiTu1H461K1i3B6KWAbjgnW6Vd4gJAqT M2VM4vo+Nzv++LDRqRA4zH8hNqCt3TMsk4IA4gueOJvf4Qe9iL7wLPBeQfWGlRMcI4WA vPu7wyqD/PSFHgm/mzDXWKFTl9CFR9h7TvFs2zVx6Hv04UqKDH4S65IgZF697REgzV02 ZpRV1AVZbTfRkA+IBrxkuIeaIv6TE3xnBe1RN09JsqEOpSqZbuE99ozhQ74GyFot5GT7 uWmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725832084; x=1726436884; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+5lHdD1vu8tp19LY7L9NdChS/5uF8VF0FGda3xCecrM=; b=NHBM0CSKbDxdMRftzGuCLXbqQ2xvEPspCn9Mg7qCrycM+7dNdBIr36Cjg3p18f5tq2 YIE6zSS1oyXaYBFaNflQgxutlEMheOuTYpJUbevi/L1atMPU068AoAPVN43pA3vfLgfO FhNbKcT/Ul4cZHQ7KUQNuGcyVltHp6xC6HrMO4kdPxZI9R0A9LClCW31TKdVPQnlO+SH o4PHFlv2PWHV3ugg7Bv2Ze595pg07jQVDzbZvO4u9cwAtoV3GigvAK0CBMDFxnG2RFYO yPJRIrePjpF+v/b20xPj2fFwQuLH3FgamNlmEDKuzKS1NFEzQE5wLX7IjDntjxSqObR7 AhzA== X-Forwarded-Encrypted: i=1; AJvYcCXfYA52Ajx2ZzZsZBQ/dF1IKionx8Mh5PaPLGR0cDmaza90n4S6FvE3Cjs3rFPnFNGhx+hTnN/lVWrrKAY+RDnk@lists.infradead.org X-Gm-Message-State: AOJu0YzkbR3CrIzo6A3LWAAQMitXDUjqOFgBsF6lz8RZRc7wfhtHrUTO CrG6bRCHEjsqWE3Ir5kSz+c88qzutavKM6jmBoNOjIbGKftWLPBS X-Google-Smtp-Source: AGHT+IGWrBJfazLT3p6fzD1nzJeGKGktro5pYGcc4Vwm9vZSCn+YQvZnQ7GH/Qcypc5LoLYr8Z+kkg== X-Received: by 2002:a05:651c:1543:b0:2f7:614f:7d3e with SMTP id 38308e7fff4ca-2f7614f80b5mr27281081fa.30.1725832083627; Sun, 08 Sep 2024 14:48:03 -0700 (PDT) Received: from localhost.localdomain ([94.19.228.143]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2f75c009a5dsm6094001fa.72.2024.09.08.14.48.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Sep 2024 14:48:03 -0700 (PDT) From: Andrey Skvortsov To: Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Cc: Shoji Keita , Icenowy Zheng , Andre Przywara , Andrey Skvortsov Subject: [PATCH 2/2] arm64: dts: sun50i-a64-pinephone: Add mount-matrix for PinePhone magnetometers Date: Mon, 9 Sep 2024 00:47:18 +0300 Message-ID: <20240908214718.36316-3-andrej.skvortzov@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240908214718.36316-1-andrej.skvortzov@gmail.com> References: <20240908214718.36316-1-andrej.skvortzov@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240908_144805_976460_D2232BC1 X-CRM114-Status: GOOD ( 11.31 ) 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 From: Shoji Keita For lis3mdl, values are based on datasheet and PCB drawing and tested on a real device. For af8133j, values are from testing on a real device. Signed-off-by: Shoji Keita Signed-off-by: Andrey Skvortsov --- arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi index 66fbb35a7fae9..d35d747292ce6 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi @@ -195,6 +195,9 @@ af8133j: magnetometer@1c { reset-gpios = <&pio 1 1 GPIO_ACTIVE_LOW>; avdd-supply = <®_dldo1>; dvdd-supply = <®_dldo1>; + mount-matrix = "0", "-1", "0", + "-1", "0", "0", + "0", "0", "-1"; /* status will be fixed up in firmware */ status = "disabled"; @@ -206,6 +209,9 @@ lis3mdl: magnetometer@1e { reg = <0x1e>; vdd-supply = <®_dldo1>; vddio-supply = <®_dldo1>; + mount-matrix = "0", "1", "0", + "-1", "0", "0", + "0", "0", "1"; }; /* Light/proximity sensor */