Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-10]: src/sys/arch/arm/sunxi Pull up following revision(s) (reques...



details:   https://anonhg.NetBSD.org/src/rev/3057cb18b770
branches:  netbsd-10
changeset: 374573:3057cb18b770
user:      martin <martin%NetBSD.org@localhost>
date:      Thu May 04 18:56:36 2023 +0000

description:
Pull up following revision(s) (requested by jmcneill in ticket #156):

        sys/arch/arm/sunxi/sunxi_thermal.c: revision 1.15
        sys/arch/arm/sunxi/sunxi_thermal.c: revision 1.16

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

Cleanup previous: Try new bindings first, document old with DTCOMPAT, KNF

diffstat:

 sys/arch/arm/sunxi/sunxi_thermal.c |  16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diffs (43 lines):

diff -r 36037c02a859 -r 3057cb18b770 sys/arch/arm/sunxi/sunxi_thermal.c
--- a/sys/arch/arm/sunxi/sunxi_thermal.c        Tue May 02 21:31:56 2023 +0000
+++ b/sys/arch/arm/sunxi/sunxi_thermal.c        Thu May 04 18:56:36 2023 +0000
@@ -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.14.4.1 2023/05/04 18:56:36 martin Exp $ */
 
 /*-
  * Copyright (c) 2016-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -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.14.4.1 2023/05/04 18:56:36 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -520,14 +520,22 @@ sunxi_thermal_init_clocks(struct sunxi_t
        struct clk *clk;
        int error;
 
-       clk = fdtbus_clock_get(sc->phandle, "ahb");
+       clk = fdtbus_clock_get(sc->phandle, "bus");
+       if (clk == NULL) {
+               /* DTCOMPAT */
+               clk = fdtbus_clock_get(sc->phandle, "ahb");
+       }
        if (clk) {
                error = clk_enable(clk);
                if (error != 0)
                        return error;
        }
 
-       clk = fdtbus_clock_get(sc->phandle, "ths");
+       clk = fdtbus_clock_get(sc->phandle, "mod");
+       if (clk == NULL) {
+               /* DTCOMPAT */
+               clk = fdtbus_clock_get(sc->phandle, "ths");
+       }
        if (clk) {
                error = clk_set_rate(clk, sc->conf->clk_rate);
                if (error != 0)



Home | Main Index | Thread Index | Old Index