* [PATCH v4 0/4] Upstreaming Pinephone Pro Patches
@ 2025-09-29 7:35 Rudraksha Gupta via B4 Relay
2025-09-29 7:35 ` [PATCH v4 1/4] arm64: dts: rk3399-pinephone-pro: Add light/proximity sensor support Rudraksha Gupta via B4 Relay
` (5 more replies)
0 siblings, 6 replies; 14+ messages in thread
From: Rudraksha Gupta via B4 Relay @ 2025-09-29 7:35 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner
Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Rudraksha Gupta, Ondrej Jirman, Martijn Braam,
Kamil Trzciński, Leonardo G. Trombetta
Throughout the years, many have contributed to the Pinephone Pro (ppp)
development. Unfortunately, these patches are scattered around various
repositories in different states.
I will be attempting to upstream these patches. I will start off with the
following small series:
- Add light/proximity sensor support
- Link: https://codeberg.org/megi/linux/commit/f171bc7013bc7ad3de9af817bfbcbfa548ebe01c
- Add accelerometer sensor support
- Link: https://codeberg.org/megi/linux/commit/b0bb7633e073a6760fa213b8c4a78ea2e73c7bf1
- Add magnetometer sensor support
- Link: https://codeberg.org/megi/linux/commit/2f7e67f451f16eaf15b81aa1dbdf126d54927d35
- Add mount-matrix for magnetometer
- Link: https://codeberg.org/megi/linux/commit/d7cd2eab931e32fa94408a96d73b4e6c0616107a
- Fix voltage threshold for volume down key
- Link: https://codeberg.org/megi/linux/commit/7c496a5cc27ed4e38b740f36c2d8b2c62f80ae54
Unfortunately, because most of userspace (plasma, phosh, kompass,
hwtest, etc.) use the ppp's downstream kernel as a reference, the
incorrect mount matrix for accelerometer and magnetometer have
propogated to userspace, and therefore we can't use them for testing as
they will give the wrong result. Instead, we have to read the raw values
from the device and compare it to
https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/iio/mount-matrix.txt#L80-L90
as that will lead to the correct result
I would request reviewers to look at the mount-matrix tests and help me
see if they make sense. I've read the mount-matrix documentation, but it
isn't really clear to me if the values in the tests are the values I
should be getting
Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
---
Changes in v4:
- remove leda-supply and vdd-supply from dts to suppress warning
- credit Martijn and Kamil for the light sensor and accelerometer patches
- Link: https://fosstodon.org/@martijnbraam/115272859701389599
- Link: https://codeberg.org/megi/linux/commit/fc5660685ebe4ecf60226bfa27a1ce47c1c1d020
- combine the magnetometer related patches
- corrected accelerometer's mount matrix to Documentation/devicetree/bindings/iio/mount-matrix.txt
- filled out commit messages
- rebased onto v6.17
- Link to v3: https://lore.kernel.org/r/20250921-ppp_light_accel_mag_vol-down-v3-0-7af6651f77e4@gmail.com
Changes in v3:
- change magnetometer mount matrix
- update volume button threshold
- Link to v2: https://lore.kernel.org/r/20250921-ppp_light_accel_mag_vol-down-v2-0-e6bcc6ca74ae@gmail.com
Changes in v2:
- remove usb-typec node in dts from light/proximity sensor patch
- Link to v1: https://lore.kernel.org/r/20250920-ppp_light_accel_mag_vol-down-v1-0-c8bbcd3e2e94@gmail.com
---
Ondrej Jirman (4):
arm64: dts: rk3399-pinephone-pro: Add light/proximity sensor support
arm64: dts: rk3399-pinephone-pro: Add accelerometer sensor support
arm64: dts: rk3399-pinephone-pro: Add magnetometer sensor support
arm64: dts: rk3399-pinephone-pro: Fix voltage threshold for volume keys
.../boot/dts/rockchip/rk3399-pinephone-pro.dts | 40 ++++++++++++++++++++--
1 file changed, 38 insertions(+), 2 deletions(-)
---
base-commit: e5f0a698b34ed76002dc5cff3804a61c80233a7a
change-id: 20250920-ppp_light_accel_mag_vol-down-817c84fdae8d
Best regards,
--
Rudraksha Gupta <guptarud@gmail.com>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v4 1/4] arm64: dts: rk3399-pinephone-pro: Add light/proximity sensor support
2025-09-29 7:35 [PATCH v4 0/4] Upstreaming Pinephone Pro Patches Rudraksha Gupta via B4 Relay
@ 2025-09-29 7:35 ` Rudraksha Gupta via B4 Relay
2025-09-29 9:57 ` Diederik de Haas
2025-09-29 7:35 ` [PATCH v4 2/4] arm64: dts: rk3399-pinephone-pro: Add accelerometer " Rudraksha Gupta via B4 Relay
` (4 subsequent siblings)
5 siblings, 1 reply; 14+ messages in thread
From: Rudraksha Gupta via B4 Relay @ 2025-09-29 7:35 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner
Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Rudraksha Gupta, Ondrej Jirman, Martijn Braam,
Kamil Trzciński
From: Ondrej Jirman <megi@xff.cz>
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 <martijn@brixit.nl>
Signed-off-by: Martijn Braam <martijn@brixit.nl>
Co-developed-by: Kamil Trzciński <ayufan@ayufan.eu>
Signed-off-by: Kamil Trzciński <ayufan@ayufan.eu>
Signed-off-by: Ondrej Jirman <megi@xff.cz>
Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
---
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/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
index 6f97e57f36f5599f4027a0f3db98bcbc69cef5e5..71d32c4bae0d0336ac0c912043618fc9b94919ef 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 = <720>;
touchscreen-size-y = <1440>;
};
+
+ light-sensor@48 {
+ compatible = "sensortek,stk3311";
+ reg = <0x48>;
+ interrupt-parent = <&gpio4>;
+ interrupts = <RK_PD3 IRQ_TYPE_EDGE_FALLING>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&stk3311_int>;
+ };
};
&i2c4 {
@@ -689,6 +698,12 @@ vcc1v8_codec_en: vcc1v8-codec-en {
};
};
+ stk3311 {
+ stk3311_int: stk3311-int {
+ rockchip,pins = <4 RK_PD3 RK_FUNC_GPIO &pcfg_input_pull_up>;
+ };
+ };
+
wireless-bluetooth {
bt_wake_pin: bt-wake-pin {
rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
--
2.51.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v4 2/4] arm64: dts: rk3399-pinephone-pro: Add accelerometer sensor support
2025-09-29 7:35 [PATCH v4 0/4] Upstreaming Pinephone Pro Patches Rudraksha Gupta via B4 Relay
2025-09-29 7:35 ` [PATCH v4 1/4] arm64: dts: rk3399-pinephone-pro: Add light/proximity sensor support Rudraksha Gupta via B4 Relay
@ 2025-09-29 7:35 ` Rudraksha Gupta via B4 Relay
2025-10-22 11:11 ` Pavel Machek
2025-09-29 7:35 ` [PATCH v4 3/4] arm64: dts: rk3399-pinephone-pro: Add magnetometer " Rudraksha Gupta via B4 Relay
` (3 subsequent siblings)
5 siblings, 1 reply; 14+ messages in thread
From: Rudraksha Gupta via B4 Relay @ 2025-09-29 7:35 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner
Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Rudraksha Gupta, Ondrej Jirman, Martijn Braam,
Kamil Trzciński
From: Ondrej Jirman <megi@xff.cz>
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 <martijn@brixit.nl>
Signed-off-by: Martijn Braam <martijn@brixit.nl>
Co-developed-by: Kamil Trzciński <ayufan@ayufan.eu>
Signed-off-by: Kamil Trzciński <ayufan@ayufan.eu>
Signed-off-by: Ondrej Jirman <megi@xff.cz>
Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
---
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/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
index 71d32c4bae0d0336ac0c912043618fc9b94919ef..d9f18a8005f15f3ec26e086e5b451bf1bbdc21c0 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 = <0x68>;
interrupt-parent = <&gpio1>;
interrupts = <RK_PC6 IRQ_TYPE_LEVEL_LOW>;
+ vdd-supply = <&vcc_1v8>;
vddio-supply = <&vcc_1v8>;
+
+ mount-matrix =
+ "1", "0", "0",
+ "0", "1", "0",
+ "0", "0", "-1";
};
};
--
2.51.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v4 3/4] arm64: dts: rk3399-pinephone-pro: Add magnetometer sensor support
2025-09-29 7:35 [PATCH v4 0/4] Upstreaming Pinephone Pro Patches Rudraksha Gupta via B4 Relay
2025-09-29 7:35 ` [PATCH v4 1/4] arm64: dts: rk3399-pinephone-pro: Add light/proximity sensor support Rudraksha Gupta via B4 Relay
2025-09-29 7:35 ` [PATCH v4 2/4] arm64: dts: rk3399-pinephone-pro: Add accelerometer " Rudraksha Gupta via B4 Relay
@ 2025-09-29 7:35 ` Rudraksha Gupta via B4 Relay
2025-10-22 11:12 ` Pavel Machek
2025-09-29 7:35 ` [PATCH v4 4/4] arm64: dts: rk3399-pinephone-pro: Fix voltage threshold for volume keys Rudraksha Gupta via B4 Relay
` (2 subsequent siblings)
5 siblings, 1 reply; 14+ messages in thread
From: Rudraksha Gupta via B4 Relay @ 2025-09-29 7:35 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner
Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Rudraksha Gupta, Ondrej Jirman, Leonardo G. Trombetta
From: Ondrej Jirman <megi@xff.cz>
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="/sys/bus/iio/devices/iio:device2"
X=$(cat $DEVICE/in_magn_x_raw)
Y=$(cat $DEVICE/in_magn_y_raw)
Z=$(cat $DEVICE/in_magn_z_raw)
X_MIN=$X; X_MAX=$X
Y_MIN=$Y; Y_MAX=$Y
Z_MIN=$Z; Z_MAX=$Z
START_TIME=$(date +%s)
while [ $(($(date +%s) - START_TIME)) -lt 10 ]; do
X=$(cat $DEVICE/in_magn_x_raw)
Y=$(cat $DEVICE/in_magn_y_raw)
Z=$(cat $DEVICE/in_magn_z_raw)
[ "$X" -lt "$X_MIN" ] && X_MIN=$X
[ "$X" -gt "$X_MAX" ] && X_MAX=$X
[ "$Y" -lt "$Y_MIN" ] && Y_MIN=$Y
[ "$Y" -gt "$Y_MAX" ] && Y_MAX=$Y
[ "$Z" -lt "$Z_MIN" ] && Z_MIN=$Z
[ "$Z" -gt "$Z_MAX" ] && Z_MAX=$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/devicetree/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 <lgtrombetta@gmx.com>
Signed-off-by: Leonardo G. Trombetta <lgtrombetta@gmx.com>
Signed-off-by: Ondrej Jirman <megi@xff.cz>
Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
---
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/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
index d9f18a8005f15f3ec26e086e5b451bf1bbdc21c0..05aaf152b5efa5a87663fc97ce034e75131670bb 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 {
};
};
+&i2c4 {
+ af8133j: compass@1c {
+ compatible = "voltafield,af8133j";
+ reg = <0x1c>;
+ reset-gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_LOW>;
+ avdd-supply = <&vcc_3v0>;
+ dvdd-supply = <&vcc_1v8>;
+
+ mount-matrix =
+ "0", "1", "0",
+ "1", "0", "0",
+ "0", "0", "-1";
+ };
+};
+
&io_domains {
bt656-supply = <&vcc1v8_dvp>;
audio-supply = <&vcca1v8_codec>;
--
2.51.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v4 4/4] arm64: dts: rk3399-pinephone-pro: Fix voltage threshold for volume keys
2025-09-29 7:35 [PATCH v4 0/4] Upstreaming Pinephone Pro Patches Rudraksha Gupta via B4 Relay
` (2 preceding siblings ...)
2025-09-29 7:35 ` [PATCH v4 3/4] arm64: dts: rk3399-pinephone-pro: Add magnetometer " Rudraksha Gupta via B4 Relay
@ 2025-09-29 7:35 ` Rudraksha Gupta via B4 Relay
2025-10-22 11:13 ` Pavel Machek
2025-09-29 8:32 ` [PATCH v4 0/4] Upstreaming Pinephone Pro Patches Dragan Simic
2025-10-22 11:09 ` Pavel Machek
5 siblings, 1 reply; 14+ messages in thread
From: Rudraksha Gupta via B4 Relay @ 2025-09-29 7:35 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner
Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Rudraksha Gupta, Ondrej Jirman
From: Ondrej Jirman <megi@xff.cz>
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 <megi@xff.cz>
Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
---
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/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
index 05aaf152b5efa5a87663fc97ce034e75131670bb..e7b0d965df6f5daa3e1b7ff98d567b74e8c7715f 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 = "Volume Up";
linux,code = <KEY_VOLUMEUP>;
- press-threshold-microvolt = <100000>;
+ press-threshold-microvolt = <2000>;
};
button-down {
label = "Volume Down";
linux,code = <KEY_VOLUMEDOWN>;
- press-threshold-microvolt = <600000>;
+ press-threshold-microvolt = <300000>;
};
};
--
2.51.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v4 0/4] Upstreaming Pinephone Pro Patches
2025-09-29 7:35 [PATCH v4 0/4] Upstreaming Pinephone Pro Patches Rudraksha Gupta via B4 Relay
` (3 preceding siblings ...)
2025-09-29 7:35 ` [PATCH v4 4/4] arm64: dts: rk3399-pinephone-pro: Fix voltage threshold for volume keys Rudraksha Gupta via B4 Relay
@ 2025-09-29 8:32 ` Dragan Simic
2025-09-29 15:39 ` Heiko Stuebner
2025-10-22 11:09 ` Pavel Machek
5 siblings, 1 reply; 14+ messages in thread
From: Dragan Simic @ 2025-09-29 8:32 UTC (permalink / raw)
To: guptarud
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Ondrej Jirman, Martijn Braam, Kamil Trzciński,
Leonardo G. Trombetta
Hello Rudraksha,
On 2025-09-29 09:35, Rudraksha Gupta via B4 Relay wrote:
> arm64: dts: rk3399-pinephone-pro: Add light/proximity sensor
> support
> arm64: dts: rk3399-pinephone-pro: Add accelerometer sensor
> support
> arm64: dts: rk3399-pinephone-pro: Add magnetometer sensor support
> arm64: dts: rk3399-pinephone-pro: Fix voltage threshold for
> volume keys
Please note that the patch summaries/subjects are still a bit
wrong in the v4 of this series, because there should be no
"rk3399-pinephone-pro:" prefixes in them.
You can always check the commit history for the file you're
editing, to see what's the expected format of the patch summary.
It differs a bit between the subsystems and architectures, so
it should always be checked.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 1/4] arm64: dts: rk3399-pinephone-pro: Add light/proximity sensor support
2025-09-29 7:35 ` [PATCH v4 1/4] arm64: dts: rk3399-pinephone-pro: Add light/proximity sensor support Rudraksha Gupta via B4 Relay
@ 2025-09-29 9:57 ` Diederik de Haas
2025-10-07 5:59 ` Rudraksha Gupta
0 siblings, 1 reply; 14+ messages in thread
From: Diederik de Haas @ 2025-09-29 9:57 UTC (permalink / raw)
To: guptarud, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Heiko Stuebner
Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Ondrej Jirman, Martijn Braam, Kamil Trzciński
[-- Attachment #1: Type: text/plain, Size: 1954 bytes --]
Hi,
On Mon Sep 29, 2025 at 9:35 AM CEST, Rudraksha Gupta via B4 Relay wrote:
> From: Ondrej Jirman <megi@xff.cz>
>
> Pinephone Pro uses STK3311 according to the schematics.
> ...
> Co-developed-by: Martijn Braam <martijn@brixit.nl>
> Signed-off-by: Martijn Braam <martijn@brixit.nl>
> Co-developed-by: Kamil Trzciński <ayufan@ayufan.eu>
> Signed-off-by: Kamil Trzciński <ayufan@ayufan.eu>
> Signed-off-by: Ondrej Jirman <megi@xff.cz>
> Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
> ---
> 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/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
> index 6f97e57f36f5599f4027a0f3db98bcbc69cef5e5..71d32c4bae0d0336ac0c912043618fc9b94919ef 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 = <720>;
> touchscreen-size-y = <1440>;
> };
> +
> + light-sensor@48 {
> + compatible = "sensortek,stk3311";
> + reg = <0x48>;
> + interrupt-parent = <&gpio4>;
> + interrupts = <RK_PD3 IRQ_TYPE_EDGE_FALLING>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&stk3311_int>;
> + };
> };
>
> &i2c4 {
> @@ -689,6 +698,12 @@ vcc1v8_codec_en: vcc1v8-codec-en {
> };
> };
>
> + stk3311 {
> + stk3311_int: stk3311-int {
> + rockchip,pins = <4 RK_PD3 RK_FUNC_GPIO &pcfg_input_pull_up>;
On page 11 and 17 of PPP schematic V1.0-20211127 I see LIGHT_INT_L as
identifier so it's best to use that identifier here, thus
``light_int_l: light-int-l {``
and update the pinctrl-0 reference accordingly.
Cheers,
Diederik
> + };
> + };
> +
> wireless-bluetooth {
> bt_wake_pin: bt-wake-pin {
> rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 0/4] Upstreaming Pinephone Pro Patches
2025-09-29 8:32 ` [PATCH v4 0/4] Upstreaming Pinephone Pro Patches Dragan Simic
@ 2025-09-29 15:39 ` Heiko Stuebner
2025-10-07 5:56 ` Rudraksha Gupta
0 siblings, 1 reply; 14+ messages in thread
From: Heiko Stuebner @ 2025-09-29 15:39 UTC (permalink / raw)
To: guptarud, Dragan Simic
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, devicetree,
linux-arm-kernel, linux-rockchip, linux-kernel, Ondrej Jirman,
Martijn Braam, Kamil Trzciński, Leonardo G. Trombetta
Am Montag, 29. September 2025, 10:32:59 Mitteleuropäische Sommerzeit schrieb Dragan Simic:
> Hello Rudraksha,
>
> On 2025-09-29 09:35, Rudraksha Gupta via B4 Relay wrote:
> > arm64: dts: rk3399-pinephone-pro: Add light/proximity sensor
> > support
> > arm64: dts: rk3399-pinephone-pro: Add accelerometer sensor
> > support
> > arm64: dts: rk3399-pinephone-pro: Add magnetometer sensor support
> > arm64: dts: rk3399-pinephone-pro: Fix voltage threshold for
> > volume keys
>
> Please note that the patch summaries/subjects are still a bit
> wrong in the v4 of this series, because there should be no
> "rk3399-pinephone-pro:" prefixes in them.
>
> You can always check the commit history for the file you're
> editing, to see what's the expected format of the patch summary.
> It differs a bit between the subsystems and architectures, so
> it should always be checked.
for reference for Rockchip dts files, the preferred format is:
arm64: dts: rockchip: Do something on boardname
aka "arm64: dts: rockchip: " and the rest is free form but should
mention the board.
But I'll generally fix those up myself if needed, so right now
there is no need to resend just for that change.
Heiko
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 0/4] Upstreaming Pinephone Pro Patches
2025-09-29 15:39 ` Heiko Stuebner
@ 2025-10-07 5:56 ` Rudraksha Gupta
0 siblings, 0 replies; 14+ messages in thread
From: Rudraksha Gupta @ 2025-10-07 5:56 UTC (permalink / raw)
To: Heiko Stuebner, Dragan Simic
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, devicetree,
linux-arm-kernel, linux-rockchip, linux-kernel, Ondrej Jirman,
Martijn Braam, Kamil Trzciński, Leonardo G. Trombetta
Hello all,
> for reference for Rockchip dts files, the preferred format is:
> arm64: dts: rockchip: Do something on boardname
>
> aka "arm64: dts: rockchip: " and the rest is free form but should
> mention the board.
>
> But I'll generally fix those up myself if needed, so right now
> there is no need to resend just for that change.
Gotcha thanks! I'll leave this be for now while awaiting for comments on
the mount matrix for the accelerometer and the magnetometer.
Rudraksha
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 1/4] arm64: dts: rk3399-pinephone-pro: Add light/proximity sensor support
2025-09-29 9:57 ` Diederik de Haas
@ 2025-10-07 5:59 ` Rudraksha Gupta
0 siblings, 0 replies; 14+ messages in thread
From: Rudraksha Gupta @ 2025-10-07 5:59 UTC (permalink / raw)
To: Diederik de Haas, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Heiko Stuebner
Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Ondrej Jirman, Martijn Braam, Kamil Trzciński
Hello Diederik,
>> + stk3311 {
>> + stk3311_int: stk3311-int {
>> + rockchip,pins = <4 RK_PD3 RK_FUNC_GPIO &pcfg_input_pull_up>;
> On page 11 and 17 of PPP schematic V1.0-20211127 I see LIGHT_INT_L as
> identifier so it's best to use that identifier here, thus
> ``light_int_l: light-int-l {``
> and update the pinctrl-0 reference accordingly.
Thanks! Since this is a simple change, I will wait for more comments in
this patch series (would like comments on the mount matrices for the
accelerometer and the magnetometer). I will put this change in v5 if I
send one.
Thanks,
Rudraksha
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 0/4] Upstreaming Pinephone Pro Patches
2025-09-29 7:35 [PATCH v4 0/4] Upstreaming Pinephone Pro Patches Rudraksha Gupta via B4 Relay
` (4 preceding siblings ...)
2025-09-29 8:32 ` [PATCH v4 0/4] Upstreaming Pinephone Pro Patches Dragan Simic
@ 2025-10-22 11:09 ` Pavel Machek
5 siblings, 0 replies; 14+ messages in thread
From: Pavel Machek @ 2025-10-22 11:09 UTC (permalink / raw)
To: guptarud
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Ondrej Jirman, Martijn Braam, Kamil Trzciński,
Leonardo G. Trombetta
[-- Attachment #1: Type: text/plain, Size: 399 bytes --]
Hi!
> Throughout the years, many have contributed to the Pinephone Pro (ppp)
> development. Unfortunately, these patches are scattered around various
> repositories in different states.
Thanks for doing this.
You may want to cc phone-devel mailing list.
BR,
Pavel
--
I don't work for Nazis and criminals, and neither should you.
Boycott Putin, Trump, Netanyahu and Musk!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 2/4] arm64: dts: rk3399-pinephone-pro: Add accelerometer sensor support
2025-09-29 7:35 ` [PATCH v4 2/4] arm64: dts: rk3399-pinephone-pro: Add accelerometer " Rudraksha Gupta via B4 Relay
@ 2025-10-22 11:11 ` Pavel Machek
0 siblings, 0 replies; 14+ messages in thread
From: Pavel Machek @ 2025-10-22 11:11 UTC (permalink / raw)
To: guptarud
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Ondrej Jirman, Martijn Braam, Kamil Trzciński
[-- Attachment #1: Type: text/plain, Size: 563 bytes --]
Hi!
> // Put the phone face down so the screen is touching the table
> z: 16000
>
> Co-developed-by: Martijn Braam <martijn@brixit.nl>
> Signed-off-by: Martijn Braam <martijn@brixit.nl>
> Co-developed-by: Kamil Trzciński <ayufan@ayufan.eu>
> Signed-off-by: Kamil Trzciński <ayufan@ayufan.eu>
> Signed-off-by: Ondrej Jirman <megi@xff.cz>
> Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
--
I don't work for Nazis and criminals, and neither should you.
Boycott Putin, Trump, Netanyahu and Musk!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 3/4] arm64: dts: rk3399-pinephone-pro: Add magnetometer sensor support
2025-09-29 7:35 ` [PATCH v4 3/4] arm64: dts: rk3399-pinephone-pro: Add magnetometer " Rudraksha Gupta via B4 Relay
@ 2025-10-22 11:12 ` Pavel Machek
0 siblings, 0 replies; 14+ messages in thread
From: Pavel Machek @ 2025-10-22 11:12 UTC (permalink / raw)
To: guptarud
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Ondrej Jirman, Leonardo G. Trombetta
[-- Attachment #1: Type: text/plain, Size: 747 bytes --]
Hi!
> DEVICE="/sys/bus/iio/devices/iio:device2"
>
> X=$(cat $DEVICE/in_magn_x_raw)
> Y=$(cat $DEVICE/in_magn_y_raw)
> Z=$(cat $DEVICE/in_magn_z_raw)
>
> X_MIN=$X; X_MAX=$X
> Y_MIN=$Y; Y_MAX=$Y
> Z_MIN=$Z; Z_MAX=$Z
>
> START_TIME=$(date +%s)
I wonder if we should create some simple gui tool for testing this and
accelerometer?
Anyway,
> Co-developed-by: Leonardo G. Trombetta <lgtrombetta@gmx.com>
> Signed-off-by: Leonardo G. Trombetta <lgtrombetta@gmx.com>
> Signed-off-by: Ondrej Jirman <megi@xff.cz>
> Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
--
I don't work for Nazis and criminals, and neither should you.
Boycott Putin, Trump, Netanyahu and Musk!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 4/4] arm64: dts: rk3399-pinephone-pro: Fix voltage threshold for volume keys
2025-09-29 7:35 ` [PATCH v4 4/4] arm64: dts: rk3399-pinephone-pro: Fix voltage threshold for volume keys Rudraksha Gupta via B4 Relay
@ 2025-10-22 11:13 ` Pavel Machek
0 siblings, 0 replies; 14+ messages in thread
From: Pavel Machek @ 2025-10-22 11:13 UTC (permalink / raw)
To: guptarud
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Ondrej Jirman
[-- Attachment #1: Type: text/plain, Size: 956 bytes --]
Hi!
> From: Ondrej Jirman <megi@xff.cz>
>
> 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 <megi@xff.cz>
> Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
BR,
Pavel
--
I don't work for Nazis and criminals, and neither should you.
Boycott Putin, Trump, Netanyahu and Musk!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2025-10-22 11:13 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-29 7:35 [PATCH v4 0/4] Upstreaming Pinephone Pro Patches Rudraksha Gupta via B4 Relay
2025-09-29 7:35 ` [PATCH v4 1/4] arm64: dts: rk3399-pinephone-pro: Add light/proximity sensor support Rudraksha Gupta via B4 Relay
2025-09-29 9:57 ` Diederik de Haas
2025-10-07 5:59 ` Rudraksha Gupta
2025-09-29 7:35 ` [PATCH v4 2/4] arm64: dts: rk3399-pinephone-pro: Add accelerometer " Rudraksha Gupta via B4 Relay
2025-10-22 11:11 ` Pavel Machek
2025-09-29 7:35 ` [PATCH v4 3/4] arm64: dts: rk3399-pinephone-pro: Add magnetometer " Rudraksha Gupta via B4 Relay
2025-10-22 11:12 ` Pavel Machek
2025-09-29 7:35 ` [PATCH v4 4/4] arm64: dts: rk3399-pinephone-pro: Fix voltage threshold for volume keys Rudraksha Gupta via B4 Relay
2025-10-22 11:13 ` Pavel Machek
2025-09-29 8:32 ` [PATCH v4 0/4] Upstreaming Pinephone Pro Patches Dragan Simic
2025-09-29 15:39 ` Heiko Stuebner
2025-10-07 5:56 ` Rudraksha Gupta
2025-10-22 11:09 ` Pavel Machek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).