Skip to content

Commit a3e4bb6

Browse files
Ondrej Jirmanmmind
authored andcommitted
arm64: dts: rockchip: Add light/proximity sensor to Pinephone Pro
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>
1 parent 2b8cd99 commit a3e4bb6

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,16 @@
520520
touchscreen-size-x = <720>;
521521
touchscreen-size-y = <1440>;
522522
};
523+
524+
light-sensor@48 {
525+
compatible = "sensortek,stk3311";
526+
reg = <0x48>;
527+
interrupt-parent = <&gpio4>;
528+
interrupts = <RK_PD3 IRQ_TYPE_EDGE_FALLING>;
529+
pinctrl-names = "default";
530+
pinctrl-0 = <&light_int_l>;
531+
proximity-near-level = <300>;
532+
};
523533
};
524534

525535
&i2c4 {
@@ -718,6 +728,12 @@
718728
};
719729
};
720730

731+
stk3311 {
732+
light_int_l: light-int-l {
733+
rockchip,pins = <4 RK_PD3 RK_FUNC_GPIO &pcfg_input_pull_up>;
734+
};
735+
};
736+
721737
wifi {
722738
wifi_host_wake_l: wifi-host-wake-l {
723739
rockchip,pins = <4 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;

0 commit comments

Comments
 (0)