blob: 34f056fc375691c22169b4ee26fb4f049e1396e6 [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 *
Magnus Damme47bb512010-05-12 14:21:24 +000017 */
Laurent Pinchartb6c461d2014-10-26 15:07:32 +020018
19#include <linux/export.h>
Magnus Damme47bb512010-05-12 14:21:24 +000020#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/sh_clk.h>
Laurent Pinchartb6c461d2014-10-26 15:07:32 +020023
Magnus Dammad6ffa02014-06-17 16:47:21 +090024#include "clock.h"
Magnus Dammfd44aa52014-06-17 16:47:37 +090025#include "common.h"
Kuninori Morimotof5942c72013-03-27 00:55:41 -070026
27unsigned 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
34struct sh_clk_ops shmobile_fixed_ratio_clk_ops = {
35 .recalc = shmobile_fixed_ratio_clk_recalc,
36};
Magnus Damme47bb512010-05-12 14:21:24 +000037
Magnus Damm6b6a4c02012-02-29 21:41:30 +090038int __init shmobile_clk_init(void)
Magnus Damme47bb512010-05-12 14:21:24 +000039{
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}
48
49int __clk_get(struct clk *clk)
50{
51 return 1;
52}
53EXPORT_SYMBOL(__clk_get);
54
55void __clk_put(struct clk *clk)
56{
57}
58EXPORT_SYMBOL(__clk_put);