Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arch: nios2: Enable the common clk subsystem on Nios2

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>

authored by

Dragos Bogdan and committed by
Ley Foon Tan
f26e4331 7111951b

+9
+1
arch/nios2/Kconfig
··· 6 6 select ARCH_HAS_SYNC_DMA_FOR_DEVICE 7 7 select ARCH_HAS_UNCACHED_SEGMENT 8 8 select ARCH_NO_SWAP 9 + select COMMON_CLK 9 10 select TIMER_OF 10 11 select GENERIC_ATOMIC64 11 12 select GENERIC_CLOCKEVENTS
+8
arch/nios2/platform/platform.c
··· 15 15 #include <linux/slab.h> 16 16 #include <linux/sys_soc.h> 17 17 #include <linux/io.h> 18 + #include <linux/clk-provider.h> 19 + 20 + static const struct of_device_id clk_match[] __initconst = { 21 + { .compatible = "fixed-clock", .data = of_fixed_clk_setup, }, 22 + {} 23 + }; 18 24 19 25 static int __init nios2_soc_device_init(void) 20 26 { ··· 43 37 kfree(soc_dev_attr); 44 38 } 45 39 } 40 + 41 + of_clk_init(clk_match); 46 42 47 43 return 0; 48 44 }