diff options
author | Rajendra Nayak <rnayak@ti.com> | 2012-04-27 06:23:48 -0400 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2012-11-12 21:10:18 -0500 |
commit | b4777a21381fd1f87be8c606a616b7f97f485d2b (patch) | |
tree | af45be72d14dde6fc899ac2ad5f9984f1bfa5cd5 /arch/arm/mach-omap2/clock3517.c | |
parent | 32cc002116b866151ca24c6e9110ba8a93754753 (diff) |
ARM: OMAP3: clock: Convert to common clk
Convert all OMAP3 specific platform files to use COMMON clk
and keep all the changes under the CONFIG_COMMON_CLK macro check
so it does not break any existing code. At a later point switch
to COMMON clk and get rid of all old/legacy code.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Mike Turquette <mturquette@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2/clock3517.c')
-rw-r--r-- | arch/arm/mach-omap2/clock3517.c | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/clock3517.c b/arch/arm/mach-omap2/clock3517.c index 622ea0502610..467d8bc6b4aa 100644 --- a/arch/arm/mach-omap2/clock3517.c +++ b/arch/arm/mach-omap2/clock3517.c | |||
@@ -47,7 +47,11 @@ | |||
47 | * in the enable register itsel at a bit offset of 4 from the enable | 47 | * in the enable register itsel at a bit offset of 4 from the enable |
48 | * bit. A value of 1 indicates that clock is enabled. | 48 | * bit. A value of 1 indicates that clock is enabled. |
49 | */ | 49 | */ |
50 | #ifdef CONFIG_COMMON_CLK | ||
51 | static void am35xx_clk_find_idlest(struct clk_hw_omap *clk, | ||
52 | #else | ||
50 | static void am35xx_clk_find_idlest(struct clk *clk, | 53 | static void am35xx_clk_find_idlest(struct clk *clk, |
54 | #endif | ||
51 | void __iomem **idlest_reg, | 55 | void __iomem **idlest_reg, |
52 | u8 *idlest_bit, | 56 | u8 *idlest_bit, |
53 | u8 *idlest_val) | 57 | u8 *idlest_val) |
@@ -71,8 +75,14 @@ static void am35xx_clk_find_idlest(struct clk *clk, | |||
71 | * associate this type of code with per-module data structures to | 75 | * associate this type of code with per-module data structures to |
72 | * avoid this issue, and remove the casts. No return value. | 76 | * avoid this issue, and remove the casts. No return value. |
73 | */ | 77 | */ |
74 | static void am35xx_clk_find_companion(struct clk *clk, void __iomem **other_reg, | 78 | #ifdef CONFIG_COMMON_CLK |
75 | u8 *other_bit) | 79 | static void am35xx_clk_find_companion(struct clk_hw_omap *clk, |
80 | void __iomem **other_reg, | ||
81 | #else | ||
82 | static void am35xx_clk_find_companion(struct clk *clk, | ||
83 | void __iomem **other_reg, | ||
84 | #endif | ||
85 | u8 *other_bit) | ||
76 | { | 86 | { |
77 | *other_reg = (__force void __iomem *)(clk->enable_reg); | 87 | *other_reg = (__force void __iomem *)(clk->enable_reg); |
78 | if (clk->enable_bit & AM35XX_IPSS_ICK_MASK) | 88 | if (clk->enable_bit & AM35XX_IPSS_ICK_MASK) |
@@ -80,13 +90,19 @@ static void am35xx_clk_find_companion(struct clk *clk, void __iomem **other_reg, | |||
80 | else | 90 | else |
81 | *other_bit = clk->enable_bit - AM35XX_IPSS_ICK_FCK_OFFSET; | 91 | *other_bit = clk->enable_bit - AM35XX_IPSS_ICK_FCK_OFFSET; |
82 | } | 92 | } |
83 | 93 | #ifdef CONFIG_COMMON_CLK | |
94 | const struct clk_hw_omap_ops clkhwops_am35xx_ipss_module_wait = { | ||
95 | .find_idlest = am35xx_clk_find_idlest, | ||
96 | .find_companion = am35xx_clk_find_companion, | ||
97 | }; | ||
98 | #else | ||
84 | const struct clkops clkops_am35xx_ipss_module_wait = { | 99 | const struct clkops clkops_am35xx_ipss_module_wait = { |
85 | .enable = omap2_dflt_clk_enable, | 100 | .enable = omap2_dflt_clk_enable, |
86 | .disable = omap2_dflt_clk_disable, | 101 | .disable = omap2_dflt_clk_disable, |
87 | .find_idlest = am35xx_clk_find_idlest, | 102 | .find_idlest = am35xx_clk_find_idlest, |
88 | .find_companion = am35xx_clk_find_companion, | 103 | .find_companion = am35xx_clk_find_companion, |
89 | }; | 104 | }; |
105 | #endif | ||
90 | 106 | ||
91 | /** | 107 | /** |
92 | * am35xx_clk_ipss_find_idlest - return CM_IDLEST info for IPSS | 108 | * am35xx_clk_ipss_find_idlest - return CM_IDLEST info for IPSS |
@@ -99,7 +115,11 @@ const struct clkops clkops_am35xx_ipss_module_wait = { | |||
99 | * CM_{I,F}CLKEN bit. Pass back the correct info via @idlest_reg | 115 | * CM_{I,F}CLKEN bit. Pass back the correct info via @idlest_reg |
100 | * and @idlest_bit. No return value. | 116 | * and @idlest_bit. No return value. |
101 | */ | 117 | */ |
118 | #ifdef CONFIG_COMMON_CLK | ||
119 | static void am35xx_clk_ipss_find_idlest(struct clk_hw_omap *clk, | ||
120 | #else | ||
102 | static void am35xx_clk_ipss_find_idlest(struct clk *clk, | 121 | static void am35xx_clk_ipss_find_idlest(struct clk *clk, |
122 | #endif | ||
103 | void __iomem **idlest_reg, | 123 | void __iomem **idlest_reg, |
104 | u8 *idlest_bit, | 124 | u8 *idlest_bit, |
105 | u8 *idlest_val) | 125 | u8 *idlest_val) |
@@ -111,7 +131,14 @@ static void am35xx_clk_ipss_find_idlest(struct clk *clk, | |||
111 | *idlest_bit = AM35XX_ST_IPSS_SHIFT; | 131 | *idlest_bit = AM35XX_ST_IPSS_SHIFT; |
112 | *idlest_val = OMAP34XX_CM_IDLEST_VAL; | 132 | *idlest_val = OMAP34XX_CM_IDLEST_VAL; |
113 | } | 133 | } |
114 | 134 | #ifdef CONFIG_COMMON_CLK | |
135 | const struct clk_hw_omap_ops clkhwops_am35xx_ipss_wait = { | ||
136 | .allow_idle = omap2_clkt_iclk_allow_idle, | ||
137 | .deny_idle = omap2_clkt_iclk_deny_idle, | ||
138 | .find_idlest = am35xx_clk_ipss_find_idlest, | ||
139 | .find_companion = omap2_clk_dflt_find_companion, | ||
140 | }; | ||
141 | #else | ||
115 | const struct clkops clkops_am35xx_ipss_wait = { | 142 | const struct clkops clkops_am35xx_ipss_wait = { |
116 | .enable = omap2_dflt_clk_enable, | 143 | .enable = omap2_dflt_clk_enable, |
117 | .disable = omap2_dflt_clk_disable, | 144 | .disable = omap2_dflt_clk_disable, |
@@ -120,5 +147,5 @@ const struct clkops clkops_am35xx_ipss_wait = { | |||
120 | .allow_idle = omap2_clkt_iclk_allow_idle, | 147 | .allow_idle = omap2_clkt_iclk_allow_idle, |
121 | .deny_idle = omap2_clkt_iclk_deny_idle, | 148 | .deny_idle = omap2_clkt_iclk_deny_idle, |
122 | }; | 149 | }; |
123 | 150 | #endif | |
124 | 151 | ||