diff options
-rw-r--r-- | arch/arm/mach-omap2/clock.c | 26 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clock.h | 5 |
2 files changed, 30 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index 238be3f1ddce..be53bb21301c 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/clk-private.h> | 26 | #include <linux/clk-private.h> |
27 | #include <asm/cpu.h> | 27 | #include <asm/cpu.h> |
28 | 28 | ||
29 | |||
30 | #include <trace/events/power.h> | 29 | #include <trace/events/power.h> |
31 | 30 | ||
32 | #include "soc.h" | 31 | #include "soc.h" |
@@ -56,6 +55,31 @@ u16 cpu_mask; | |||
56 | static bool clkdm_control = true; | 55 | static bool clkdm_control = true; |
57 | 56 | ||
58 | static LIST_HEAD(clk_hw_omap_clocks); | 57 | static LIST_HEAD(clk_hw_omap_clocks); |
58 | void __iomem *clk_memmaps[CLK_MAX_MEMMAPS]; | ||
59 | |||
60 | void omap2_clk_writel(u32 val, struct clk_hw_omap *clk, void __iomem *reg) | ||
61 | { | ||
62 | if (clk->flags & MEMMAP_ADDRESSING) { | ||
63 | struct clk_omap_reg *r = (struct clk_omap_reg *)® | ||
64 | writel_relaxed(val, clk_memmaps[r->index] + r->offset); | ||
65 | } else { | ||
66 | writel_relaxed(val, reg); | ||
67 | } | ||
68 | } | ||
69 | |||
70 | u32 omap2_clk_readl(struct clk_hw_omap *clk, void __iomem *reg) | ||
71 | { | ||
72 | u32 val; | ||
73 | |||
74 | if (clk->flags & MEMMAP_ADDRESSING) { | ||
75 | struct clk_omap_reg *r = (struct clk_omap_reg *)® | ||
76 | val = readl_relaxed(clk_memmaps[r->index] + r->offset); | ||
77 | } else { | ||
78 | val = readl_relaxed(reg); | ||
79 | } | ||
80 | |||
81 | return val; | ||
82 | } | ||
59 | 83 | ||
60 | /* | 84 | /* |
61 | * Used for clocks that have the same value as the parent clock, | 85 | * Used for clocks that have the same value as the parent clock, |
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h index cbe5ff770ec4..bda767a9dea8 100644 --- a/arch/arm/mach-omap2/clock.h +++ b/arch/arm/mach-omap2/clock.h | |||
@@ -254,6 +254,9 @@ void omap2_clk_print_new_rates(const char *hfclkin_ck_name, | |||
254 | const char *core_ck_name, | 254 | const char *core_ck_name, |
255 | const char *mpu_ck_name); | 255 | const char *mpu_ck_name); |
256 | 256 | ||
257 | u32 omap2_clk_readl(struct clk_hw_omap *clk, void __iomem *reg); | ||
258 | void omap2_clk_writel(u32 val, struct clk_hw_omap *clk, void __iomem *reg); | ||
259 | |||
257 | extern u16 cpu_mask; | 260 | extern u16 cpu_mask; |
258 | 261 | ||
259 | extern const struct clkops clkops_omap2_dflt_wait; | 262 | extern const struct clkops clkops_omap2_dflt_wait; |
@@ -288,6 +291,8 @@ extern const struct clksel_rate div_1_3_rates[]; | |||
288 | extern const struct clksel_rate div_1_4_rates[]; | 291 | extern const struct clksel_rate div_1_4_rates[]; |
289 | extern const struct clksel_rate div31_1to31_rates[]; | 292 | extern const struct clksel_rate div31_1to31_rates[]; |
290 | 293 | ||
294 | extern void __iomem *clk_memmaps[]; | ||
295 | |||
291 | extern int am33xx_clk_init(void); | 296 | extern int am33xx_clk_init(void); |
292 | 297 | ||
293 | extern int omap2_clkops_enable_clkdm(struct clk_hw *hw); | 298 | extern int omap2_clkops_enable_clkdm(struct clk_hw *hw); |