Skip to contentSkip to conversation

Miscellaneous fixes for Odroid Go Advance

PATCH Applied Chris Morgan 2 participants 6 messages Dec 1, 2022 – Jan 10, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Miscellaneous fixes for Odroid Go Advance

From: Chris Morgan <[email protected]>

This series is for a bunch of trivial changes to the Odroid Go Advance to clean up some errors in the dmesg log and make it easier to support with alsa ucm.

Chris Morgan (4):
arm64: dts: rockchip: Change audio card name for Odroid Go
arm64: dts: rockchip: don't set cpll rate for Odroid Go
arm64: dts: rockchip: update px30 thermal zones for GPU
arm64: dts: rockchip: Update leds for Odroid Go Advance

 arch/arm64/boot/dts/rockchip/px30.dtsi        | 33 ++++++++++++---
 .../boot/dts/rockchip/rk3326-odroid-go.dtsi   | 41 +++++++++++++------
 2 files changed, 56 insertions(+), 18 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/4 arm64: dts: rockchip: Change audio card name for Odroid Go

From: Chris Morgan <[email protected]>

Change the audio card name for the Odroid Go Advance series to rk817_int. This matches the audio card name of the Anbernic RG353V. This is done to provide a consistent card name so that a single ALSA UCM file can be used for all (identical) implementations of this codec and configuration combo. The rk817_int configuration is for when the internal speaker amplifier of the rk817 is used. The other Anbernic devices have the name as rk817_ext for when an external speaker amplifier is used.

---
 arch/arm64/boot/dts/rockchip/rk3326-odroid-go.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3326-odroid-go.dtsi +1 -1
