Commit | Line | Data |
---|---|---|
e47bb515 | 1 | /* |
3572b33e | 2 | * SH-Mobile Clock Framework |
e47bb515 MD |
3 | * |
4 | * Copyright (C) 2010 Magnus Damm | |
5 | * | |
3572b33e MD |
6 | * Used together with arch/arm/common/clkdev.c and drivers/sh/clk.c. |
7 | * | |
e47bb515 MD |
8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by | |
10 | * the Free Software Foundation; version 2 of the License. | |
11 | * | |
12 | * This program is distributed in the hope that it will be useful, | |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | * GNU General Public License for more details. | |
16 | * | |
e47bb515 | 17 | */ |
b6c461d2 LP |
18 | |
19 | #include <linux/export.h> | |
e47bb515 MD |
20 | #include <linux/kernel.h> |
21 | #include <linux/init.h> | |
22 | #include <linux/sh_clk.h> | |
b6c461d2 | 23 | |
ad6ffa0b | 24 | #include "clock.h" |
fd44aa5e | 25 | #include "common.h" |
f5942c76 KM |
26 | |
27 | unsigned long shmobile_fixed_ratio_clk_recalc(struct clk *clk) | |
28 | { | |
29 | struct clk_ratio *p = clk->priv; | |
30 | ||
31 | return clk->parent->rate / p->div * p->mul; | |
32 | }; | |
33 | ||
34 | struct sh_clk_ops shmobile_fixed_ratio_clk_ops = { | |
35 | .recalc = shmobile_fixed_ratio_clk_recalc, | |
36 | }; | |
e47bb515 | 37 | |
6b6a4c06 | 38 | int __init shmobile_clk_init(void) |
e47bb515 MD |
39 | { |
40 | /* Kick the child clocks.. */ | |
41 | recalculate_root_clocks(); | |
42 | ||
43 | /* Enable the necessary init clocks */ | |
44 | clk_enable_init_clocks(); | |
45 | ||
46 | return 0; | |
47 | } |