diff options
| author | Mac Lin <mkl0301@gmail.com> | 2010-11-22 11:32:43 -0500 |
|---|---|---|
| committer | Anton Vorontsov <cbouatmailru@gmail.com> | 2010-11-26 13:10:50 -0500 |
| commit | 38e64ba0f13918d11e50bbd5bb775781ccd6439d (patch) | |
| tree | f8a349eab0c2a664aced321775c3d9d2520969a0 | |
| parent | df8f4d2f3ef9ca2154f7bd531492a83c4ab4558a (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>
| -rw-r--r-- | arch/arm/mach-cns3xxx/core.h | 2 | ||||
| -rw-r--r-- | arch/arm/mach-cns3xxx/devices.c | 1 | ||||
| -rw-r--r-- | arch/arm/mach-cns3xxx/include/mach/pm.h | 19 | ||||
| -rw-r--r-- | arch/arm/mach-cns3xxx/pm.c | 18 |
4 files changed, 38 insertions, 2 deletions
diff --git a/arch/arm/mach-cns3xxx/core.h b/arch/arm/mach-cns3xxx/core.h index 6b33ec11346e..73898a7835d3 100644 --- a/arch/arm/mach-cns3xxx/core.h +++ b/arch/arm/mach-cns3xxx/core.h | |||
| @@ -17,7 +17,5 @@ extern struct sys_timer cns3xxx_timer; | |||
| 17 | void __init cns3xxx_map_io(void); | 17 | void __init cns3xxx_map_io(void); |
| 18 | void __init cns3xxx_init_irq(void); | 18 | void __init cns3xxx_init_irq(void); |
| 19 | void cns3xxx_power_off(void); | 19 | void cns3xxx_power_off(void); |
| 20 | void cns3xxx_pwr_power_up(unsigned int block); | ||
| 21 | void cns3xxx_pwr_power_down(unsigned int block); | ||
| 22 | 20 | ||
| 23 | #endif /* __CNS3XXX_CORE_H */ | 21 | #endif /* __CNS3XXX_CORE_H */ |
diff --git a/arch/arm/mach-cns3xxx/devices.c b/arch/arm/mach-cns3xxx/devices.c index 50b4d31c27c0..79d1fb02c23f 100644 --- a/arch/arm/mach-cns3xxx/devices.c +++ b/arch/arm/mach-cns3xxx/devices.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
| 19 | #include <mach/cns3xxx.h> | 19 | #include <mach/cns3xxx.h> |
| 20 | #include <mach/irqs.h> | 20 | #include <mach/irqs.h> |
| 21 | #include <mach/pm.h> | ||
| 21 | #include "core.h" | 22 | #include "core.h" |
| 22 | #include "devices.h" | 23 | #include "devices.h" |
| 23 | 24 | ||
diff --git a/arch/arm/mach-cns3xxx/include/mach/pm.h b/arch/arm/mach-cns3xxx/include/mach/pm.h new file mode 100644 index 000000000000..102617bdb45b --- /dev/null +++ b/arch/arm/mach-cns3xxx/include/mach/pm.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2000 Deep Blue Solutions Ltd | ||
| 3 | * Copyright 2004 ARM Limited | ||
| 4 | * Copyright 2008 Cavium Networks | ||
| 5 | * | ||
| 6 | * This file is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License, Version 2, as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __CNS3XXX_PM_H | ||
| 12 | #define __CNS3XXX_PM_H | ||
| 13 | |||
| 14 | void cns3xxx_pwr_clk_en(unsigned int block); | ||
| 15 | void cns3xxx_pwr_clk_dis(unsigned int block); | ||
| 16 | void cns3xxx_pwr_power_up(unsigned int block); | ||
| 17 | void cns3xxx_pwr_power_down(unsigned int block); | ||
| 18 | |||
| 19 | #endif /* __CNS3XXX_PM_H */ | ||
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 | ||
| 14 | void cns3xxx_pwr_clk_en(unsigned int block) | 17 | void 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 | } |
| 24 | EXPORT_SYMBOL(cns3xxx_pwr_clk_en); | ||
| 25 | |||
| 26 | void 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 | } | ||
| 33 | EXPORT_SYMBOL(cns3xxx_pwr_clk_dis); | ||
| 21 | 34 | ||
| 22 | void cns3xxx_pwr_power_up(unsigned int block) | 35 | void 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 | }; |
| 45 | EXPORT_SYMBOL(cns3xxx_pwr_power_up); | ||
| 32 | 46 | ||
| 33 | void cns3xxx_pwr_power_down(unsigned int block) | 47 | void 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 | }; |
| 55 | EXPORT_SYMBOL(cns3xxx_pwr_power_down); | ||
| 41 | 56 | ||
| 42 | static void cns3xxx_pwr_soft_rst_force(unsigned int block) | 57 | static 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 | } |
| 75 | EXPORT_SYMBOL(cns3xxx_pwr_soft_rst_force); | ||
| 60 | 76 | ||
| 61 | void cns3xxx_pwr_soft_rst(unsigned int block) | 77 | void 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 | } |
| 89 | EXPORT_SYMBOL(cns3xxx_pwr_soft_rst); | ||
| 73 | 90 | ||
| 74 | void arch_reset(char mode, const char *cmd) | 91 | void 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 | } |
| 120 | EXPORT_SYMBOL(cns3xxx_cpu_clock); | ||
