]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
arm64: dts: rockchip: Add light/proximity sensor to Pinephone Pro
authorOndrej Jirman <megi@xff.cz>
Fri, 26 Dec 2025 03:43:20 +0000 (19:43 -0800)
committerHeiko Stuebner <heiko@sntech.de>
Tue, 6 Jan 2026 18:11:40 +0000 (19:11 +0100)
Pinephone Pro uses STK3311 according to the schematics.

Tests:
~ $ monitor-sensor --light
    // 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)

~ $ monitor-sensor --proximity
    // When it goes away from an object
    Proximity value changed: 0
    // When it comes near an object
    Proximity value changed: 1

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>
Link: https://patch.msgid.link/20251225-ppp_light_accel_mag_vol-down-v6-2-8c79a4e87001@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts

index a100fb96c8a5c3f6a6d12b795790f4f5d4e5a74e..141ab98502905fe5e3a7ac84ec9d02e79ea4796c 100644 (file)
                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 = <&light_int_l>;
+               proximity-near-level = <300>;
+       };
 };
 
 &i2c4 {
                };
        };
 
+       stk3311 {
+               light_int_l: light-int-l {
+                       rockchip,pins = <4 RK_PD3 RK_FUNC_GPIO &pcfg_input_pull_up>;
+               };
+       };
+
        wifi {
                wifi_host_wake_l: wifi-host-wake-l {
                        rockchip,pins = <4 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;