[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250929-ppp_light_accel_mag_vol-down-v4-1-6598f22d3451@gmail.com>
Date: Mon, 29 Sep 2025 00:35:12 -0700
From: Rudraksha Gupta via B4 Relay <devnull+guptarud.gmail.com@...nel.org>
To: Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Heiko Stuebner <heiko@...ech.de>
Cc: devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org,
Rudraksha Gupta <guptarud@...il.com>, Ondrej Jirman <megi@....cz>,
Martijn Braam <martijn@...xit.nl>,
Kamil Trzciński <ayufan@...fan.eu>
Subject: [PATCH v4 1/4] arm64: dts: rk3399-pinephone-pro: Add
light/proximity sensor support
From: Ondrej Jirman <megi@....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@...xit.nl>
Signed-off-by: Martijn Braam <martijn@...xit.nl>
Co-developed-by: Kamil Trzciński <ayufan@...fan.eu>
Signed-off-by: Kamil Trzciński <ayufan@...fan.eu>
Signed-off-by: Ondrej Jirman <megi@....cz>
Signed-off-by: Rudraksha Gupta <guptarud@...il.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
Powered by blists - more mailing lists