gjdwebserver-overlay/sys-kernel/pinephone-sources/files/0179-arm64-dts-allwinner-pinephone-improve-device-tree.patch
2021-12-03 10:03:17 +01:00

117 lines
3.6 KiB
Diff

From 465a75a727ae5eb4c94859bfac4742cb14e38b3e Mon Sep 17 00:00:00 2001
From: Arnaud Ferraris <arnaud.ferraris@collabora.com>
Date: Fri, 3 Apr 2020 17:13:55 +0200
Subject: [PATCH 179/183] arm64: dts: allwinner: pinephone: improve device tree
On PinePhone, the headset mic bias resistor isn't populated on the
schematics (R811), therefore we need to enable the codec's internal
resistor. Additionnally, the jack detection IRQ's are inverted due to the
connector wiring, so the necessary property is added to the codec node
to made the driver aware of this fact.
We also stop LEDs during suspend to improve battery life, lower
cpu_alert* temperatures so the phone doesn't get too hot and improve the
backlight brightness values so we have a wider usable range.
Finally, the RGB LED max_brightness is set to 1 as it isn't using a PWM
output.
---
.../dts/allwinner/sun50i-a64-pinephone-1.1.dts | 10 +++++-----
.../dts/allwinner/sun50i-a64-pinephone-1.2.dts | 13 ++++++-------
.../dts/allwinner/sun50i-a64-pinephone.dtsi | 18 +++++++++++++-----
3 files changed, 24 insertions(+), 17 deletions(-)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
index f084c4f21f12..573f1929da4f 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
@@ -29,11 +29,11 @@ &backlight {
* value here was chosen as a safe default.
*/
brightness-levels = <
- 774 793 814 842
- 882 935 1003 1088
- 1192 1316 1462 1633
- 1830 2054 2309 2596
- 2916 3271 3664 4096>;
+ 392 413 436 468
+ 512 571 647 742
+ 857 995 1159 1349
+ 1568 1819 2103 2423
+ 2779 3176 3614 4096>;
num-interpolated-steps = <50>;
default-brightness-level = <400>;
};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
index bbf64677c22b..6c3922543fec 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
@@ -34,14 +34,13 @@ &backlight {
* chosen as a safe default.
*/
brightness-levels = <
- 5000 5248 5506 5858 6345
- 6987 7805 8823 10062 11543
- 13287 15317 17654 20319 23336
- 26724 30505 34702 39335 44427
- 50000
- >;
+ 392 413 436 468
+ 512 571 647 742
+ 857 995 1159 1349
+ 1568 1819 2103 2423
+ 2779 3176 3614 4096>;
num-interpolated-steps = <50>;
- default-brightness-level = <500>;
+ default-brightness-level = <400>;
};
&lis3mdl {
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index c55709197804..441358592072 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -219,21 +219,21 @@
function = LED_FUNCTION_INDICATOR;
color = <LED_COLOR_ID_BLUE>;
gpios = <&pio 3 20 GPIO_ACTIVE_HIGH>; /* PD20 */
- retain-state-suspended;
+ max-brightness = <1>;
};
led-1 {
function = LED_FUNCTION_INDICATOR;
color = <LED_COLOR_ID_GREEN>;
gpios = <&pio 3 18 GPIO_ACTIVE_HIGH>; /* PD18 */
- retain-state-suspended;
+ max-brightness = <1>;
};
led-2 {
function = LED_FUNCTION_INDICATOR;
color = <LED_COLOR_ID_RED>;
gpios = <&pio 3 19 GPIO_ACTIVE_HIGH>; /* PD19 */
- retain-state-suspended;
+ max-brightness = <1>;
};
};
@@ -380,6 +380,14 @@
cpu-supply = <&reg_dcdc2>;
};
+&cpu_alert0 {
+ temperature = <60000>;
+};
+
+&cpu_alert1 {
+ temperature = <80000>;
+};
+
&csi {
pinctrl-0 = <&csi_pins>, <&csi_mclk_pin>;
status = "okay";
--
2.30.0