Source-Changes-HG archive

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

[src/trunk]: src/sys Initialize clk domain name and call clk_att...



details:   https://anonhg.NetBSD.org/src/rev/84ad9e51541e
branches:  trunk
changeset: 318538:84ad9e51541e
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Apr 28 15:21:05 2018 +0000
description:
Initialize clk domain name and call clk_attach to register sysctl nodes

diffstat:

 sys/arch/arm/sunxi/sunxi_ccu.c |  9 ++++++---
 sys/dev/fdt/fixedclock.c       |  6 ++++--
 sys/dev/fdt/fixedfactorclock.c |  6 ++++--
 3 files changed, 14 insertions(+), 7 deletions(-)

diffs (101 lines):

diff -r 485167b3f282 -r 84ad9e51541e sys/arch/arm/sunxi/sunxi_ccu.c
--- a/sys/arch/arm/sunxi/sunxi_ccu.c    Sat Apr 28 15:20:33 2018 +0000
+++ b/sys/arch/arm/sunxi/sunxi_ccu.c    Sat Apr 28 15:21:05 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_ccu.c,v 1.9 2018/04/01 21:19:17 bouyer Exp $ */
+/* $NetBSD: sunxi_ccu.c,v 1.10 2018/04/28 15:21:24 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -31,7 +31,7 @@
 #include "opt_fdt_arm.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_ccu.c,v 1.9 2018/04/01 21:19:17 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_ccu.c,v 1.10 2018/04/28 15:21:24 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -317,10 +317,13 @@
                return ENXIO;
        }
 
+       sc->sc_clkdom.name = device_xname(sc->sc_dev);
        sc->sc_clkdom.funcs = &sunxi_ccu_clock_funcs;
        sc->sc_clkdom.priv = sc;
-       for (i = 0; i < sc->sc_nclks; i++)
+       for (i = 0; i < sc->sc_nclks; i++) {
                sc->sc_clks[i].base.domain = &sc->sc_clkdom;
+               clk_attach(&sc->sc_clks[i].base);
+       }
 
        fdtbus_register_clock_controller(sc->sc_dev, sc->sc_phandle,
            &sunxi_ccu_fdtclock_funcs);
diff -r 485167b3f282 -r 84ad9e51541e sys/dev/fdt/fixedclock.c
--- a/sys/dev/fdt/fixedclock.c  Sat Apr 28 15:20:33 2018 +0000
+++ b/sys/dev/fdt/fixedclock.c  Sat Apr 28 15:21:05 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fixedclock.c,v 1.2 2017/04/21 19:18:05 jmcneill Exp $ */
+/* $NetBSD: fixedclock.c,v 1.3 2018/04/28 15:21:05 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fixedclock.c,v 1.2 2017/04/21 19:18:05 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fixedclock.c,v 1.3 2018/04/28 15:21:05 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -92,6 +92,7 @@
 
        sc->sc_dev = self;
        sc->sc_phandle = phandle;
+       sc->sc_clkdom.name = device_xname(self);
        sc->sc_clkdom.funcs = &fixedclock_clk_funcs;
        sc->sc_clkdom.priv = sc;
        if (of_getprop_uint32(phandle, "clock-frequency",
@@ -101,6 +102,7 @@
        }
        sc->sc_clk.base.domain = &sc->sc_clkdom;
        sc->sc_clk.base.name = kmem_asprintf("%s", faa->faa_name);
+       clk_attach(&sc->sc_clk.base);
 
        aprint_naive("\n");
        aprint_normal(": %u Hz fixed clock\n", sc->sc_clk.rate);
diff -r 485167b3f282 -r 84ad9e51541e sys/dev/fdt/fixedfactorclock.c
--- a/sys/dev/fdt/fixedfactorclock.c    Sat Apr 28 15:20:33 2018 +0000
+++ b/sys/dev/fdt/fixedfactorclock.c    Sat Apr 28 15:21:05 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fixedfactorclock.c,v 1.1 2017/07/08 12:37:08 jmcneill Exp $ */
+/* $NetBSD: fixedfactorclock.c,v 1.2 2018/04/28 15:21:05 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fixedfactorclock.c,v 1.1 2017/07/08 12:37:08 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fixedfactorclock.c,v 1.2 2018/04/28 15:21:05 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -95,6 +95,7 @@
 
        sc->sc_dev = self;
        sc->sc_phandle = phandle;
+       sc->sc_clkdom.name = device_xname(self);
        sc->sc_clkdom.funcs = &fixedfactorclock_clk_funcs;
        sc->sc_clkdom.priv = sc;
 
@@ -112,6 +113,7 @@
 
        sc->sc_clk.base.domain = &sc->sc_clkdom;
        sc->sc_clk.base.name = name;
+       clk_attach(&sc->sc_clk.base);
 
        aprint_naive("\n");
        aprint_normal(": x%u /%u fixed-factor clock\n",



Home | Main Index | Thread Index | Old Index