gjdwebserver-overlay/sys-kernel/pinephone-sources/files/0062-arm64-dts-rk3399-pinephone-pro-Add-flash-and-fix-led.patch

106 lines
2.8 KiB
Diff
Raw Normal View History

2022-01-11 10:08:21 +01:00
From: Arnaud Ferraris <arnaud.ferraris@gmail.com>
Date: Wed, 1 Dec 2021 20:48:51 +0100
Subject: arm64: dts: rk3399-pinephone-pro: Add flash and fix leds
The PinePhone Pro has a similar device to the SGM3140 used in the OG
PinePhone. This commit adds the corresponding device-tree node so the
flash/torch can work on this device.
Moreover, existing LEDs use different names and functions than what
we're used to, change them all to the same names we use on the OG
PinePhone.
Signed-off-by: Arnaud Ferraris <arnaud.ferraris@gmail.com>
---
.../boot/dts/rockchip/rk3399-pinephone-pro.dts | 47 +++++++++++++---------
1 file changed, 28 insertions(+), 19 deletions(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
index 4afed92..e305955 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
@@ -127,30 +127,22 @@ leds {
pinctrl-names = "default";
pinctrl-0 = <&red_led_pin &green_led_pin &blue_led_pin>;
- led-standby {
+ led-red {
color = <LED_COLOR_ID_RED>;
- default-state = "off";
- function = LED_FUNCTION_STANDBY;
+ function = LED_FUNCTION_INDICATOR;
gpios = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>;
- label = "red:standby";
- panic-indicator;
- retain-state-suspended;
};
- led-pwr {
+ led-green {
color = <LED_COLOR_ID_GREEN>;
- default-state = "on";
- function = LED_FUNCTION_POWER;
+ function = LED_FUNCTION_INDICATOR;
gpios = <&gpio4 RK_PD5 GPIO_ACTIVE_HIGH>;
- label = "green:disk-activity";
};
- blue-charging {
+ led-blue {
color = <LED_COLOR_ID_BLUE>;
- default-state = "off";
- function = LED_FUNCTION_CHARGING;
- gpios = <&gpio0 RK_PD6 GPIO_ACTIVE_HIGH>;
- label = "blue:charging";
+ function = LED_FUNCTION_INDICATOR;
+ gpios = <&gpio4 RK_PD6 GPIO_ACTIVE_HIGH>;
};
};
@@ -399,6 +391,21 @@ typec_extcon_bridge: typec-extcon {
mode-switch;
svid = /bits/ 16 <0xff01>;
};
+
+ sgm3140: led-controller {
+ compatible = "sgmicro,sgm3140";
+ vin-supply = <&vcc3v3_sys>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&flash_pins>;
+ enable-gpios = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>;
+ flash-gpios = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>;
+
+ sgm3140_flash: led {
+ function = LED_FUNCTION_FLASH;
+ color = <LED_COLOR_ID_WHITE>;
+ flash-max-timeout-us = <250000>;
+ };
+ };
};
&cpu_l0 {
@@ -1111,6 +1118,12 @@ green_led_pin: green-led-pin {
blue_led_pin: blue-led-pin {
rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>;
};
+
+ flash_pins: flash-pins {
+ rockchip,pins =
+ <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>,
+ <4 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
};
modem {
@@ -1189,10 +1202,6 @@ &pwm0 {
status = "okay";
};
-&pwm1 {
- status = "okay";
-};
-
&pwm2 {
status = "okay";
};