Magnus Damm | e47bb51 | 2010-05-12 14:21:24 +0000 | [diff] [blame] | 1 | /* |
Magnus Damm | 3572b33 | 2010-08-16 10:40:49 +0000 | [diff] [blame] | 2 | * SH-Mobile Clock Framework |
Magnus Damm | e47bb51 | 2010-05-12 14:21:24 +0000 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 2010 Magnus Damm |
| 5 | * |
Magnus Damm | 3572b33 | 2010-08-16 10:40:49 +0000 | [diff] [blame] | 6 | * Used together with arch/arm/common/clkdev.c and drivers/sh/clk.c. |
| 7 | * |
Magnus Damm | e47bb51 | 2010-05-12 14:21:24 +0000 | [diff] [blame] | 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 | * |
Magnus Damm | e47bb51 | 2010-05-12 14:21:24 +0000 | [diff] [blame] | 17 | */ |
Laurent Pinchart | b6c461d | 2014-10-26 15:07:32 +0200 | [diff] [blame] | 18 | |
| 19 | #include <linux/export.h> |
Magnus Damm | e47bb51 | 2010-05-12 14:21:24 +0000 | [diff] [blame] | 20 | #include <linux/kernel.h> |
| 21 | #include <linux/init.h> |
| 22 | #include <linux/sh_clk.h> |
Laurent Pinchart | b6c461d | 2014-10-26 15:07:32 +0200 | [diff] [blame] | 23 | |
Magnus Damm | ad6ffa0 | 2014-06-17 16:47:21 +0900 | [diff] [blame] | 24 | #include "clock.h" |
Magnus Damm | fd44aa5 | 2014-06-17 16:47:37 +0900 | [diff] [blame] | 25 | #include "common.h" |
Kuninori Morimoto | f5942c7 | 2013-03-27 00:55:41 -0700 | [diff] [blame] | 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 | }; |
Magnus Damm | e47bb51 | 2010-05-12 14:21:24 +0000 | [diff] [blame] | 37 | |
Magnus Damm | 6b6a4c0 | 2012-02-29 21:41:30 +0900 | [diff] [blame] | 38 | int __init shmobile_clk_init(void) |
Magnus Damm | e47bb51 | 2010-05-12 14:21:24 +0000 | [diff] [blame] | 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 | } |
| 48 | |
| 49 | int __clk_get(struct clk *clk) |
| 50 | { |
| 51 | return 1; |
| 52 | } |
| 53 | EXPORT_SYMBOL(__clk_get); |
| 54 | |
| 55 | void __clk_put(struct clk *clk) |
| 56 | { |
| 57 | } |
| 58 | EXPORT_SYMBOL(__clk_put); |