diff options
author | Paul Walmsley <paul@pwsan.com> | 2011-02-25 17:54:33 -0500 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2011-03-07 22:05:08 -0500 |
commit | e1d6f4729e9fd46efa1029b6e806bb8b6c24e776 (patch) | |
tree | 270f7d539aaf632728e67db6143fce0fa65d69cc /arch/arm/mach-omap2 | |
parent | 7328ff4d72401835fa1aadfb9e574a2133bd952b (diff) |
OMAP: voltage: move plat/voltage.h to mach-omap2/voltage.h
At this point in time, there's no reason for this header file to be in
plat-omap/include/plat/voltage.h. It should not be included by device
drivers, and the code that uses it is currently all under mach-omap2/.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/omap_twl.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/pm.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/smartreflex.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-omap2/sr_device.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/voltage.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-omap2/voltage.h | 155 |
6 files changed, 162 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/omap_twl.c b/arch/arm/mach-omap2/omap_twl.c index 00e1d2b53683..ad8c18a45ce1 100644 --- a/arch/arm/mach-omap2/omap_twl.c +++ b/arch/arm/mach-omap2/omap_twl.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/i2c/twl.h> | 19 | #include <linux/i2c/twl.h> |
20 | 20 | ||
21 | #include <plat/voltage.h> | 21 | #include "voltage.h" |
22 | 22 | ||
23 | #include "pm.h" | 23 | #include "pm.h" |
24 | 24 | ||
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index 7bb64d8121a7..2c3a2531e678 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c | |||
@@ -18,8 +18,8 @@ | |||
18 | #include <plat/omap-pm.h> | 18 | #include <plat/omap-pm.h> |
19 | #include <plat/omap_device.h> | 19 | #include <plat/omap_device.h> |
20 | #include <plat/common.h> | 20 | #include <plat/common.h> |
21 | #include <plat/voltage.h> | ||
22 | 21 | ||
22 | #include "voltage.h" | ||
23 | #include "powerdomain.h" | 23 | #include "powerdomain.h" |
24 | #include "clockdomain.h" | 24 | #include "clockdomain.h" |
25 | #include "pm.h" | 25 | #include "pm.h" |
diff --git a/arch/arm/mach-omap2/smartreflex.h b/arch/arm/mach-omap2/smartreflex.h index 6568c885f37a..5f35b9e25556 100644 --- a/arch/arm/mach-omap2/smartreflex.h +++ b/arch/arm/mach-omap2/smartreflex.h | |||
@@ -21,7 +21,8 @@ | |||
21 | #define __ASM_ARM_OMAP_SMARTREFLEX_H | 21 | #define __ASM_ARM_OMAP_SMARTREFLEX_H |
22 | 22 | ||
23 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
24 | #include <plat/voltage.h> | 24 | |
25 | #include "voltage.h" | ||
25 | 26 | ||
26 | /* | 27 | /* |
27 | * Different Smartreflex IPs version. The v1 is the 65nm version used in | 28 | * Different Smartreflex IPs version. The v1 is the 65nm version used in |
diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c index a636604961bc..10d3c5ee8018 100644 --- a/arch/arm/mach-omap2/sr_device.c +++ b/arch/arm/mach-omap2/sr_device.c | |||
@@ -23,9 +23,9 @@ | |||
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | 24 | ||
25 | #include <plat/omap_device.h> | 25 | #include <plat/omap_device.h> |
26 | #include <plat/voltage.h> | ||
27 | 26 | ||
28 | #include "smartreflex.h" | 27 | #include "smartreflex.h" |
28 | #include "voltage.h" | ||
29 | #include "control.h" | 29 | #include "control.h" |
30 | #include "pm.h" | 30 | #include "pm.h" |
31 | 31 | ||
diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c index 12be525b8df4..3c9bcdce612b 100644 --- a/arch/arm/mach-omap2/voltage.c +++ b/arch/arm/mach-omap2/voltage.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
27 | 27 | ||
28 | #include <plat/common.h> | 28 | #include <plat/common.h> |
29 | #include <plat/voltage.h> | ||
30 | 29 | ||
31 | #include "prm-regbits-34xx.h" | 30 | #include "prm-regbits-34xx.h" |
32 | #include "prm-regbits-44xx.h" | 31 | #include "prm-regbits-44xx.h" |
@@ -35,6 +34,8 @@ | |||
35 | #include "prminst44xx.h" | 34 | #include "prminst44xx.h" |
36 | #include "control.h" | 35 | #include "control.h" |
37 | 36 | ||
37 | #include "voltage.h" | ||
38 | |||
38 | #define VP_IDLE_TIMEOUT 200 | 39 | #define VP_IDLE_TIMEOUT 200 |
39 | #define VP_TRANXDONE_TIMEOUT 300 | 40 | #define VP_TRANXDONE_TIMEOUT 300 |
40 | #define VOLTAGE_DIR_SIZE 16 | 41 | #define VOLTAGE_DIR_SIZE 16 |
diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h new file mode 100644 index 000000000000..5bd204e55c32 --- /dev/null +++ b/arch/arm/mach-omap2/voltage.h | |||
@@ -0,0 +1,155 @@ | |||
1 | /* | ||
2 | * OMAP Voltage Management Routines | ||
3 | * | ||
4 | * Author: Thara Gopinath <thara@ti.com> | ||
5 | * | ||
6 | * Copyright (C) 2009 Texas Instruments, Inc. | ||
7 | * Thara Gopinath <thara@ti.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #ifndef __ARCH_ARM_MACH_OMAP2_VOLTAGE_H | ||
15 | #define __ARCH_ARM_MACH_OMAP2_VOLTAGE_H | ||
16 | |||
17 | #include <linux/err.h> | ||
18 | |||
19 | #define VOLTSCALE_VPFORCEUPDATE 1 | ||
20 | #define VOLTSCALE_VCBYPASS 2 | ||
21 | |||
22 | /* | ||
23 | * OMAP3 GENERIC setup times. Revisit to see if these needs to be | ||
24 | * passed from board or PMIC file | ||
25 | */ | ||
26 | #define OMAP3_CLKSETUP 0xff | ||
27 | #define OMAP3_VOLTOFFSET 0xff | ||
28 | #define OMAP3_VOLTSETUP2 0xff | ||
29 | |||
30 | /* Voltage value defines */ | ||
31 | #define OMAP3430_VDD_MPU_OPP1_UV 975000 | ||
32 | #define OMAP3430_VDD_MPU_OPP2_UV 1075000 | ||
33 | #define OMAP3430_VDD_MPU_OPP3_UV 1200000 | ||
34 | #define OMAP3430_VDD_MPU_OPP4_UV 1270000 | ||
35 | #define OMAP3430_VDD_MPU_OPP5_UV 1350000 | ||
36 | |||
37 | #define OMAP3430_VDD_CORE_OPP1_UV 975000 | ||
38 | #define OMAP3430_VDD_CORE_OPP2_UV 1050000 | ||
39 | #define OMAP3430_VDD_CORE_OPP3_UV 1150000 | ||
40 | |||
41 | #define OMAP3630_VDD_MPU_OPP50_UV 1012500 | ||
42 | #define OMAP3630_VDD_MPU_OPP100_UV 1200000 | ||
43 | #define OMAP3630_VDD_MPU_OPP120_UV 1325000 | ||
44 | #define OMAP3630_VDD_MPU_OPP1G_UV 1375000 | ||
45 | |||
46 | #define OMAP3630_VDD_CORE_OPP50_UV 1000000 | ||
47 | #define OMAP3630_VDD_CORE_OPP100_UV 1200000 | ||
48 | |||
49 | #define OMAP4430_VDD_MPU_OPP50_UV 930000 | ||
50 | #define OMAP4430_VDD_MPU_OPP100_UV 1100000 | ||
51 | #define OMAP4430_VDD_MPU_OPPTURBO_UV 1260000 | ||
52 | #define OMAP4430_VDD_MPU_OPPNITRO_UV 1350000 | ||
53 | |||
54 | #define OMAP4430_VDD_IVA_OPP50_UV 930000 | ||
55 | #define OMAP4430_VDD_IVA_OPP100_UV 1100000 | ||
56 | #define OMAP4430_VDD_IVA_OPPTURBO_UV 1260000 | ||
57 | |||
58 | #define OMAP4430_VDD_CORE_OPP50_UV 930000 | ||
59 | #define OMAP4430_VDD_CORE_OPP100_UV 1100000 | ||
60 | |||
61 | /** | ||
62 | * struct voltagedomain - omap voltage domain global structure. | ||
63 | * @name: Name of the voltage domain which can be used as a unique | ||
64 | * identifier. | ||
65 | */ | ||
66 | struct voltagedomain { | ||
67 | char *name; | ||
68 | }; | ||
69 | |||
70 | /** | ||
71 | * struct omap_volt_data - Omap voltage specific data. | ||
72 | * @voltage_nominal: The possible voltage value in uV | ||
73 | * @sr_efuse_offs: The offset of the efuse register(from system | ||
74 | * control module base address) from where to read | ||
75 | * the n-target value for the smartreflex module. | ||
76 | * @sr_errminlimit: Error min limit value for smartreflex. This value | ||
77 | * differs at differnet opp and thus is linked | ||
78 | * with voltage. | ||
79 | * @vp_errorgain: Error gain value for the voltage processor. This | ||
80 | * field also differs according to the voltage/opp. | ||
81 | */ | ||
82 | struct omap_volt_data { | ||
83 | u32 volt_nominal; | ||
84 | u32 sr_efuse_offs; | ||
85 | u8 sr_errminlimit; | ||
86 | u8 vp_errgain; | ||
87 | }; | ||
88 | |||
89 | /** | ||
90 | * struct omap_volt_pmic_info - PMIC specific data required by voltage driver. | ||
91 | * @slew_rate: PMIC slew rate (in uv/us) | ||
92 | * @step_size: PMIC voltage step size (in uv) | ||
93 | * @vsel_to_uv: PMIC API to convert vsel value to actual voltage in uV. | ||
94 | * @uv_to_vsel: PMIC API to convert voltage in uV to vsel value. | ||
95 | */ | ||
96 | struct omap_volt_pmic_info { | ||
97 | int slew_rate; | ||
98 | int step_size; | ||
99 | u32 on_volt; | ||
100 | u32 onlp_volt; | ||
101 | u32 ret_volt; | ||
102 | u32 off_volt; | ||
103 | u16 volt_setup_time; | ||
104 | u8 vp_erroroffset; | ||
105 | u8 vp_vstepmin; | ||
106 | u8 vp_vstepmax; | ||
107 | u8 vp_vddmin; | ||
108 | u8 vp_vddmax; | ||
109 | u8 vp_timeout_us; | ||
110 | u8 i2c_slave_addr; | ||
111 | u8 pmic_reg; | ||
112 | unsigned long (*vsel_to_uv) (const u8 vsel); | ||
113 | u8 (*uv_to_vsel) (unsigned long uV); | ||
114 | }; | ||
115 | |||
116 | unsigned long omap_vp_get_curr_volt(struct voltagedomain *voltdm); | ||
117 | void omap_vp_enable(struct voltagedomain *voltdm); | ||
118 | void omap_vp_disable(struct voltagedomain *voltdm); | ||
119 | int omap_voltage_scale_vdd(struct voltagedomain *voltdm, | ||
120 | unsigned long target_volt); | ||
121 | void omap_voltage_reset(struct voltagedomain *voltdm); | ||
122 | void omap_voltage_get_volttable(struct voltagedomain *voltdm, | ||
123 | struct omap_volt_data **volt_data); | ||
124 | struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm, | ||
125 | unsigned long volt); | ||
126 | unsigned long omap_voltage_get_nom_volt(struct voltagedomain *voltdm); | ||
127 | struct dentry *omap_voltage_get_dbgdir(struct voltagedomain *voltdm); | ||
128 | #ifdef CONFIG_PM | ||
129 | int omap_voltage_register_pmic(struct voltagedomain *voltdm, | ||
130 | struct omap_volt_pmic_info *pmic_info); | ||
131 | void omap_change_voltscale_method(struct voltagedomain *voltdm, | ||
132 | int voltscale_method); | ||
133 | /* API to get the voltagedomain pointer */ | ||
134 | struct voltagedomain *omap_voltage_domain_lookup(char *name); | ||
135 | |||
136 | int omap_voltage_late_init(void); | ||
137 | #else | ||
138 | static inline int omap_voltage_register_pmic(struct voltagedomain *voltdm, | ||
139 | struct omap_volt_pmic_info *pmic_info) | ||
140 | { | ||
141 | return -EINVAL; | ||
142 | } | ||
143 | static inline void omap_change_voltscale_method(struct voltagedomain *voltdm, | ||
144 | int voltscale_method) {} | ||
145 | static inline int omap_voltage_late_init(void) | ||
146 | { | ||
147 | return -EINVAL; | ||
148 | } | ||
149 | static inline struct voltagedomain *omap_voltage_domain_lookup(char *name) | ||
150 | { | ||
151 | return ERR_PTR(-EINVAL); | ||
152 | } | ||
153 | #endif | ||
154 | |||
155 | #endif | ||