diff options
author | lars <lars@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-03-05 02:56:25 +0000 |
---|---|---|
committer | lars <lars@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-03-05 02:56:25 +0000 |
commit | 474eca73a833826ab13ce37a9885b787f666025a (patch) | |
tree | 33bd0d9a5e1978bf3a7307ca4d9267ed52b52dc8 /target/linux/xburst/files-2.6.32/arch/mips/jz4740/clock.c | |
parent | 03d2078bc26e389a66cbab30107adb5192e0b117 (diff) |
[xburst] jz4740 pm: Fix gpio suspend/resume. Turn pll off while in suspend and gate
clocks off which arn't handeld by their subsystems yet.
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19984 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/xburst/files-2.6.32/arch/mips/jz4740/clock.c')
-rw-r--r-- | target/linux/xburst/files-2.6.32/arch/mips/jz4740/clock.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/target/linux/xburst/files-2.6.32/arch/mips/jz4740/clock.c b/target/linux/xburst/files-2.6.32/arch/mips/jz4740/clock.c index 26ae08d7c..12a54ed9f 100644 --- a/target/linux/xburst/files-2.6.32/arch/mips/jz4740/clock.c +++ b/target/linux/xburst/files-2.6.32/arch/mips/jz4740/clock.c @@ -158,7 +158,7 @@ static int jz_clk_enable_gating(struct clk *clk) { if (clk->gate_bit == JZ4740_CLK_NOT_GATED) return -EINVAL; - + jz_clk_reg_clear_bits(JZ_REG_CLOCK_GATE, clk->gate_bit); return 0; } @@ -873,7 +873,24 @@ void jz4740_clock_udc_enable_auto_suspend(void) } EXPORT_SYMBOL_GPL(jz4740_clock_udc_enable_auto_suspend); -int jz_init_clocks(void) +void jz4740_clock_suspend(void) +{ + jz_clk_reg_set_bits(JZ_REG_CLOCK_GATE, + JZ_CLOCK_GATE_TCU | JZ_CLOCK_GATE_DMAC | JZ_CLOCK_GATE_UART0); + + jz_clk_reg_clear_bits(JZ_REG_CLOCK_PLL, JZ_CLOCK_PLL_ENABLED); +} + +void jz4740_clock_resume(void) +{ + jz_clk_reg_set_bits(JZ_REG_CLOCK_PLL, JZ_CLOCK_PLL_ENABLED); + while ((jz_clk_reg_read(JZ_REG_CLOCK_PLL) & JZ_CLOCK_PLL_STABLE) == 0); + + jz_clk_reg_clear_bits(JZ_REG_CLOCK_GATE, + JZ_CLOCK_GATE_TCU | JZ_CLOCK_GATE_DMAC | JZ_CLOCK_GATE_UART0); +} + +int jz4740_clock_init(void) { uint32_t val; @@ -905,5 +922,3 @@ int jz_init_clocks(void) return 0; } -EXPORT_SYMBOL_GPL(jz_init_clocks); - |