linux-rockchip.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Miscellaneous fixes for Odroid Go Advance
@ 2022-12-01 20:36 Chris Morgan
  2022-12-01 20:36 ` [PATCH 1/4] arm64: dts: rockchip: Change audio card name for Odroid Go Chris Morgan
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Chris Morgan @ 2022-12-01 20:36 UTC (permalink / raw)
  To: linux-rockchip
  Cc: devicetree, maccraft123mc, heiko, krzysztof.kozlowski+dt,
	robh+dt, Chris Morgan

From: Chris Morgan <macromorgan@hotmail.com>

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(-)

-- 
2.25.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/4] arm64: dts: rockchip: Change audio card name for Odroid Go
  2022-12-01 20:36 [PATCH 0/4] Miscellaneous fixes for Odroid Go Advance Chris Morgan
@ 2022-12-01 20:36 ` Chris Morgan
  2022-12-01 20:36 ` [PATCH 2/4] arm64: dts: rockchip: don't set cpll rate " Chris Morgan
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Chris Morgan @ 2022-12-01 20:36 UTC (permalink / raw)
  To: linux-rockchip
  Cc: devicetree, maccraft123mc, heiko, krzysztof.kozlowski+dt,
	robh+dt, Chris Morgan

From: Chris Morgan <macromorgan@hotmail.com>

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.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
---
 arch/arm64/boot/dts/rockchip/rk3326-odroid-go.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3326-odroid-go.dtsi b/arch/arm64/boot/dts/rockchip/rk3326-odroid-go.dtsi
index fbc6bfbaa5c1..60063f4bb366 100644
--- a/arch/arm64/boot/dts/rockchip/rk3326-odroid-go.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3326-odroid-go.dtsi
@@ -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>;
-- 
2.25.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/4] arm64: dts: rockchip: don't set cpll rate for Odroid Go
  2022-12-01 20:36 [PATCH 0/4] Miscellaneous fixes for Odroid Go Advance Chris Morgan
  2022-12-01 20:36 ` [PATCH 1/4] arm64: dts: rockchip: Change audio card name for Odroid Go Chris Morgan
@ 2022-12-01 20:36 ` Chris Morgan
  2022-12-01 20:36 ` [PATCH 3/4] arm64: dts: rockchip: update px30 thermal zones for GPU Chris Morgan
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Chris Morgan @ 2022-12-01 20:36 UTC (permalink / raw)
  To: linux-rockchip
  Cc: devicetree, maccraft123mc, heiko, krzysztof.kozlowski+dt,
	robh+dt, Chris Morgan

From: Chris Morgan <macromorgan@hotmail.com>

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.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
---
 arch/arm64/boot/dts/rockchip/rk3326-odroid-go.dtsi | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3326-odroid-go.dtsi b/arch/arm64/boot/dts/rockchip/rk3326-odroid-go.dtsi
index 60063f4bb366..802be64626d6 100644
--- a/arch/arm64/boot/dts/rockchip/rk3326-odroid-go.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3326-odroid-go.dtsi
@@ -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 {
-- 
2.25.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/4] arm64: dts: rockchip: update px30 thermal zones for GPU
  2022-12-01 20:36 [PATCH 0/4] Miscellaneous fixes for Odroid Go Advance Chris Morgan
  2022-12-01 20:36 ` [PATCH 1/4] arm64: dts: rockchip: Change audio card name for Odroid Go Chris Morgan
  2022-12-01 20:36 ` [PATCH 2/4] arm64: dts: rockchip: don't set cpll rate " Chris Morgan
