Path: blob/master/arch/arm/mach-omap2/clkt2xxx_sys.c
10817 views
/*1* OMAP2xxx sys_clk-specific clock code2*3* Copyright (C) 2005-2008 Texas Instruments, Inc.4* Copyright (C) 2004-2010 Nokia Corporation5*6* Contacts:7* Richard Woodruff <[email protected]>8* Paul Walmsley9*10* Based on earlier work by Tuukka Tikkanen, Tony Lindgren,11* Gordon McNutt and RidgeRun, Inc.12*13* This program is free software; you can redistribute it and/or modify14* it under the terms of the GNU General Public License version 2 as15* published by the Free Software Foundation.16*/17#undef DEBUG1819#include <linux/kernel.h>20#include <linux/errno.h>21#include <linux/clk.h>22#include <linux/io.h>2324#include <plat/clock.h>2526#include "clock.h"27#include "clock2xxx.h"28#include "prm2xxx_3xxx.h"29#include "prm-regbits-24xx.h"3031void __iomem *prcm_clksrc_ctrl;3233u32 omap2xxx_get_sysclkdiv(void)34{35u32 div;3637div = __raw_readl(prcm_clksrc_ctrl);38div &= OMAP_SYSCLKDIV_MASK;39div >>= OMAP_SYSCLKDIV_SHIFT;4041return div;42}4344unsigned long omap2xxx_sys_clk_recalc(struct clk *clk)45{46return clk->parent->rate / omap2xxx_get_sysclkdiv();47}4849505152