From nobody Sat Nov 30 16:44:57 2024 Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1579917A590 for ; Sun, 8 Sep 2024 21:48:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725832082; cv=none; b=Llk+aK0YT2NCHjt0lzlbwTGFMN27/twMOcc0SWksAVlfk8JSQIx8c0zW6zJ5fh/Z/N/RDbNiCRdg/mUFLAz4pbaE4GRmoYwAlbMM9mRyeRw/YrWafrmsy+IiDm/Jcs2InlFBM+nhQROrlYgoFrjAz4m7qwNrKzHuPLyCITBDWBE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725832082; c=relaxed/simple; bh=enP55UdvGXp5F5o/Qt/iN8GCJ3XoOR4JNPqAB/35NGc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gGcCQlF8PNlX6x2TKGmfJyghSVUQZl/RoidfjltFySgmGKnNPMWF3qVZQpvN2pgfmvjm+4DmPL3zNEJmA/9tYpPA1dJAK+mauMLM+Fryo7G9HIzxmatHHUPvJWVdX0G7KSwviCSMeChAilDhZ1/AkdV7J8qgoOHWgXwV4XvJpuw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=F6Py0j2I; arc=none smtp.client-ip=209.85.208.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="F6Py0j2I" Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2f763e9e759so7552911fa.3 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=vger.kernel.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=F6Py0j2IEXEYvGrIgWq+5gsY3OO5lEMwIFfJZ5QUrzeelZ+BerM61DEdqdHhW711F0 278vVZJmDArPOsUOzL2GH8x163cjWT9JvFbhd+fTK1GKtmgRZ5wS4nzR+7jJ9WZXIfFB wn7C8Y1FSzjFva3LQEA0NFDQAHF3Xh5INDQeMaB/ZTstGf5GwGEAzmoXcAJEkH9ktBS7 PzvscHEc3NvTqnKejyKRabFVO96BzLg92dDGMrnJ4aBPJht+f+r1ueXklPFsOcZLdW4Y RRmR1Z+wWgxvzY0NN/Tp7BMbMhNKrNwpZYkb364ePaJGG+CKkIoZvBFMjOW0tjLbDizU /J5Q== 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=of253IoBTuEUomOxXunVGvSRjGQZqzyZVweNIlRUFp73aDJ5ZvLOnT+BWcfbpZSQ86 kaQABvZyoys9H9qsq+Mvv+IXbp4JzaHpzlLfmSwDj9fEBo6LZYwmpo7aa+XneYHjna+T x3s7qot7uj72CjIjjAWFk50vKDs2J5aZ08vlCqs/t81CtXLRf4jYImv0gcorLd27cpHy QX6Cu1HRNUJTPtCf0M+73a60rmW9JhASb37JWCYIMz4qm9oQEFMwIXsZwCxzr+rcsMl8 4sfriN2gwoHvPvOPEIOX5o50mDNvKJ+Qkr854smsSZVGPqgNpmYXGZLWu9O1qyMN5jKn FlOA== X-Forwarded-Encrypted: i=1; AJvYcCUN8UYGFjzkUw2VPS9xVQpIlW6gmf+2Xxll0E+DdVjo8DsEmADb9VrIRIPWb314fTpPEWkowQ3eZPHRC7I=@vger.kernel.org X-Gm-Message-State: AOJu0YzJKl16AlsppWcn5tE12f+Mi7X/tblt/z1nmrbdF/11zpIqp0M8 VKe8Y/NbZgYvtGwgPpj/eanRAwLeaOJMZELcKEhU1SAB/kAid2hX 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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.39515= 5-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 =3D "okay"; =20 + /* Alternative magnetometer */ + af8133j: magnetometer@1c { + compatible =3D "voltafield,af8133j"; + reg =3D <0x1c>; + reset-gpios =3D <&pio 1 1 GPIO_ACTIVE_LOW>; + avdd-supply =3D <®_dldo1>; + dvdd-supply =3D <®_dldo1>; + + /* status will be fixed up in firmware */ + status =3D "disabled"; + }; + /* Magnetometer */ lis3mdl: magnetometer@1e { compatible =3D "st,lis3mdl-magn"; --=20 2.45.2 From nobody Sat Nov 30 16:44:57 2024 Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B00D17BEC6 for ; Sun, 8 Sep 2024 21:48:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725832087; cv=none; b=b4JDzLdtz0xA0y8uUwJOMGRMM/2Ncab/OKltdl6YH5JBDcvQVfhgDKbaKHPSWKAEXgCpuk5byK3Y2z8iN+m1xwuFTE6PcB5DVhhDROBUyzWvRBT0IdYDehBvVJ98t9HkY1jeZuoTLsq1Dpkb1dRsLz6E7FIoCnB9Qg68bXlOFAs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725832087; c=relaxed/simple; bh=61A2TmpCBTvA1OQSWxfcDyW9YW/y1h704XtvhNpV7BQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=G9w/eZ9EtUCZ/PvRZ526w8PGf9DQCOAoZxPea25xth4awJ1vW70TpYZlPYnoQAYuW0oYwHvox+8cpFAGfTnQrrgkXlZS8fcdSNzw/eDMaRahdRd7WseeXBKZEryDku2TyTBjsPHbUSssVK+RpaRV0I/st0nu92yMYndj3KKppr8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Qhcy2np7; arc=none smtp.client-ip=209.85.208.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Qhcy2np7" Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2f75c6ed397so13585961fa.2 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=vger.kernel.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=Qhcy2np7pfIkJAEmBMcsYq6yLeGWFFJ9g5jxUkU2kOEb0zsowq1N+yghCikLOMRVwZ 0OqLCZS2S85NXPGF85hzRhd2h9XV9x5mL5pS3oBEydGE2aorDrdSXmomJTJVl2gZCE0A 7M/3ZTqjx00mlgBUwTBg0RCuAo3HXj6z1wplyAx6PqoVavaBRqqD6DIPfQwCAiCp5NXt Apg9/0ygYISJeM6JT0MV0bH8r3CbLSe7uoi/Uu108qnruLozTV+fNWmODS8DxFwknGq6 QPXW5rnYeZ14dQXNnCZrhgw6qijNbqComb9ZJBG88yOcFzt37ujdkFV372xSowJLaZdL f1yA== 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=qJ1iMbdbrbZ/kaVKe50lwUkdoARTUbAwOzmELI35X60+7xnEfu+6sHKTQS7dMjJzj7 BeZJq4hxjyX1LsLWQVamN8OaYBTSSojSQXt2XLMCkNYIttU+tPaBdNdzulN1IUqcwShR e6Im/QDo5l5bGdQJaKOP1Y2HmNKxUMCGALMAgS9xLoIf3MaZbyrgbwc+Sil/XXO+qww7 ZEp3EQqbtxMW5RfqTrPE/FQZcnAO97BFmzI/SOg36QQBiXi3UOrJySg2+GNvYvS14N5v go/SOt1nGwma7yA4gh/MqlPjqzjK+oAQs7H3xh9OAIFeLGhPGRiu/jU1aA27mwUgsIM6 lmEQ== X-Forwarded-Encrypted: i=1; AJvYcCU8iP9HgeQDoUX6+PmC/SD6XNDLKvx/LJfs6oPGs0LuyGRY103q3GijUVbyEqm4HBOh3cNJXj2QGxMytgw=@vger.kernel.org X-Gm-Message-State: AOJu0YxZZr3ioGEkWrsFmZSrpGveRboV+NNGgViF69cdlu7RTiyubUJz /eA1IrfUGWEsQJAJKhd9tw9yzgs/tVjG5+CmpkryS3czreR4yNgy 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 =3D <&pio 1 1 GPIO_ACTIVE_LOW>; avdd-supply =3D <®_dldo1>; dvdd-supply =3D <®_dldo1>; + mount-matrix =3D "0", "-1", "0", + "-1", "0", "0", + "0", "0", "-1"; =20 /* status will be fixed up in firmware */ status =3D "disabled"; @@ -206,6 +209,9 @@ lis3mdl: magnetometer@1e { reg =3D <0x1e>; vdd-supply =3D <®_dldo1>; vddio-supply =3D <®_dldo1>; + mount-matrix =3D "0", "1", "0", + "-1", "0", "0", + "0", "0", "1"; }; =20 /* Light/proximity sensor */ --=20 2.45.2