blob: ad7df629d995413d7e73338e9a984dbf5870c7e8 [file] [log] [blame]
Magnus Damme47bb512010-05-12 14:21:24 +00001/*
Magnus Damm3572b332010-08-16 10:40:49 +00002 * SH-Mobile Clock Framework
Magnus Damme47bb512010-05-12 14:21:24 +00003 *
4 * Copyright (C) 2010 Magnus Damm
5 *
Magnus Damm3572b332010-08-16 10:40:49 +00006 * Used together with arch/arm/common/clkdev.c and drivers/sh/clk.c.
7 *
Magnus Damme47bb512010-05-12 14:21:24 +00008 * 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 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 *
21 */
22#include <linux/kernel.h>
23#include <linux/init.h>
24#include <linux/sh_clk.h>
Paul Gortmakerdc280942011-07-31 16:17:29 -040025#include <linux/export.h>
Kuninori Morimotof5942c72013-03-27 00:55:41 -070026#include <mach/clock.h>
27#include <mach/common.h>
28
29unsigned long shmobile_fixed_ratio_clk_recalc(struct clk *clk)
30{
31 struct clk_ratio *p = clk->priv;
32
33 return clk->parent->rate / p->div * p->mul;
34};
35
36struct sh_clk_ops shmobile_fixed_ratio_clk_ops = {
37 .recalc = shmobile_fixed_ratio_clk_recalc,
38};
Magnus Damme47bb512010-05-12 14:21:24 +000039
Magnus Damm6b6a4c02012-02-29 21:41:30 +090040int __init shmobile_clk_init(void)
Magnus Damme47bb512010-05-12 14:21:24 +000041{
42 /* Kick the child clocks.. */
43 recalculate_root_clocks();
44
45 /* Enable the necessary init clocks */
46 clk_enable_init_clocks();
47
48 return 0;
49}
50
51int __clk_get(struct clk *clk)
52{
53 return 1;
54}
55EXPORT_SYMBOL(__clk_get);
56
57void __clk_put(struct clk *clk)
58{
59}
60EXPORT_SYMBOL(__clk_put);