Skip to content

Commit f26e433

Browse files
dbogdanLey Foon Tan
authored andcommitted
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 <[email protected]> Signed-off-by: Dragos Bogdan <[email protected]> Signed-off-by: Ley Foon Tan <[email protected]>
1 parent 7111951 commit f26e433

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

arch/nios2/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ config NIOS2
66
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
77
select ARCH_HAS_UNCACHED_SEGMENT
88
select ARCH_NO_SWAP
9+
select COMMON_CLK
910
select TIMER_OF
1011
select GENERIC_ATOMIC64
1112
select GENERIC_CLOCKEVENTS

arch/nios2/platform/platform.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#include <linux/slab.h>
1616
#include <linux/sys_soc.h>
1717
#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+
};
1824

1925
static int __init nios2_soc_device_init(void)
2026
{
@@ -38,6 +44,8 @@ static int __init nios2_soc_device_init(void)
3844
}
3945
}
4046

47+
of_clk_init(clk_match);
48+
4149
return 0;
4250
}
4351

0 commit comments

Comments
 (0)