]> git.baikalelectronics.ru Git - kernel.git/commitdiff
arch: nios2: Enable the common clk subsystem on Nios2
authorDragos Bogdan <dragos.bogdan@analog.com>
Fri, 10 Apr 2020 15:38:23 +0000 (23:38 +0800)
committerLey Foon Tan <ley.foon.tan@intel.com>
Fri, 10 Apr 2020 17:45:28 +0000 (01:45 +0800)
This patch adds support for common clock framework on Nios2. Clock
framework is commonly used in many drivers, and this patch makes it
available for the entire architecture, not just on a per-driver basis.

Signed-off-by: Beniamin Bia <beniamin.bia@analog.com>
Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com>
Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
arch/nios2/Kconfig
arch/nios2/platform/platform.c

index 44b5da37e8bdc1b4fb123a0344f254b0c6ccf65a..4b7c951e80e23e7836333eb62110025bc2d09d99 100644 (file)
@@ -6,6 +6,7 @@ config NIOS2
        select ARCH_HAS_SYNC_DMA_FOR_DEVICE
        select ARCH_HAS_UNCACHED_SEGMENT
        select ARCH_NO_SWAP
+       select COMMON_CLK
        select TIMER_OF
        select GENERIC_ATOMIC64
        select GENERIC_CLOCKEVENTS
index 2a35154ca1531f6c5e85aeb5c3aaefade71796a6..9737a87121fa7c5d6b41378ca55ba12f19bb44a4 100644 (file)
 #include <linux/slab.h>
 #include <linux/sys_soc.h>
 #include <linux/io.h>
+#include <linux/clk-provider.h>
+
+static const struct of_device_id clk_match[] __initconst = {
+       { .compatible = "fixed-clock", .data = of_fixed_clk_setup, },
+       {}
+};
 
 static int __init nios2_soc_device_init(void)
 {
@@ -38,6 +44,8 @@ static int __init nios2_soc_device_init(void)
                }
        }
 
+       of_clk_init(clk_match);
+
        return 0;
 }