1/* 2 * SH-Mobile Clock Framework 3 * 4 * Copyright (C) 2010 Magnus Damm 5 * 6 * Used together with arch/arm/common/clkdev.c and drivers/sh/clk.c. 7 * 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 * 17 */ 18 19#include <linux/export.h> 20#include <linux/kernel.h> 21#include <linux/init.h> 22#include <linux/sh_clk.h> 23 24#include "clock.h" 25#include "common.h" 26 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}; 37 38int __init shmobile_clk_init(void) 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