Module Name:    src
Committed By:   macallan
Date:           Tue May  2 10:18:54 UTC 2023

Modified Files:
        src/sys/arch/arm/sunxi: sunxi_thermal.c

Log Message:
apparently the 'ahb' and 'ths' clocks were renamed to 'bus' and 'mod' in the
fdt at some point, so look for those as well
with this my pinebook's sensors work again


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/sunxi/sunxi_thermal.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/sunxi/sunxi_thermal.c
diff -u src/sys/arch/arm/sunxi/sunxi_thermal.c:1.14 src/sys/arch/arm/sunxi/sunxi_thermal.c:1.15
--- src/sys/arch/arm/sunxi/sunxi_thermal.c:1.14	Sun Nov  7 17:11:58 2021
+++ src/sys/arch/arm/sunxi/sunxi_thermal.c	Tue May  2 10:18:54 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_thermal.c,v 1.14 2021/11/07 17:11:58 jmcneill Exp $ */
+/* $NetBSD: sunxi_thermal.c,v 1.15 2023/05/02 10:18:54 macallan Exp $ */
 
 /*-
  * Copyright (c) 2016-2017 Jared McNeill <jmcne...@invisible.ca>
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_thermal.c,v 1.14 2021/11/07 17:11:58 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_thermal.c,v 1.15 2023/05/02 10:18:54 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -521,6 +521,7 @@ sunxi_thermal_init_clocks(struct sunxi_t
 	int error;
 
 	clk = fdtbus_clock_get(sc->phandle, "ahb");
+	if (clk == 0) clk = fdtbus_clock_get(sc->phandle, "bus");
 	if (clk) {
 		error = clk_enable(clk);
 		if (error != 0)
@@ -528,6 +529,7 @@ sunxi_thermal_init_clocks(struct sunxi_t
 	}
 
 	clk = fdtbus_clock_get(sc->phandle, "ths");
+	if (clk == 0) clk = fdtbus_clock_get(sc->phandle, "mod");
 	if (clk) {
 		error = clk_set_rate(clk, sc->conf->clk_rate);
 		if (error != 0)

Reply via email to