Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Mac Lin and committed by
Anton Vorontsov
38e64ba0 df8f4d2f

+38 -2
-2
arch/arm/mach-cns3xxx/core.h
··· 17 17 void __init cns3xxx_map_io(void); 18 18 void __init cns3xxx_init_irq(void); 19 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 21 #endif /* __CNS3XXX_CORE_H */
+1
arch/arm/mach-cns3xxx/devices.c
··· 18 18 #include <linux/platform_device.h> 19 19 #include <mach/cns3xxx.h> 20 20 #include <mach/irqs.h> 21 + #include <mach/pm.h> 21 22 #include "core.h" 22 23 #include "devices.h" 23 24
+19
arch/arm/mach-cns3xxx/include/mach/pm.h
··· 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 */
+18
arch/arm/mach-cns3xxx/pm.c
··· 6 6 * published by the Free Software Foundation. 7 7 */ 8 8 9 + #include <linux/init.h> 10 + #include <linux/module.h> 9 11 #include <linux/io.h> 10 12 #include <linux/delay.h> 11 13 #include <mach/system.h> 12 14 #include <mach/cns3xxx.h> 15 + #include <mach/pm.h> 13 16 14 17 void cns3xxx_pwr_clk_en(unsigned int block) 15 18 { ··· 21 18 reg |= (block & PM_CLK_GATE_REG_MASK); 22 19 __raw_writel(reg, PM_CLK_GATE_REG); 23 20 } 21 + EXPORT_SYMBOL(cns3xxx_pwr_clk_en); 22 + 23 + void cns3xxx_pwr_clk_dis(unsigned int block) 24 + { 25 + u32 reg = __raw_readl(PM_CLK_GATE_REG); 26 + 27 + reg &= ~(block & PM_CLK_GATE_REG_MASK); 28 + __raw_writel(reg, PM_CLK_GATE_REG); 29 + } 30 + EXPORT_SYMBOL(cns3xxx_pwr_clk_dis); 24 31 25 32 void cns3xxx_pwr_power_up(unsigned int block) 26 33 { ··· 42 29 /* Wait for 300us for the PLL output clock locked. */ 43 30 udelay(300); 44 31 }; 32 + EXPORT_SYMBOL(cns3xxx_pwr_power_up); 45 33 46 34 void cns3xxx_pwr_power_down(unsigned int block) 47 35 { ··· 52 38 reg |= (block & CNS3XXX_PWR_PLL_ALL); 53 39 __raw_writel(reg, PM_PLL_HM_PD_CTRL_REG); 54 40 }; 41 + EXPORT_SYMBOL(cns3xxx_pwr_power_down); 55 42 56 43 static void cns3xxx_pwr_soft_rst_force(unsigned int block) 57 44 { ··· 72 57 73 58 __raw_writel(reg, PM_SOFT_RST_REG); 74 59 } 60 + EXPORT_SYMBOL(cns3xxx_pwr_soft_rst_force); 75 61 76 62 void cns3xxx_pwr_soft_rst(unsigned int block) 77 63 { ··· 86 70 } 87 71 cns3xxx_pwr_soft_rst_force(block); 88 72 } 73 + EXPORT_SYMBOL(cns3xxx_pwr_soft_rst); 89 74 90 75 void arch_reset(char mode, const char *cmd) 91 76 { ··· 117 100 118 101 return cpu; 119 102 } 103 + EXPORT_SYMBOL(cns3xxx_cpu_clock);