diff options
author | Rabin Vincent <rabin.vincent@stericsson.com> | 2011-12-01 10:44:33 +0530 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-22 10:59:24 +0200 |
commit | 1f279b34a691e6737f68f766efbf269569925197 (patch) | |
tree | 7eed62df8ac95e5545c57db39230f18f2363a27d | |
parent | d7285f989c8182e01922bed16683e36beec767bd (diff) |
u5500: don't always keep REFCLK on CLKOUT2
Only enable REFCLK to the AB via CLKOUT2 when
it is requested for.
ST-Ericsson ID: 343921
ST-Ericsson Linux next: NA
ST-Ericsson FOSS-OUT ID: Trivial
Change-Id: I451167a82eca1cb0c506c9fc489f7f5bc66ee3c2
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/40441
Reviewed-by: QATOOLS
Reviewed-by: QABUILD
Reviewed-by: Vijaya Kumar K-1 <vijay.kilari@stericsson.com>
-rw-r--r-- | arch/arm/mach-ux500/clock-db5500.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/clock-db5500.c b/arch/arm/mach-ux500/clock-db5500.c index 868698fee66..508af678387 100644 --- a/arch/arm/mach-ux500/clock-db5500.c +++ b/arch/arm/mach-ux500/clock-db5500.c @@ -118,6 +118,26 @@ static struct clkops clkout1_ops = { .disable = clkout1_disable, }; +#define PRCM_CLKOCR2 0x58C +#define PRCM_CLKOCR2_REFCLK (1 << 0) +#define PRCM_CLKOCR2_STATIC0 (1 << 2) + +static int clkout2_enable(struct clk *clk) +{ + prcmu_write(PRCM_CLKOCR2, PRCM_CLKOCR2_REFCLK); + return 0; +} + +static void clkout2_disable(struct clk *clk) +{ + prcmu_write(PRCM_CLKOCR2, PRCM_CLKOCR2_STATIC0); +} + +static struct clkops clkout2_ops = { + .enable = clkout2_enable, + .disable = clkout2_disable, +}; + #define DEF_PER1_PCLK(_cg_bit, _name) \ DEF_PRCC_PCLK(_name, U5500_CLKRST1_BASE, _cg_bit, &per1clk) #define DEF_PER2_PCLK(_cg_bit, _name) \ @@ -205,6 +225,13 @@ static struct clk clkout1 = { .mutex = &sysclk_mutex, }; +static struct clk clkout2 = { + .name = "clkout2", + .ops = &clkout2_ops, + .parent = &sysclk, + .mutex = &sysclk_mutex, +}; + static DEFINE_MUTEX(parented_prcmu_mutex); #define DEF_PRCMU_CLK_PARENT(_name, _cg_sel, _rate, _parent) \ @@ -466,6 +493,7 @@ static struct clk *db5500_dbg_clks[] __initdata = { /* Clock sources */ &clkout0, &clkout1, + &clkout2, &rtc_clk1, }; @@ -560,6 +588,8 @@ static struct clk_lookup db5500_prcc_clocks[] = { static struct clk_lookup db5500_clkouts[] = { CLK_LOOKUP(clkout1, "mmio_camera", "primary-cam"), CLK_LOOKUP(clkout1, "mmio_camera", "secondary-cam"), + CLK_LOOKUP(clkout2, "ab5500-usb.0", "sysclk"), + CLK_LOOKUP(clkout2, "ab5500-codec.0", "sysclk"), }; static struct clk_lookup u5500_clocks[] = { @@ -642,6 +672,7 @@ static struct clk *db5500_clks_tobe_disabled[] __initdata = { &p5_i2c3_clk, &pwmclk, &svaclk, + &clkout2, }; static int __init init_clock_states(void) |