ARM: mvebu: define crypto SRAM ranges for all armada-38x boards
[linux/fpc-iii.git] / arch / arm / mach-shmobile / clock.c
blob68c2d06d0eaaa800ce61bc074320259cf6b6f9eb
1 /*
2 * SH-Mobile Clock Framework
4 * Copyright (C) 2010 Magnus Damm
6 * Used together with arch/arm/common/clkdev.c and drivers/sh/clk.c.
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.
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.
19 #include <linux/export.h>
20 #include <linux/kernel.h>
21 #include <linux/init.h>
22 #include <linux/sh_clk.h>
24 #include "clock.h"
25 #include "common.h"
27 unsigned long shmobile_fixed_ratio_clk_recalc(struct clk *clk)
29 struct clk_ratio *p = clk->priv;
31 return clk->parent->rate / p->div * p->mul;
34 struct sh_clk_ops shmobile_fixed_ratio_clk_ops = {
35 .recalc = shmobile_fixed_ratio_clk_recalc,
38 int __init shmobile_clk_init(void)
40 /* Kick the child clocks.. */
41 recalculate_root_clocks();
43 /* Enable the necessary init clocks */
44 clk_enable_init_clocks();
46 return 0;