blob: 4187cf4fe18583b74533536e9c491dee3246dcc9 [file] [log] [blame]
Paul Mundt36ddf312006-01-16 22:14:17 -08001/*
2 * arch/sh/kernel/cpu/clock.c - SuperH clock framework
3 *
Paul Mundtb1f6cfe2009-05-12 04:27:43 +09004 * Copyright (C) 2005 - 2009 Paul Mundt
Paul Mundt36ddf312006-01-16 22:14:17 -08005 *
6 * This clock framework is derived from the OMAP version by:
7 *
Paul Mundtb1f6cfe2009-05-12 04:27:43 +09008 * Copyright (C) 2004 - 2008 Nokia Corporation
Paul Mundt36ddf312006-01-16 22:14:17 -08009 * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
10 *
Paul Mundt1d118562006-12-01 13:15:14 +090011 * Modified for omap shared clock framework by Tony Lindgren <tony@atomide.com>
12 *
Paul Mundt36ddf312006-01-16 22:14:17 -080013 * This file is subject to the terms and conditions of the GNU General Public
14 * License. See the file "COPYING" in the main directory of this archive
15 * for more details.
16 */
17#include <linux/kernel.h>
18#include <linux/init.h>
Paul Mundt51a50062010-03-08 21:45:19 +090019#include <linux/clk.h>
Paul Mundt36ddf312006-01-16 22:14:17 -080020#include <asm/clock.h>
Paul Mundt253b0882009-05-13 17:38:11 +090021#include <asm/machvec.h>
Paul Mundt36ddf312006-01-16 22:14:17 -080022
Paul Mundt36ddf312006-01-16 22:14:17 -080023int __init clk_init(void)
24{
Paul Mundt253b0882009-05-13 17:38:11 +090025 int ret;
Paul Mundt36ddf312006-01-16 22:14:17 -080026
Paul Mundt253b0882009-05-13 17:38:11 +090027 ret = arch_clk_init();
28 if (unlikely(ret)) {
29 pr_err("%s: CPU clock registration failed.\n", __func__);
30 return ret;
Paul Mundt36ddf312006-01-16 22:14:17 -080031 }
32
Paul Mundt253b0882009-05-13 17:38:11 +090033 if (sh_mv.mv_clk_init) {
34 ret = sh_mv.mv_clk_init();
35 if (unlikely(ret)) {
36 pr_err("%s: machvec clock initialization failed.\n",
37 __func__);
38 return ret;
39 }
40 }
dmitry pervushindfbbbe92007-05-15 08:42:22 +090041
Paul Mundt36ddf312006-01-16 22:14:17 -080042 /* Kick the child clocks.. */
Paul Mundtb1f6cfe2009-05-12 04:27:43 +090043 recalculate_root_clocks();
Paul Mundt36ddf312006-01-16 22:14:17 -080044
Paul Mundt4ff29ff2009-05-12 05:14:53 +090045 /* Enable the necessary init clocks */
46 clk_enable_init_clocks();
47
Paul Mundt36ddf312006-01-16 22:14:17 -080048 return ret;
49}
50
Paul Mundtcedcf332009-05-13 21:51:28 +090051