aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-cns3xxx/pm.c
diff options
context:
space:
mode:
authorMac Lin <mkl0301@gmail.com>2010-11-22 11:32:43 -0500
committerAnton Vorontsov <cbouatmailru@gmail.com>2010-11-26 13:10:50 -0500
commit38e64ba0f13918d11e50bbd5bb775781ccd6439d (patch)
treef8a349eab0c2a664aced321775c3d9d2520969a0 /arch/arm/mach-cns3xxx/pm.c
parentdf8f4d2f3ef9ca2154f7bd531492a83c4ab4558a (diff)
ARM: cns3xxx: Add new and export the old power management functions
This patch adds cns3xxx_pwr_clk_dis, and exports these power management functions that may be used by many other device drivers on CNS3XXX. Signed-off-by: Mac Lin <mkl0301@gmail.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Diffstat (limited to 'arch/arm/mach-cns3xxx/pm.c')
-rw-r--r--arch/arm/mach-cns3xxx/pm.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/mach-cns3xxx/pm.c b/arch/arm/mach-cns3xxx/pm.c
index dfccabbd9599..c047c1a2bc2a 100644
--- a/arch/arm/mach-cns3xxx/pm.c
+++ b/arch/arm/mach-cns3xxx/pm.c
@@ -6,10 +6,13 @@
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8 8
9#include <linux/init.h>
10#include <linux/module.h>
9#include <linux/io.h> 11#include <linux/io.h>
10#include <linux/delay.h> 12#include <linux/delay.h>
11#include <mach/system.h> 13#include <mach/system.h>
12#include <mach/cns3xxx.h> 14#include <mach/cns3xxx.h>
15#include <mach/pm.h>
13 16
14void cns3xxx_pwr_clk_en(unsigned int block) 17void cns3xxx_pwr_clk_en(unsigned int block)
15{ 18{
@@ -18,6 +21,16 @@ void cns3xxx_pwr_clk_en(unsigned int block)
18 reg |= (block & PM_CLK_GATE_REG_MASK); 21 reg |= (block & PM_CLK_GATE_REG_MASK);
19 __raw_writel(reg, PM_CLK_GATE_REG); 22 __raw_writel(reg, PM_CLK_GATE_REG);
20} 23}
24EXPORT_SYMBOL(cns3xxx_pwr_clk_en);
25
26void cns3xxx_pwr_clk_dis(unsigned int block)
27{
28 u32 reg = __raw_readl(PM_CLK_GATE_REG);
29
30 reg &= ~(block & PM_CLK_GATE_REG_MASK);
31 __raw_writel(reg, PM_CLK_GATE_REG);
32}
33EXPORT_SYMBOL(cns3xxx_pwr_clk_dis);
21 34
22void cns3xxx_pwr_power_up(unsigned int block) 35void cns3xxx_pwr_power_up(unsigned int block)
23{ 36{
@@ -29,6 +42,7 @@ void cns3xxx_pwr_power_up(unsigned int block)
29 /* Wait for 300us for the PLL output clock locked. */ 42 /* Wait for 300us for the PLL output clock locked. */
30 udelay(300); 43 udelay(300);
31}; 44};
45EXPORT_SYMBOL(cns3xxx_pwr_power_up);
32 46
33void cns3xxx_pwr_power_down(unsigned int block) 47void cns3xxx_pwr_power_down(unsigned int block)
34{ 48{
@@ -38,6 +52,7 @@ void cns3xxx_pwr_power_down(unsigned int block)
38 reg |= (block & CNS3XXX_PWR_PLL_ALL); 52 reg |= (block & CNS3XXX_PWR_PLL_ALL);
39 __raw_writel(reg, PM_PLL_HM_PD_CTRL_REG); 53 __raw_writel(reg, PM_PLL_HM_PD_CTRL_REG);
40}; 54};
55EXPORT_SYMBOL(cns3xxx_pwr_power_down);
41 56
42static void cns3xxx_pwr_soft_rst_force(unsigned int block) 57static void cns3xxx_pwr_soft_rst_force(unsigned int block)
43{ 58{
@@ -57,6 +72,7 @@ static void cns3xxx_pwr_soft_rst_force(unsigned int block)
57 72
58 __raw_writel(reg, PM_SOFT_RST_REG); 73 __raw_writel(reg, PM_SOFT_RST_REG);
59} 74}
75EXPORT_SYMBOL(cns3xxx_pwr_soft_rst_force);
60 76
61void cns3xxx_pwr_soft_rst(unsigned int block) 77void cns3xxx_pwr_soft_rst(unsigned int block)
62{ 78{
@@ -70,6 +86,7 @@ void cns3xxx_pwr_soft_rst(unsigned int block)
70 } 86 }
71 cns3xxx_pwr_soft_rst_force(block); 87 cns3xxx_pwr_soft_rst_force(block);
72} 88}
89EXPORT_SYMBOL(cns3xxx_pwr_soft_rst);
73 90
74void arch_reset(char mode, const char *cmd) 91void arch_reset(char mode, const char *cmd)
75{ 92{
@@ -100,3 +117,4 @@ int cns3xxx_cpu_clock(void)
100 117
101 return cpu; 118 return cpu;
102} 119}
120EXPORT_SYMBOL(cns3xxx_cpu_clock);