index fbc6bfbaa5c1..60063f4bb366 100644
@@ -127,7 +127,7 @@ blue_led: led-0 {
 
 	rk817-sound {
 		compatible = "simple-audio-card";
-		simple-audio-card,name = "Analog";
+		simple-audio-card,name = "rk817_int";
 		simple-audio-card,format = "i2s";
 		simple-audio-card,hp-det-gpio = <&gpio2 RK_PC6 GPIO_ACTIVE_HIGH>;
 		simple-audio-card,mclk-fs = <256>;
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/4 arm64: dts: rockchip: don't set cpll rate for Odroid Go

In reply to Chris Morgan

From: Chris Morgan <[email protected]>

The Odroid Go Advance devicetree tries to set the rate for the cpll clock to 17MHz, which is not a supported rate. This fails, and triggers the error of "clk: couldn't set cpll clk rate to 17000000 (-22), current rate: 17000000" in the dmesg log. Remove the incorrect rate.

---
 arch/arm64/boot/dts/rockchip/rk3326-odroid-go.dtsi | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/rockchip/rk3326-odroid-go.dtsi +2 -4
index 60063f4bb366..802be64626d6 100644
@@ -192,14 +192,12 @@ &cru {
 	assigned-clocks = <&cru PLL_NPLL>,
 		<&cru ACLK_BUS_PRE>, <&cru ACLK_PERI_PRE>,
 		<&cru HCLK_BUS_PRE>, <&cru HCLK_PERI_PRE>,
-		<&cru PCLK_BUS_PRE>, <&cru SCLK_GPU>,
-		<&cru PLL_CPLL>;
+		<&cru PCLK_BUS_PRE>, <&cru SCLK_GPU>;
 
 	assigned-clock-rates = <1188000000>,
 		<200000000>, <200000000>,
 		<150000000>, <150000000>,
-		<100000000>, <200000000>,
-		<17000000>;
+		<100000000>, <200000000>;
 };
 
 &display_subsystem {
Signature · 1 line
2.25.1
#3 lore raw

PATCH 3/4 arm64: dts: rockchip: update px30 thermal zones for GPU

In reply to Chris Morgan

From: Chris Morgan <[email protected]>

Without the trips, the following errors are received in the dmesg log and the rockchip-thermal driver fails to load the gpu sensor:

"thermal_sys: Failed to find 'trips' node" "rockchip-thermal ff280000.tsadc: failed to register sensor 1: -22"

Trip values are assumed, unfortunately, as the same values as the CPU. The datasheet and TRM didn't appear to have any information regarding thermals for the GPU.

Stress tested successfully on my Odroid Go Advance.

---
 arch/arm64/boot/dts/rockchip/px30.dtsi | 33 +++++++++++++++++++++-----
 1 file changed, 27 insertions(+), 6 deletions(-)
arch/arm64/boot/dts/rockchip/px30.dtsi +27 -6
index bfa3580429d1..4f6959eb564d 100644
@@ -210,12 +210,6 @@ map0 {
 					cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
 					contribution = <4096>;
 				};
-
-				map1 {
-					trip = <&target>;
-					cooling-device = <&gpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
-					contribution = <4096>;
-				};
 			};
 		};
 
@@ -223,6 +217,33 @@ gpu_thermal: gpu-thermal {
 			polling-delay-passive = <100>; /* milliseconds */
 			polling-delay = <1000>; /* milliseconds */
 			thermal-sensors = <&tsadc 1>;
+
+			trips {
+				gpu_threshold: gpu-threshold {
+					temperature = <70000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				gpu_target: gpu-target {
+					temperature = <85000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				gpu_crit: gpu-crit {
+					temperature = <115000>;
+					hysteresis = <2000>;
+					type = "critical";
+				};
+			};
+
+			cooling-maps {
+				map0 {
+					trip = <&gpu_target>;
+					cooling-device = <&gpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+				};
+			};
 		};
 	};
 
Signature · 1 line
2.25.1
#4 lore raw

PATCH 4/4 arm64: dts: rockchip: Update leds for Odroid Go Advance

In reply to Chris Morgan

From: Chris Morgan <[email protected]>

Update the blue LED to be controlled via pwm to enable control of LED brightness. Add red LED as a GPIO controlled LED. The documentation stated "label" was depreciated so function and color was used instead. The LED names (led-2 and led-3) are given because that is what they are numbered on the board itself; LED 1 is wired directly into an always on regulator and is not controllable. LED 2 is labelled "alive" on the board and documentation recommends we set the function as status over other miscellaneous functions. LED 3 is labelled "chg" on the board.

---
 .../boot/dts/rockchip/rk3326-odroid-go.dtsi   | 33 +++++++++++++++----
 1 file changed, 26 insertions(+), 7 deletions(-)
arch/arm64/boot/dts/rockchip/rk3326-odroid-go.dtsi +26 -7
index 802be64626d6..8ea2af72a7bc 100644
@@ -8,6 +8,7 @@
 /dts-v1/;
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/pinctrl/rockchip.h>
 #include "rk3326.dtsi"
 
@@ -113,15 +114,29 @@ button-sw16 {
 		};
 	};
 
-	leds: gpio-leds {
+/* led-1 is wired directly to output of always-on regulator */
+
+	gpio_led: gpio-leds {
 		compatible = "gpio-leds";
 		pinctrl-names = "default";
-		pinctrl-0 = <&blue_led_pin>;
+		pinctrl-0 = <&red_led_pin>;
+
+		red_led: led-3 {
+			color = <LED_COLOR_ID_RED>;
+			gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
+			function = LED_FUNCTION_CHARGING;
+		};
+	};
 
-		blue_led: led-0 {
-			label = "blue:heartbeat";
-			gpios = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>;
+	pwm_led: led-controller {
+		compatible = "pwm-leds";
+
+		blue_led: led-2 {
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_STATUS;
 			linux,default-trigger = "heartbeat";
+			max-brightness = <255>;
+			pwms = <&pwm3 0 25000 0>;
 		};
 	};
 
@@ -465,6 +480,10 @@ &pwm1 {
 	status = "okay";
 };
 
+&pwm3 {
+	status = "okay";
+};
+
 &saradc {
 	vref-supply = <&vcc_1v8>;
 	status = "okay";
@@ -569,8 +588,8 @@ hp_det: hp-det {
 	};
 
 	leds {
-		blue_led_pin: blue-led-pin {
-			rockchip,pins = <0 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
+		red_led_pin: red-led-pin {
+			rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
 		};
 	};
 
Signature · 1 line
2.25.1
maintainer Applied
#5 lore raw
In reply to Chris Morgan
Quoted 6 lines · Chris Morgan

From: Chris Morgan <[email protected]>

This series is for a bunch of trivial changes to the Odroid Go Advance to clean up some errors in the dmesg log and make it easier to support with alsa ucm.

Quoted 7 lines

Chris Morgan (4):
arm64: dts: rockchip: Change audio card name for Odroid Go
arm64: dts: rockchip: don't set cpll rate for Odroid Go
arm64: dts: rockchip: update px30 thermal zones for GPU
arm64: dts: rockchip: Update leds for Odroid Go Advance

[...]

Applied, thanks!

[1/4] arm64: dts: rockchip: Change audio card name for Odroid Go

      commit: 658a87efb47a85cf8205ed9280d611e9870d3e43
[2/4] arm64: dts: rockchip: don't set cpll rate for Odroid Go
      commit: 9b1eb739307d9769ff3eb04fa5938c03b16af09e
[3/4] arm64: dts: rockchip: update px30 thermal zones for GPU
      commit: 8ad9b52eea99b80e84e3a077e962ab5cf8d736a2
[4/4] arm64: dts: rockchip: Update leds for Odroid Go Advance
      commit: 882f6abdd411f941db822918ef76f4b03f2052fd

Best regards,

Signature · 1 line
Heiko Stuebner <[email protected]>