2 * OMAP2/3 interface clock control
4 * Copyright (C) 2011 Nokia Corporation
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.
13 #include <linux/kernel.h>
14 #include <linux/clk-provider.h>
19 #include "clock2xxx.h"
20 #include "cm2xxx_3xxx.h"
21 #include "cm-regbits-24xx.h"
23 /* Private functions */
26 void omap2_clkt_iclk_allow_idle(struct clk_hw_omap
*clk
)
31 r
= (__force
void __iomem
*)
32 ((__force u32
)clk
->enable_reg
^ (CM_AUTOIDLE
^ CM_ICLKEN
));
34 v
= omap2_clk_readl(clk
, r
);
35 v
|= (1 << clk
->enable_bit
);
36 omap2_clk_writel(v
, clk
, r
);
40 void omap2_clkt_iclk_deny_idle(struct clk_hw_omap
*clk
)
45 r
= (__force
void __iomem
*)
46 ((__force u32
)clk
->enable_reg
^ (CM_AUTOIDLE
^ CM_ICLKEN
));
48 v
= omap2_clk_readl(clk
, r
);
49 v
&= ~(1 << clk
->enable_bit
);
50 omap2_clk_writel(v
, clk
, r
);
55 const struct clk_hw_omap_ops clkhwops_iclk
= {
56 .allow_idle
= omap2_clkt_iclk_allow_idle
,
57 .deny_idle
= omap2_clkt_iclk_deny_idle
,
60 const struct clk_hw_omap_ops clkhwops_iclk_wait
= {
61 .allow_idle
= omap2_clkt_iclk_allow_idle
,
62 .deny_idle
= omap2_clkt_iclk_deny_idle
,
63 .find_idlest
= omap2_clk_dflt_find_idlest
,
64 .find_companion
= omap2_clk_dflt_find_companion
,