Commit | Line | Data |
---|---|---|
0468b2d6 MD |
1 | /* |
2 | * r8a7790 clock framework support | |
3 | * | |
4 | * Copyright (C) 2013 Renesas Solutions Corp. | |
5 | * Copyright (C) 2013 Magnus Damm | |
6 | * | |
7 | * This program is free software; you can redistribute it and/or modify | |
8 | * it under the terms of the GNU General Public License as published by | |
9 | * the Free Software Foundation; version 2 of the License. | |
10 | * | |
11 | * This program is distributed in the hope that it will be useful, | |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | * GNU General Public License for more details. | |
15 | * | |
16 | * You should have received a copy of the GNU General Public License | |
17 | * along with this program; if not, write to the Free Software | |
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
19 | */ | |
20 | #include <linux/init.h> | |
21 | #include <linux/io.h> | |
22 | #include <linux/kernel.h> | |
23 | #include <linux/sh_clk.h> | |
24 | #include <linux/clkdev.h> | |
25 | #include <mach/common.h> | |
26 | ||
27 | #define CPG_BASE 0xe6150000 | |
28 | #define CPG_LEN 0x1000 | |
29 | ||
30 | static struct clk_mapping cpg_mapping = { | |
31 | .phys = CPG_BASE, | |
32 | .len = CPG_LEN, | |
33 | }; | |
34 | ||
35 | static struct clk *main_clks[] = { | |
36 | }; | |
37 | ||
38 | enum { MSTP_NR }; | |
39 | static struct clk mstp_clks[MSTP_NR] = { | |
40 | }; | |
41 | ||
42 | static struct clk_lookup lookups[] = { | |
43 | }; | |
44 | ||
45 | void __init r8a7790_clock_init(void) | |
46 | { | |
47 | int k, ret = 0; | |
48 | ||
49 | for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++) | |
50 | ret = clk_register(main_clks[k]); | |
51 | ||
52 | if (!ret) | |
53 | ret = sh_clk_mstp_register(mstp_clks, MSTP_NR); | |
54 | ||
55 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | |
56 | ||
57 | if (!ret) | |
58 | shmobile_clk_init(); | |
59 | else | |
60 | panic("failed to setup r8a7790 clocks\n"); | |
61 | } |