2018-12-28 00:32:21 -08:00
// SPDX-License-Identifier: GPL-2.0
2006-01-16 22:14:17 -08:00
/*
* arch / sh / kernel / cpu / clock . c - SuperH clock framework
*
2009-05-12 04:27:43 +09:00
* Copyright ( C ) 2005 - 2009 Paul Mundt
2006-01-16 22:14:17 -08:00
*
* This clock framework is derived from the OMAP version by :
*
2009-05-12 04:27:43 +09:00
* Copyright ( C ) 2004 - 2008 Nokia Corporation
2006-01-16 22:14:17 -08:00
* Written by Tuukka Tikkanen < tuukka . tikkanen @ elektrobit . com >
*
2006-12-01 13:15:14 +09:00
* Modified for omap shared clock framework by Tony Lindgren < tony @ atomide . com >
2006-01-16 22:14:17 -08:00
*/
# include <linux/kernel.h>
# include <linux/init.h>
2010-03-08 21:45:19 +09:00
# include <linux/clk.h>
2006-01-16 22:14:17 -08:00
# include <asm/clock.h>
2009-05-13 17:38:11 +09:00
# include <asm/machvec.h>
2006-01-16 22:14:17 -08:00
int __init clk_init ( void )
{
2009-05-13 17:38:11 +09:00
int ret ;
2006-01-16 22:14:17 -08:00
2016-07-31 03:11:30 +00:00
# ifndef CONFIG_COMMON_CLK
2009-05-13 17:38:11 +09:00
ret = arch_clk_init ( ) ;
if ( unlikely ( ret ) ) {
pr_err ( " %s: CPU clock registration failed. \n " , __func__ ) ;
return ret ;
2006-01-16 22:14:17 -08:00
}
2016-07-31 03:11:30 +00:00
# endif
2006-01-16 22:14:17 -08:00
2009-05-13 17:38:11 +09:00
if ( sh_mv . mv_clk_init ) {
ret = sh_mv . mv_clk_init ( ) ;
if ( unlikely ( ret ) ) {
pr_err ( " %s: machvec clock initialization failed. \n " ,
__func__ ) ;
return ret ;
}
}
2007-05-15 08:42:22 +09:00
2016-07-31 03:11:30 +00:00
# ifndef CONFIG_COMMON_CLK
2006-01-16 22:14:17 -08:00
/* Kick the child clocks.. */
2009-05-12 04:27:43 +09:00
recalculate_root_clocks ( ) ;
2006-01-16 22:14:17 -08:00
2009-05-12 05:14:53 +09:00
/* Enable the necessary init clocks */
clk_enable_init_clocks ( ) ;
2016-07-31 03:11:30 +00:00
# endif
2009-05-12 05:14:53 +09:00
2006-01-16 22:14:17 -08:00
return ret ;
}
2009-05-13 21:51:28 +09:00