aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-cns3xxx/pm.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-cns3xxx/pm.c')
-rw-r--r--arch/arm/mach-cns3xxx/pm.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/arm/mach-cns3xxx/pm.c b/arch/arm/mach-cns3xxx/pm.c
index 38e44706feab..5e579552aa54 100644
--- a/arch/arm/mach-cns3xxx/pm.c
+++ b/arch/arm/mach-cns3xxx/pm.c
@@ -6,10 +6,14 @@
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>
13#include <asm/atomic.h>
11#include <mach/system.h> 14#include <mach/system.h>
12#include <mach/cns3xxx.h> 15#include <mach/cns3xxx.h>
16#include <mach/pm.h>
13 17
14void cns3xxx_pwr_clk_en(unsigned int block) 18void cns3xxx_pwr_clk_en(unsigned int block)
15{ 19{
@@ -18,6 +22,16 @@ void cns3xxx_pwr_clk_en(unsigned int block)
18 reg |= (block & PM_CLK_GATE_REG_MASK); 22 reg |= (block & PM_CLK_GATE_REG_MASK);
19 __raw_writel(reg, PM_CLK_GATE_REG); 23 __raw_writel(reg, PM_CLK_GATE_REG);
20} 24}
25EXPORT_SYMBOL(cns3xxx_pwr_clk_en);
26
27void cns3xxx_pwr_clk_dis(unsigned int block)
28{
29 u32 reg = __raw_readl(PM_CLK_GATE_REG);
30
31 reg &= ~(block & PM_CLK_GATE_REG_MASK);
32 __raw_writel(reg, PM_CLK_GATE_REG);
33}
34EXPORT_SYMBOL(cns3xxx_pwr_clk_dis);
21 35
22void cns3xxx_pwr_power_up(unsigned int block) 36void cns3xxx_pwr_power_up(unsigned int block)
23{ 37{
@@ -29,6 +43,7 @@ void cns3xxx_pwr_power_up(unsigned int block)
29 /* Wait for 300us for the PLL output clock locked. */ 43 /* Wait for 300us for the PLL output clock locked. */
30 udelay(300); 44 udelay(300);
31}; 45};
46EXPORT_SYMBOL(cns3xxx_pwr_power_up);
32 47
33void cns3xxx_pwr_power_down(unsigned int block) 48void cns3xxx_pwr_power_down(unsigned int block)
34{ 49{
@@ -38,6 +53,7 @@ void cns3xxx_pwr_power_down(unsigned int block)
38 reg |= (block & CNS3XXX_PWR_PLL_ALL); 53 reg |= (block & CNS3XXX_PWR_PLL_ALL);
39 __raw_writel(reg, PM_PLL_HM_PD_CTRL_REG); 54 __raw_writel(reg, PM_PLL_HM_PD_CTRL_REG);
40}; 55};
56EXPORT_SYMBOL(cns3xxx_pwr_power_down);
41 57
42static void cns3xxx_pwr_soft_rst_force(unsigned int block) 58static void cns3xxx_pwr_soft_rst_force(unsigned int block)
43{ 59{
@@ -51,11 +67,13 @@ static void cns3xxx_pwr_soft_rst_force(unsigned int block)
51 reg &= ~(block & PM_SOFT_RST_REG_MASK); 67 reg &= ~(block & PM_SOFT_RST_REG_MASK);
52 } else { 68 } else {
53 reg &= ~(block & PM_SOFT_RST_REG_MASK); 69 reg &= ~(block & PM_SOFT_RST_REG_MASK);
70 __raw_writel(reg, PM_SOFT_RST_REG);
54 reg |= (block & PM_SOFT_RST_REG_MASK); 71 reg |= (block & PM_SOFT_RST_REG_MASK);
55 } 72 }
56 73
57 __raw_writel(reg, PM_SOFT_RST_REG); 74 __raw_writel(reg, PM_SOFT_RST_REG);
58} 75}
76EXPORT_SYMBOL(cns3xxx_pwr_soft_rst_force);
59 77
60void cns3xxx_pwr_soft_rst(unsigned int block) 78void cns3xxx_pwr_soft_rst(unsigned int block)
61{ 79{
@@ -69,6 +87,7 @@ void cns3xxx_pwr_soft_rst(unsigned int block)
69 } 87 }
70 cns3xxx_pwr_soft_rst_force(block); 88 cns3xxx_pwr_soft_rst_force(block);
71} 89}
90EXPORT_SYMBOL(cns3xxx_pwr_soft_rst);
72 91
73void arch_reset(char mode, const char *cmd) 92void arch_reset(char mode, const char *cmd)
74{ 93{
@@ -99,3 +118,7 @@ int cns3xxx_cpu_clock(void)
99 118
100 return cpu; 119 return cpu;
101} 120}
121EXPORT_SYMBOL(cns3xxx_cpu_clock);
122
123atomic_t usb_pwr_ref = ATOMIC_INIT(0);
124EXPORT_SYMBOL(usb_pwr_ref);