Merge remote-tracking branch 'moduleh/module.h-split'
[linux-2.6/next.git] / arch / arm / mach-omap2 / clkt_iclk.c
blob3d43fba2542f2a477bb1e908bc2baaa45658dbbc
1 /*
2 * OMAP2/3 interface clock control
4 * Copyright (C) 2011 Nokia Corporation
5 * Paul Walmsley
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 #undef DEBUG
13 #include <linux/kernel.h>
14 #include <linux/clk.h>
15 #include <linux/io.h>
17 #include <plat/clock.h>
18 #include <plat/prcm.h>
20 #include "clock.h"
21 #include "clock2xxx.h"
22 #include "cm2xxx_3xxx.h"
23 #include "cm-regbits-24xx.h"
25 /* Private functions */
27 /* XXX */
28 void omap2_clkt_iclk_allow_idle(struct clk *clk)
30 u32 v, r;
32 r = ((__force u32)clk->enable_reg ^ (CM_AUTOIDLE ^ CM_ICLKEN));
34 v = __raw_readl((__force void __iomem *)r);
35 v |= (1 << clk->enable_bit);
36 __raw_writel(v, (__force void __iomem *)r);
39 /* XXX */
40 void omap2_clkt_iclk_deny_idle(struct clk *clk)
42 u32 v, r;
44 r = ((__force u32)clk->enable_reg ^ (CM_AUTOIDLE ^ CM_ICLKEN));
46 v = __raw_readl((__force void __iomem *)r);
47 v &= ~(1 << clk->enable_bit);
48 __raw_writel(v, (__force void __iomem *)r);
51 /* Public data */
53 const struct clkops clkops_omap2_iclk_dflt_wait = {
54 .enable = omap2_dflt_clk_enable,
55 .disable = omap2_dflt_clk_disable,
56 .find_companion = omap2_clk_dflt_find_companion,
57 .find_idlest = omap2_clk_dflt_find_idlest,
58 .allow_idle = omap2_clkt_iclk_allow_idle,
59 .deny_idle = omap2_clkt_iclk_deny_idle,
62 const struct clkops clkops_omap2_iclk_dflt = {
63 .enable = omap2_dflt_clk_enable,
64 .disable = omap2_dflt_clk_disable,
65 .allow_idle = omap2_clkt_iclk_allow_idle,
66 .deny_idle = omap2_clkt_iclk_deny_idle,
69 const struct clkops clkops_omap2_iclk_idle_only = {
70 .allow_idle = omap2_clkt_iclk_allow_idle,
71 .deny_idle = omap2_clkt_iclk_deny_idle,
74 const struct clkops clkops_omap2_mdmclk_dflt_wait = {
75 .enable = omap2_dflt_clk_enable,
76 .disable = omap2_dflt_clk_disable,
77 .find_companion = omap2_clk_dflt_find_companion,
78 .find_idlest = omap2_clk_dflt_find_idlest,
79 .allow_idle = omap2_clkt_iclk_allow_idle,
80 .deny_idle = omap2_clkt_iclk_deny_idle,