aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/voltage.h
diff options
context:
space:
mode:
authorKevin Hilman <khilman@ti.com>2011-03-16 17:25:45 -0400
committerKevin Hilman <khilman@ti.com>2011-09-15 14:39:09 -0400
commit81a604823797ddb3aaf2a78cc1c6a1fa8f4d200c (patch)
tree68e8c9f006b9e1b3349fa1d28bba02501b15c872 /arch/arm/mach-omap2/voltage.h
parentc39263c33f9c94443aa9fc4fc2b1f1191666fccd (diff)
OMAP2+: voltage: start towards a new voltagedomain layer
Start cleaning up the voltage layer to have a voltage domain layer that resembles the structure of the existing clock and power domain layers. To that end: - move the 'struct voltagedomain' out of 'struct omap_vdd_info' to become the primary data structure. - convert any functions taking a pointer to struct omap_vdd_info into functions taking a struct voltagedomain pointer. - convert the register & initialize of voltage domains to look like that of powerdomains - convert omap_voltage_domain_lookup() to voltdm_lookup(), modeled after the current powerdomain and clockdomain lookup functions. - omap_voltage_late_init(): only configure VDD info when the vdd_info struct is non-NULL Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/voltage.h')
-rw-r--r--arch/arm/mach-omap2/voltage.h27
1 files changed, 13 insertions, 14 deletions
diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h
index db23d493f66..54402989626 100644
--- a/arch/arm/mach-omap2/voltage.h
+++ b/arch/arm/mach-omap2/voltage.h
@@ -31,6 +31,8 @@
31#define OMAP3_VOLTOFFSET 0xff 31#define OMAP3_VOLTOFFSET 0xff
32#define OMAP3_VOLTSETUP2 0xff 32#define OMAP3_VOLTSETUP2 0xff
33 33
34struct omap_vdd_info;
35
34/** 36/**
35 * struct omap_vfsm_instance_data - per-voltage manager FSM register/bitfield 37 * struct omap_vfsm_instance_data - per-voltage manager FSM register/bitfield
36 * data 38 * data
@@ -50,11 +52,14 @@ struct omap_vfsm_instance_data {
50 52
51/** 53/**
52 * struct voltagedomain - omap voltage domain global structure. 54 * struct voltagedomain - omap voltage domain global structure.
53 * @name: Name of the voltage domain which can be used as a unique 55 * @name: Name of the voltage domain which can be used as a unique identifier.
54 * identifier. 56 * @node: list_head linking all voltage domains
57 * @vdd: to be removed
55 */ 58 */
56struct voltagedomain { 59struct voltagedomain {
57 char *name; 60 char *name;
61 struct list_head node;
62 struct omap_vdd_info *vdd;
58}; 63};
59 64
60/** 65/**
@@ -116,7 +121,6 @@ struct omap_volt_pmic_info {
116 * @vc_data : structure containing various various vc registers, 121 * @vc_data : structure containing various various vc registers,
117 * shifts, masks etc. 122 * shifts, masks etc.
118 * @vfsm : voltage manager FSM data 123 * @vfsm : voltage manager FSM data
119 * @voltdm : pointer to the voltage domain structure
120 * @debug_dir : debug directory for this voltage domain. 124 * @debug_dir : debug directory for this voltage domain.
121 * @curr_volt : current voltage for this vdd. 125 * @curr_volt : current voltage for this vdd.
122 * @prm_irqst_mod : PRM module id used for PRM IRQ status register access 126 * @prm_irqst_mod : PRM module id used for PRM IRQ status register access
@@ -130,7 +134,6 @@ struct omap_vdd_info {
130 struct omap_vp_runtime_data vp_rt_data; 134 struct omap_vp_runtime_data vp_rt_data;
131 struct omap_vc_instance_data *vc_data; 135 struct omap_vc_instance_data *vc_data;
132 const struct omap_vfsm_instance_data *vfsm; 136 const struct omap_vfsm_instance_data *vfsm;
133 struct voltagedomain voltdm;
134 struct dentry *debug_dir; 137 struct dentry *debug_dir;
135 u32 curr_volt; 138 u32 curr_volt;
136 bool vp_enabled; 139 bool vp_enabled;
@@ -139,7 +142,7 @@ struct omap_vdd_info {
139 u8 prm_irqst_reg; 142 u8 prm_irqst_reg;
140 u32 (*read_reg) (u16 mod, u8 offset); 143 u32 (*read_reg) (u16 mod, u8 offset);
141 void (*write_reg) (u32 val, u16 mod, u8 offset); 144 void (*write_reg) (u32 val, u16 mod, u8 offset);
142 int (*volt_scale) (struct omap_vdd_info *vdd, 145 int (*volt_scale) (struct voltagedomain *voltdm,
143 unsigned long target_volt); 146 unsigned long target_volt);
144}; 147};
145 148
@@ -155,16 +158,11 @@ struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm,
155 unsigned long volt); 158 unsigned long volt);
156unsigned long omap_voltage_get_nom_volt(struct voltagedomain *voltdm); 159unsigned long omap_voltage_get_nom_volt(struct voltagedomain *voltdm);
157struct dentry *omap_voltage_get_dbgdir(struct voltagedomain *voltdm); 160struct dentry *omap_voltage_get_dbgdir(struct voltagedomain *voltdm);
158int __init omap_voltage_early_init(struct omap_vdd_info *omap_vdd_array[],
159 u8 omap_vdd_count);
160#ifdef CONFIG_PM 161#ifdef CONFIG_PM
161int omap_voltage_register_pmic(struct voltagedomain *voltdm, 162int omap_voltage_register_pmic(struct voltagedomain *voltdm,
162 struct omap_volt_pmic_info *pmic_info); 163 struct omap_volt_pmic_info *pmic_info);
163void omap_change_voltscale_method(struct voltagedomain *voltdm, 164void omap_change_voltscale_method(struct voltagedomain *voltdm,
164 int voltscale_method); 165 int voltscale_method);
165/* API to get the voltagedomain pointer */
166struct voltagedomain *omap_voltage_domain_lookup(char *name);
167
168int omap_voltage_late_init(void); 166int omap_voltage_late_init(void);
169#else 167#else
170static inline int omap_voltage_register_pmic(struct voltagedomain *voltdm, 168static inline int omap_voltage_register_pmic(struct voltagedomain *voltdm,
@@ -178,10 +176,11 @@ static inline int omap_voltage_late_init(void)
178{ 176{
179 return -EINVAL; 177 return -EINVAL;
180} 178}
181static inline struct voltagedomain *omap_voltage_domain_lookup(char *name)
182{
183 return ERR_PTR(-EINVAL);
184}
185#endif 179#endif
186 180
181extern void omap3xxx_voltagedomains_init(void);
182extern void omap44xx_voltagedomains_init(void);
183
184struct voltagedomain *voltdm_lookup(const char *name);
185void voltdm_init(struct voltagedomain **voltdm_list);
187#endif 186#endif