@ 2022-12-01 20:36 ` Chris Morgan
  2022-12-01 20:36 ` [PATCH 4/4] arm64: dts: rockchip: Update leds for Odroid Go Advance Chris Morgan
  2023-01-10 14:04 ` [PATCH 0/4] Miscellaneous fixes " Heiko Stuebner
  4 siblings, 0 replies; 6+ messages in thread
From: Chris Morgan @ 2022-12-01 20:36 UTC (permalink / raw)
  To: linux-rockchip
  Cc: devicetree, maccraft123mc, heiko, krzysztof.kozlowski+dt,
	robh+dt, Chris Morgan

From: Chris Morgan <macromorgan@hotmail.com>

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.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
---
 arch/arm64/boot/dts/rockchip/px30.dtsi | 33 +++++++++++++++++++++-----
 1 file changed, 27 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/px30.dtsi b/arch/arm64/boot/dts/rockchip/px30.dtsi
index bfa3580429d1..4f6959eb564d 100644
--- a/arch/arm64/boot/dts/rockchip/px30.dtsi
+++ b/arch/arm64/boot/dts/rockchip/px30.dtsi
@@ -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>;
+				};
+			};
 		};
 	};
 
-- 
2.25.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/4] arm64: dts: rockchip: Update leds for Odroid Go Advance
  2022-12-01 20:36 [PATCH 0/4] Miscellaneous fixes for Odroid Go Advance Chris Morgan
                   ` (2 preceding siblings ...)
  2022-12-01 20:36 ` [PATCH 3/4] arm64: dts: rockchip: update px30 thermal zones for GPU Chris Morgan
@ 2022-12-01 20:36 ` Chris Morgan
  2023-01-10 14:04 ` [PATCH 0/4] Miscellaneous fixes " Heiko Stuebner
  4 siblings, 0 replies; 6+ messages in thread
From: Chris Morgan @ 2022-12-01 20:36 UTC (permalink / raw)
  To: linux-rockchip
  Cc: devicetree, maccraft123mc, heiko, krzysztof.kozlowski+dt,
	robh+dt, Chris Morgan

From: Chris Morgan <macromorgan@hotmail.com>

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.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
---
 .../boot/dts/rockchip/rk3326-odroid-go.dtsi   | 33 +++++++++++++++----
 1 file changed, 26 insertions(+), 7 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3326-odroid-go.dtsi b/arch/arm64/boot/dts/rockchip/rk3326-odroid-go.dtsi
index 802be64626d6..8ea2af72a7bc 100644
--- a/arch/arm64/boot/dts/rockchip/rk3326-odroid-go.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3326-odroid-go.dtsi
@@ -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>;
 		};
 	};
 
-- 
2.25.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/4] Miscellaneous fixes for Odroid Go Advance
  2022-12-01 20:36 [PATCH 0/4] Miscellaneous fixes for Odroid Go Advance Chris Morgan
                   ` (3 preceding siblings ...)
  2022-12-01 20:36 ` [PATCH 4/4] arm64: dts: rockchip: Update leds for Odroid Go Advance Chris Morgan
@ 2023-01-10 14:04 ` Heiko Stuebner
  4 siblings, 0 replies; 6+ messages in thread
From: Heiko Stuebner @ 2023-01-10 14:04 UTC (permalink / raw)
  To: Chris Morgan, linux-rockchip
  Cc: Heiko Stuebner, devicetree, maccraft123mc, Chris Morgan,
	krzysztof.kozlowski+dt, robh+dt

On Thu, 1 Dec 2022 14:36:51 -0600, Chris Morgan wrote:
> From: Chris Morgan <macromorgan@hotmail.com>
> 
> 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
> 
> [...]

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,
-- 
Heiko Stuebner <heiko@sntech.de>

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-01-10 14:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-01 20:36 [PATCH 0/4] Miscellaneous fixes for Odroid Go Advance Chris Morgan
2022-12-01 20:36 ` [PATCH 1/4] arm64: dts: rockchip: Change audio card name for Odroid Go Chris Morgan
2022-12-01 20:36 ` [PATCH 2/4] arm64: dts: rockchip: don't set cpll rate " Chris Morgan
2022-12-01 20:36 ` [PATCH 3/4] arm64: dts: rockchip: update px30 thermal zones for GPU Chris Morgan
2022-12-01 20:36 ` [PATCH 4/4] arm64: dts: rockchip: Update leds for Odroid Go Advance Chris Morgan
2023-01-10 14:04 ` [PATCH 0/4] Miscellaneous fixes " Heiko Stuebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).