From nobody Wed Oct 1 22:38:31 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE2551684B0; Mon, 29 Sep 2025 07:35:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759131314; cv=none; b=dJh1LoRHqDF/FXmACjfoYsocEIUqYBTXfYgsqsdQEilq9kPLFV/5W5dlzFBOA4ENSmiipTSQIEgIIwRkOqmPg39h+LCJn8e89pkUSnQjbmTRczHHzkHIDDP7GCYgjtaZ5rJulR1IpPPSLn0qUKHZk5oOifNbvRA8WLYfGMzXfcw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759131314; c=relaxed/simple; bh=8VBQdbInkyT4SO9ZYbFABhR/xaRBu7JaZ6KrCbUKrbI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=etgLG6/NL5e7aXjV7zPpQMjBzAYJeR8tcZaUI2gGJGBPEQZVuMh0O//qslTpC66+RR/tlf7nQtpYZ5776Yp5jBo5uyZpr50mIkvX2Ysmw6pRXqVajGEHsTh+d/mdegiehpHCQOZn2Np4bnearKI4+2IBgA11i+AHniDhhXcPKVY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tmSdGKUz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tmSdGKUz" Received: by smtp.kernel.org (Postfix) with ESMTPS id 79224C116B1; Mon, 29 Sep 2025 07:35:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1759131313; bh=8VBQdbInkyT4SO9ZYbFABhR/xaRBu7JaZ6KrCbUKrbI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=tmSdGKUzYR8fczBUyshYTpijLbi5HxJfpYRcuUwdk901/GJCfU/P+dkyCWFElp98g Z7nL82rt4QJGF3rOuK8mRCplIzIXRqy6CsntPMGGREq3KLUHMkunDnm92MIPdXUhwD 67m7cFHm0BQIbmnVjr5snY4LK8156YauIM1hILdKe+gn7IEoa30zGzmXPjvOsiyPVc Fw5OAu/wKd3lhg70v27e2qVmmAYomRI1FE0b9jE/1QpeUaEm/216XrcGT7CEsgABNq AZuSr9TtipN7Hirz+OP/5lK0YXJl96tFHg3HWjrc13NjClCY/tsYUDcvLDuzeqXt+5 cfinOgOw6OyvA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 692A2CAC5B0; Mon, 29 Sep 2025 07:35:13 +0000 (UTC) From: Rudraksha Gupta via B4 Relay Date: Mon, 29 Sep 2025 00:35:12 -0700 Subject: [PATCH v4 1/4] arm64: dts: rk3399-pinephone-pro: Add light/proximity sensor support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250929-ppp_light_accel_mag_vol-down-v4-1-6598f22d3451@gmail.com> References: <20250929-ppp_light_accel_mag_vol-down-v4-0-6598f22d3451@gmail.com> In-Reply-To: <20250929-ppp_light_accel_mag_vol-down-v4-0-6598f22d3451@gmail.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Rudraksha Gupta , Ondrej Jirman , Martijn Braam , =?utf-8?q?Kamil_Trzci=C5=84ski?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1759131312; l=2306; i=guptarud@gmail.com; s=20240916; h=from:subject:message-id; bh=/lKiD65MbRWEXijfwwhiyC0MPS0vO7bZZUd/tftK3Ok=; b=Mv7RMAhsAjMFMpCjbxt8lewBE9asnKX3oaeMWL7sBzt7hMppyU5mfnZhti464TMiN9hm7Ljat +f9sM8uRhuRBLoBty12REVq3oa6cAf/qo1sMPKytS5CdRSZYLCcTm3+ X-Developer-Key: i=guptarud@gmail.com; a=ed25519; pk=ETrudRugWAtOpr0OhRiheQ1lXM4Kk4KGFnBySlKDi2I= X-Endpoint-Received: by B4 Relay for guptarud@gmail.com/20240916 with auth_id=211 X-Original-From: Rudraksha Gupta Reply-To: guptarud@gmail.com From: Ondrej Jirman Pinephone Pro uses STK3311 according to the schematics. Tests: ~ $ hwtest # output tweaked to fit in 80 chars Category proximity Model stk3310 Path /sys/bus/iio/devices/iio:device0 Status working Value 59.3 (when covered) and 2.2 (when uncovered) Category illuminance Model stk3310 Path /sys/bus/iio/devices/iio:device0 Status working Value 1 (when covered) and 101 (when uncovered) ~ $ monitor-sensor // When the sensor is exposed, it get's fluctating values such as Light changed: 1.800000 (lux) Light changed: 1.700000 (lux) Light changed: 1.800000 (lux) Light changed: 1.700000 (lux) Light changed: 1.600000 (lux) Light changed: 1.100000 (lux) // When covering the sensor, it prints a low value and stops printing Light changed: 0.200000 (lux) Co-developed-by: Martijn Braam Signed-off-by: Martijn Braam Co-developed-by: Kamil Trzci=C5=84ski Signed-off-by: Kamil Trzci=C5=84ski Signed-off-by: Ondrej Jirman Signed-off-by: Rudraksha Gupta --- arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/a= rm64/boot/dts/rockchip/rk3399-pinephone-pro.dts index 6f97e57f36f5599f4027a0f3db98bcbc69cef5e5..71d32c4bae0d0336ac0c9120436= 18fc9b94919ef 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts @@ -520,6 +520,15 @@ touchscreen@14 { touchscreen-size-x =3D <720>; touchscreen-size-y =3D <1440>; }; + + light-sensor@48 { + compatible =3D "sensortek,stk3311"; + reg =3D <0x48>; + interrupt-parent =3D <&gpio4>; + interrupts =3D ; + pinctrl-names =3D "default"; + pinctrl-0 =3D <&stk3311_int>; + }; }; =20 &i2c4 { @@ -689,6 +698,12 @@ vcc1v8_codec_en: vcc1v8-codec-en { }; }; =20 + stk3311 { + stk3311_int: stk3311-int { + rockchip,pins =3D <4 RK_PD3 RK_FUNC_GPIO &pcfg_input_pull_up>; + }; + }; + wireless-bluetooth { bt_wake_pin: bt-wake-pin { rockchip,pins =3D <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; --=20 2.51.0 From nobody Wed Oct 1 22:38:31 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02BEF23D7E5; Mon, 29 Sep 2025 07:35:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759131314; cv=none; b=aG4MMpwiYQRgC2P1U0UWYWo8v7xDXf0py2lgL3McT4py/x8X/1RLHDqyttH/1L8tb3FrT2sa1i7/Q4MYDwT6+0/RJ2f1RCdzS7xZvYR4wP2StBr6WRgxQTwIJxyQ8gqIQV6C/tSBadwKh6gm5isJL+eKIm5N0a+jUCwpIHYbPEA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759131314; c=relaxed/simple; bh=Bay7gvRD8WEKKONQKFBF0O+fwmVm+YlEq+tKHT0KRKA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Mm2UXpJa8eK+ifyLqi5xgYAFCMLUBIC0v7sWpxIXVZm8go8N3eqNrmmEYpq+g8IVQMcpGv2Ua3qvXJiHHojjUQjQdrtrVKbpYIqNFfTCi5e+VDnj9CqrbvdbCntlSj1NDNeF8pPXmQ21Zz1fUNNA5hON2eUtn9hef/wEq7nPus8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CaAg0DaB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CaAg0DaB" Received: by smtp.kernel.org (Postfix) with ESMTPS id 8DFE7C4AF0B; Mon, 29 Sep 2025 07:35:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1759131313; bh=Bay7gvRD8WEKKONQKFBF0O+fwmVm+YlEq+tKHT0KRKA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=CaAg0DaBk5igaM4TpFf1Au1liTovydHaKRSmeHMjrQndyPaQw//SrhK55m5PfGPFT Y75bhR+ulDCix/+e3cjFIVBgyA2kbATTNzy3Y88lLyyHBzU1KzM0HAVhmH2DiLRj1+ rKIcE+yKlSGYg5K8mEYBKrqrRboZ2XsALfrL9mEzDn4omnmMNRjWiLbt/2YcFxn2bf PuNUTZodimMQ/ssoCXIg/K+5+ruIhXOFR8qVHdx/oycZZ6aXiYpFxv4jtJFFG741pS D6IqXKMDKTXjlvHPiW67gabuuZlBmV063n7LPTQ3ZhUzxx8ihDWb/3czQQvdch8VZt SOkrtRiPAFoyg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A8A4CAC5B5; Mon, 29 Sep 2025 07:35:13 +0000 (UTC) From: Rudraksha Gupta via B4 Relay Date: Mon, 29 Sep 2025 00:35:13 -0700 Subject: [PATCH v4 2/4] arm64: dts: rk3399-pinephone-pro: Add accelerometer sensor support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250929-ppp_light_accel_mag_vol-down-v4-2-6598f22d3451@gmail.com> References: <20250929-ppp_light_accel_mag_vol-down-v4-0-6598f22d3451@gmail.com> In-Reply-To: <20250929-ppp_light_accel_mag_vol-down-v4-0-6598f22d3451@gmail.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Rudraksha Gupta , Ondrej Jirman , Martijn Braam , =?utf-8?q?Kamil_Trzci=C5=84ski?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1759131312; l=1864; i=guptarud@gmail.com; s=20240916; h=from:subject:message-id; bh=BRZsP1UdL6OFWqM2mRykWAS8dysAco3k6Kyv3eBDv+E=; b=qUkXHOgkg9QDIAccXCuh9iCn8uQ3DvTVFAEX5pjOxmDyP/Lb8YzSzOTQ9g1e2KPPpd/59qbKB g0enuB+eYi2Cnr3VE6toJhAopuGqneFWjEEu9KY9/XFj1TSugfTHMNz X-Developer-Key: i=guptarud@gmail.com; a=ed25519; pk=ETrudRugWAtOpr0OhRiheQ1lXM4Kk4KGFnBySlKDi2I= X-Endpoint-Received: by B4 Relay for guptarud@gmail.com/20240916 with auth_id=211 X-Original-From: Rudraksha Gupta Reply-To: guptarud@gmail.com From: Ondrej Jirman Pinephone Pro uses mpu6500 according to the schematic. Tests: // Setup: This watches the raw values from the device. The variable with // the biggest magnitude and its sign will be recorded $ sudo systemctl stop iio-sensor-proxy $ cat /sys/bus/iio/devices/iio:device3/in_accel_{x,y,z}_raw // Let's start with phone screen facing up to the sky and the charger // port closer to you than the front camera. z: -16000 // Tilt the phone onto it's left edge x: -16000 // Tilt the phone onto it's right edge x: 16000 // Tilt the phone so that the charger port is pointing straight up to // the sky y: -16000 // Tilt the phone so that the top of the phone is pointing straight up // to the sky y: 16000 // Put the phone face down so the screen is touching the table z: 16000 Co-developed-by: Martijn Braam Signed-off-by: Martijn Braam Co-developed-by: Kamil Trzci=C5=84ski Signed-off-by: Kamil Trzci=C5=84ski Signed-off-by: Ondrej Jirman Signed-off-by: Rudraksha Gupta --- arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/a= rm64/boot/dts/rockchip/rk3399-pinephone-pro.dts index 71d32c4bae0d0336ac0c912043618fc9b94919ef..d9f18a8005f15f3ec26e086e5b4= 51bf1bbdc21c0 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts @@ -542,7 +542,13 @@ mpu6500@68 { reg =3D <0x68>; interrupt-parent =3D <&gpio1>; interrupts =3D ; + vdd-supply =3D <&vcc_1v8>; vddio-supply =3D <&vcc_1v8>; + + mount-matrix =3D + "1", "0", "0", + "0", "1", "0", + "0", "0", "-1"; }; }; =20 --=20 2.51.0 From nobody Wed Oct 1 22:38:31 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 11A842BEFF8; Mon, 29 Sep 2025 07:35:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759131314; cv=none; b=J9y+1xDqW1VPKDfh+H3QY8V6bB2NOuCvMmzXO2U/FLu7qM4Y/yZ4X/mzmJu+xssW24NVRRXoAwx/oj3MoA9PzMOoavC8tsWxMeSsQlDHAJI7etGNANLzEglW3ysrpcz9HN46DvmUsq255UWIAOGefuw0+9EdzDNY5xxWRYkizcU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759131314; c=relaxed/simple; bh=ihi3rYla53IgJpcZ5+Rg8bD/8aOc1SIfXRzrBf28D1k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LOyNNrCtWDABehtTyBK06v8yZQshKgH941aeVVvTWG+aUgFzWoISQBdmo7EvV3KlkAiI5iv2iQrg9TVyofdY/t0QiJq6+UF7Qa5ZcGOdonfL3ZGjMS+VfA7tDOxv2S205DIuJu7lQA79b/jNFWKtO8oDYecvzcmc3vUtQu7ZAQ4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IUrCWLjh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IUrCWLjh" Received: by smtp.kernel.org (Postfix) with ESMTPS id A536AC19423; Mon, 29 Sep 2025 07:35:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1759131313; bh=ihi3rYla53IgJpcZ5+Rg8bD/8aOc1SIfXRzrBf28D1k=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=IUrCWLjhlUyXCqlWiUUBi93SzYibO2iSA3sqGvCMjcINkd6gBzRtjdt3N30hkqnv4 ErOVCCoJ+uT207gngLCwNpIuqNwnY1BBFshFz87zNRhmb4YtM4oEKLBligbHpYHkq9 O3XKauKyttEgAa2z1VLuOU4XMZJx/hSkMhQ7uo1DKAo98U6eS+G09dPp01LqT0hH+u MIY9tLX94mkd6k9TM+D07gIdKPNpftrWvfAKoIwKdfPQzE2XTWciAJFn58HKI4FrhU W3ydoRY9DBTe5g8u7qWaQM6H+ZYAv6DNsphWqFufHRkSs+hr+bamAxnndm89KmLZJE rrHB+96UlW+xg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8AE7ECCA468; Mon, 29 Sep 2025 07:35:13 +0000 (UTC) From: Rudraksha Gupta via B4 Relay Date: Mon, 29 Sep 2025 00:35:14 -0700 Subject: [PATCH v4 3/4] arm64: dts: rk3399-pinephone-pro: Add magnetometer sensor support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250929-ppp_light_accel_mag_vol-down-v4-3-6598f22d3451@gmail.com> References: <20250929-ppp_light_accel_mag_vol-down-v4-0-6598f22d3451@gmail.com> In-Reply-To: <20250929-ppp_light_accel_mag_vol-down-v4-0-6598f22d3451@gmail.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Rudraksha Gupta , Ondrej Jirman , "Leonardo G. Trombetta" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1759131312; l=4263; i=guptarud@gmail.com; s=20240916; h=from:subject:message-id; bh=S5umEu3plIvdlAlu0DHnlI56aihH8rzrPou0aCxlWwA=; b=8A+MabpmYTKjEWg8Kdhs+k4P7zheIaYFrC3Dy3SKD6aShC215FksWT1sZq/X/9j+p7JN/alAD C8NAQmZqzsfA4uEwZU39mjFYc8HgGC31p31CBwFsm5M62i9VJZVm1hn X-Developer-Key: i=guptarud@gmail.com; a=ed25519; pk=ETrudRugWAtOpr0OhRiheQ1lXM4Kk4KGFnBySlKDi2I= X-Endpoint-Received: by B4 Relay for guptarud@gmail.com/20240916 with auth_id=211 X-Original-From: Rudraksha Gupta Reply-To: guptarud@gmail.com From: Ondrej Jirman Pinephone Pro uses AF8133J according to the schematic. The mount-matrix was added by Leonardo on top of Ondrej's work of adding the magnetometer. Test: Script: ``` DEVICE=3D"/sys/bus/iio/devices/iio:device2" X=3D$(cat $DEVICE/in_magn_x_raw) Y=3D$(cat $DEVICE/in_magn_y_raw) Z=3D$(cat $DEVICE/in_magn_z_raw) X_MIN=3D$X; X_MAX=3D$X Y_MIN=3D$Y; Y_MAX=3D$Y Z_MIN=3D$Z; Z_MAX=3D$Z START_TIME=3D$(date +%s) while [ $(($(date +%s) - START_TIME)) -lt 10 ]; do X=3D$(cat $DEVICE/in_magn_x_raw) Y=3D$(cat $DEVICE/in_magn_y_raw) Z=3D$(cat $DEVICE/in_magn_z_raw) [ "$X" -lt "$X_MIN" ] && X_MIN=3D$X [ "$X" -gt "$X_MAX" ] && X_MAX=3D$X [ "$Y" -lt "$Y_MIN" ] && Y_MIN=3D$Y [ "$Y" -gt "$Y_MAX" ] && Y_MAX=3D$Y [ "$Z" -lt "$Z_MIN" ] && Z_MIN=3D$Z [ "$Z" -gt "$Z_MAX" ] && Z_MAX=3D$Z done echo "X_MIN: $X_MIN X_MAX: $X_MAX" echo "Y_MIN: $Y_MIN Y_MAX: $Y_MAX" echo "Z_MIN: $Z_MIN Z_MAX: $Z_MAX" ``` Link: https://github.com/torvalds/linux/blob/master/Documentation/devicetre= e/bindings/iio/mount-matrix.txt#L93 // phone on a flat surface top of the phone pointing north and bottom of phone pointing south x (between -2379 and -2263) y (between 109 and 207) z (between -2340 and -2132) top of the phone pointing south and bottom of phone pointing north x (between -1079 and -956) y (between -54 and 46) z (between -1831 and -1621) top of the phone pointing east and bottom of phone pointing west x (between -1587 and -1473) y (between -448 and -339) z (between -1850 and -1602) top of the phone pointing west and bottom of phone pointing east x (between -1426 and -1300) y (between 554 and 661) z (between -1917 and -1706) // the following tests are where the phone is tilted at a 45 degree // angle and the top of phone is pointing up to the sky: top of the phone pointing north and bottom of phone pointing south x (between -1300 and -1189) y (between 117 and 227) z (between -1819 and -1614) top of the phone pointing south and bottom of phone pointing north x (between -539 and -422) y (between 23 and 143) z (between -1160 and -922) top of the phone pointing east and bottom of phone pointing west x (between -1038 and -915) y (between -408 and -313) z (between -1570 and -1345) top of the phone pointing west and bottom of phone pointing east x (between -965 and -849) y (between 540 and 641) z (between -1542 and -1336) // the following tests are where the phone is tilted at a 45 degree // angle and the top of phone is pointing down to the ground: top of the phone pointing north and bottom of phone pointing south x (between -2345 and -2237) y (between 80 and 189) z (between -1207 and -971) top of the phone pointing south and bottom of phone pointing north x (between -1805 and -1691) y (between 5 and 112) z (between -1896 and -1651) top of the phone pointing east and bottom of phone pointing west x (between -2127 and -2013) y (between 460 and 563) z (between -1621 and -1378) top of the phone pointing west and bottom of phone pointing east x (between -2158 and -2054) y (between -376 and -264) z (between -1540 and -1262) Co-developed-by: Leonardo G. Trombetta Signed-off-by: Leonardo G. Trombetta Signed-off-by: Ondrej Jirman Signed-off-by: Rudraksha Gupta --- arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/a= rm64/boot/dts/rockchip/rk3399-pinephone-pro.dts index d9f18a8005f15f3ec26e086e5b451bf1bbdc21c0..05aaf152b5efa5a87663fc97ce0= 34e75131670bb 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts @@ -552,6 +552,21 @@ mpu6500@68 { }; }; =20 +&i2c4 { + af8133j: compass@1c { + compatible =3D "voltafield,af8133j"; + reg =3D <0x1c>; + reset-gpios =3D <&gpio1 RK_PA1 GPIO_ACTIVE_LOW>; + avdd-supply =3D <&vcc_3v0>; + dvdd-supply =3D <&vcc_1v8>; + + mount-matrix =3D + "0", "1", "0", + "1", "0", "0", + "0", "0", "-1"; + }; +}; + &io_domains { bt656-supply =3D <&vcc1v8_dvp>; audio-supply =3D <&vcca1v8_codec>; --=20 2.51.0 From nobody Wed Oct 1 22:38:31 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 11B2E2BF3DB; Mon, 29 Sep 2025 07:35:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759131314; cv=none; b=EfL/yASEcOBqUj4sfo00jXgMROAEoP/fCH+94O5oiA03D3bLAEPdV6kNbhCIaZ5EZD6wFr6jusrK7D/jggVJp1Wa+4HD7MqcOThL1UZ2TUji0IF2cU8qRy0RI/wJN2dIy0s0Ix6oSWTum+vFrmoNPbiiZM/ugW8c7huI8LL59Dg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759131314; c=relaxed/simple; bh=7NYQN/xl5KhOZgk379tTGk/P5gU5kC6zCwf6FS1ZnTQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Q+BUGPJhxKBR7wrSTflRV21vbmeXlqMwRQyJMxrzb6YvlraaTYvik4gYrvUKOm/xIcenyyVv+kWc9L8zExwub27fP0imJVz8G1j+ZU9ZWB6bJnbiR4kagjJnp8Wr9w2IMlXd2A7UzwApGtx979Eh6dlUVh57RF8FZfoKF2JPWsY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=o2hZtDgb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="o2hZtDgb" Received: by smtp.kernel.org (Postfix) with ESMTPS id A3A79C19422; Mon, 29 Sep 2025 07:35:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1759131313; bh=7NYQN/xl5KhOZgk379tTGk/P5gU5kC6zCwf6FS1ZnTQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=o2hZtDgb5K9QlOfTjC98L5iRwA7E8xwtpmOTUYjQTtwmEBdwX/LOug36uTyqiqae8 QjdqwHSQHR8HUKfGoX83DEpcxvsQMFiyUABwTzkySgbYboeaMbGlTYNiq28Kdo3HtU YMZ+a9WPJZg1OGXNzDZAzc0jXkImKI+lIa4TYoVVQBzJJ3okUw2HllPY52K6PLKds0 dH1S/ktWVuM3L30nSi8dFAVddjBrSf/4kSBtgDolrEkG212c1pIAjr63vmHcfQMsgy rYSavRbn4tLGwXRHJ/7IVEnJg+68bFXk153AMil8UhVJLZtOQVIrlI3YhgTCYcbMoA 0SidfooQBnmYA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BAA4CAC5BD; Mon, 29 Sep 2025 07:35:13 +0000 (UTC) From: Rudraksha Gupta via B4 Relay Date: Mon, 29 Sep 2025 00:35:15 -0700 Subject: [PATCH v4 4/4] arm64: dts: rk3399-pinephone-pro: Fix voltage threshold for volume keys Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250929-ppp_light_accel_mag_vol-down-v4-4-6598f22d3451@gmail.com> References: <20250929-ppp_light_accel_mag_vol-down-v4-0-6598f22d3451@gmail.com> In-Reply-To: <20250929-ppp_light_accel_mag_vol-down-v4-0-6598f22d3451@gmail.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Rudraksha Gupta , Ondrej Jirman X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1759131312; l=1565; i=guptarud@gmail.com; s=20240916; h=from:subject:message-id; bh=GpUQl51v5pQWdXs2BOWJyovxr7JU7F5Mge6gevMi3Lg=; b=ab+W3K7XcZNNPkj23XjF8RuvULAYxDqRHxKlFjqVR6ZPwZRRPaYRduyUSHUAvKCp5CjHrBRh1 DFFnuf1ZL/cDshMh6NFs21K2ORl4epAIXZULo5mGQaKSbeKqpBQ12/D X-Developer-Key: i=guptarud@gmail.com; a=ed25519; pk=ETrudRugWAtOpr0OhRiheQ1lXM4Kk4KGFnBySlKDi2I= X-Endpoint-Received: by B4 Relay for guptarud@gmail.com/20240916 with auth_id=211 X-Original-From: Rudraksha Gupta Reply-To: guptarud@gmail.com From: Ondrej Jirman Previously sometimes pressing the volume-down button would register as a volume-up button. Match the thresholds as shown in the Pinephone Pro schematic. Tests: ~ $ evtest // Mashed the volume down ~100 times with varying intensity Event: time xxx, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 1 Event: time xxx, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 0 // Mashed the volume up ~100 times with varying intensity Event: time xxx, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 1 Event: time xxx, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 0 Signed-off-by: Ondrej Jirman Signed-off-by: Rudraksha Gupta --- arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/a= rm64/boot/dts/rockchip/rk3399-pinephone-pro.dts index 05aaf152b5efa5a87663fc97ce034e75131670bb..e7b0d965df6f5daa3e1b7ff98d5= 67b74e8c7715f 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts @@ -40,13 +40,13 @@ adc-keys { button-up { label =3D "Volume Up"; linux,code =3D ; - press-threshold-microvolt =3D <100000>; + press-threshold-microvolt =3D <2000>; }; =20 button-down { label =3D "Volume Down"; linux,code =3D ; - press-threshold-microvolt =3D <600000>; + press-threshold-microvolt =3D <300000>; }; }; =20 --=20 2.51.0