diff options
| -rw-r--r-- | arch/arm/mach-omap2/clock24xx.c | 37 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/clock24xx.h | 4 |
2 files changed, 37 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c index 44de0271fc2f..bc5d3ac66611 100644 --- a/arch/arm/mach-omap2/clock24xx.c +++ b/arch/arm/mach-omap2/clock24xx.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | 30 | ||
| 31 | #include <mach/clock.h> | 31 | #include <mach/clock.h> |
| 32 | #include <mach/sram.h> | 32 | #include <mach/sram.h> |
| 33 | #include <mach/prcm.h> | ||
| 33 | #include <asm/div64.h> | 34 | #include <asm/div64.h> |
| 34 | #include <asm/clkdev.h> | 35 | #include <asm/clkdev.h> |
| 35 | 36 | ||
| @@ -43,6 +44,18 @@ | |||
| 43 | static const struct clkops clkops_oscck; | 44 | static const struct clkops clkops_oscck; |
| 44 | static const struct clkops clkops_fixed; | 45 | static const struct clkops clkops_fixed; |
| 45 | 46 | ||
| 47 | static void omap2430_clk_i2chs_find_idlest(struct clk *clk, | ||
| 48 | void __iomem **idlest_reg, | ||
| 49 | u8 *idlest_bit); | ||
| 50 | |||
| 51 | /* 2430 I2CHS has non-standard IDLEST register */ | ||
| 52 | static const struct clkops clkops_omap2430_i2chs_wait = { | ||
| 53 | .enable = omap2_dflt_clk_enable, | ||
| 54 | .disable = omap2_dflt_clk_disable, | ||
| 55 | .find_idlest = omap2430_clk_i2chs_find_idlest, | ||
| 56 | .find_companion = omap2_clk_dflt_find_companion, | ||
| 57 | }; | ||
| 58 | |||
| 46 | #include "clock24xx.h" | 59 | #include "clock24xx.h" |
| 47 | 60 | ||
| 48 | struct omap_clk { | 61 | struct omap_clk { |
| @@ -240,6 +253,26 @@ static void __iomem *prcm_clksrc_ctrl; | |||
| 240 | *-------------------------------------------------------------------------*/ | 253 | *-------------------------------------------------------------------------*/ |
| 241 | 254 | ||
| 242 | /** | 255 | /** |
| 256 | * omap2430_clk_i2chs_find_idlest - return CM_IDLEST info for 2430 I2CHS | ||
| 257 | * @clk: struct clk * being enabled | ||
| 258 | * @idlest_reg: void __iomem ** to store CM_IDLEST reg address into | ||
| 259 | * @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into | ||
| 260 | * | ||
| 261 | * OMAP2430 I2CHS CM_IDLEST bits are in CM_IDLEST1_CORE, but the | ||
| 262 | * CM_*CLKEN bits are in CM_{I,F}CLKEN2_CORE. This custom function | ||
| 263 | * passes back the correct CM_IDLEST register address for I2CHS | ||
| 264 | * modules. No return value. | ||
| 265 | */ | ||
| 266 | static void omap2430_clk_i2chs_find_idlest(struct clk *clk, | ||
| 267 | void __iomem **idlest_reg, | ||
| 268 | u8 *idlest_bit) | ||
| 269 | { | ||
| 270 | *idlest_reg = OMAP_CM_REGADDR(CORE_MOD, CM_IDLEST); | ||
| 271 | *idlest_bit = clk->enable_bit; | ||
| 272 | } | ||
| 273 | |||
| 274 | |||
| 275 | /** | ||
| 243 | * omap2xxx_clk_get_core_rate - return the CORE_CLK rate | 276 | * omap2xxx_clk_get_core_rate - return the CORE_CLK rate |
| 244 | * @clk: pointer to the combined dpll_ck + core_ck (currently "dpll_ck") | 277 | * @clk: pointer to the combined dpll_ck + core_ck (currently "dpll_ck") |
| 245 | * | 278 | * |
| @@ -325,8 +358,8 @@ static int omap2_clk_fixed_enable(struct clk *clk) | |||
| 325 | else if (clk == &apll54_ck) | 358 | else if (clk == &apll54_ck) |
| 326 | cval = OMAP24XX_ST_54M_APLL; | 359 | cval = OMAP24XX_ST_54M_APLL; |
| 327 | 360 | ||
| 328 | omap2_wait_clock_ready(OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), cval, | 361 | omap2_cm_wait_idlest(OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), cval, |
| 329 | clk->name); | 362 | clk->name); |
| 330 | 363 | ||
| 331 | /* | 364 | /* |
| 332 | * REVISIT: Should we return an error code if omap2_wait_clock_ready() | 365 | * REVISIT: Should we return an error code if omap2_wait_clock_ready() |
diff --git a/arch/arm/mach-omap2/clock24xx.h b/arch/arm/mach-omap2/clock24xx.h index 458f00cdcbea..d19cf7a7d8db 100644 --- a/arch/arm/mach-omap2/clock24xx.h +++ b/arch/arm/mach-omap2/clock24xx.h | |||
| @@ -2337,7 +2337,7 @@ static struct clk i2c2_fck = { | |||
| 2337 | 2337 | ||
| 2338 | static struct clk i2chs2_fck = { | 2338 | static struct clk i2chs2_fck = { |
| 2339 | .name = "i2c_fck", | 2339 | .name = "i2c_fck", |
| 2340 | .ops = &clkops_omap2_dflt_wait, | 2340 | .ops = &clkops_omap2430_i2chs_wait, |
| 2341 | .id = 2, | 2341 | .id = 2, |
| 2342 | .parent = &func_96m_ck, | 2342 | .parent = &func_96m_ck, |
| 2343 | .clkdm_name = "core_l4_clkdm", | 2343 | .clkdm_name = "core_l4_clkdm", |
| @@ -2370,7 +2370,7 @@ static struct clk i2c1_fck = { | |||
| 2370 | 2370 | ||
| 2371 | static struct clk i2chs1_fck = { | 2371 | static struct clk i2chs1_fck = { |
| 2372 | .name = "i2c_fck", | 2372 | .name = "i2c_fck", |
| 2373 | .ops = &clkops_omap2_dflt_wait, | 2373 | .ops = &clkops_omap2430_i2chs_wait, |
| 2374 | .id = 1, | 2374 | .id = 1, |
| 2375 | .parent = &func_96m_ck, | 2375 | .parent = &func_96m_ck, |
| 2376 | .clkdm_name = "core_l4_clkdm", | 2376 | .clkdm_name = "core_l4_clkdm", |
