2 * OMAP Voltage Management Routines
4 * Author: Thara Gopinath <thara@ti.com>
6 * Copyright (C) 2009 Texas Instruments, Inc.
7 * Thara Gopinath <thara@ti.com>
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.
14 #ifndef __ARCH_ARM_MACH_OMAP2_VOLTAGE_H
15 #define __ARCH_ARM_MACH_OMAP2_VOLTAGE_H
17 #include <linux/err.h>
19 #define VOLTSCALE_VPFORCEUPDATE 1
20 #define VOLTSCALE_VCBYPASS 2
23 * OMAP3 GENERIC setup times. Revisit to see if these needs to be
24 * passed from board or PMIC file
26 #define OMAP3_CLKSETUP 0xff
27 #define OMAP3_VOLTOFFSET 0xff
28 #define OMAP3_VOLTSETUP2 0xff
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
37 #define OMAP3430_VDD_CORE_OPP1_UV 975000
38 #define OMAP3430_VDD_CORE_OPP2_UV 1050000
39 #define OMAP3430_VDD_CORE_OPP3_UV 1150000
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
46 #define OMAP3630_VDD_CORE_OPP50_UV 1000000
47 #define OMAP3630_VDD_CORE_OPP100_UV 1200000
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
54 #define OMAP4430_VDD_IVA_OPP50_UV 930000
55 #define OMAP4430_VDD_IVA_OPP100_UV 1100000
56 #define OMAP4430_VDD_IVA_OPPTURBO_UV 1260000
58 #define OMAP4430_VDD_CORE_OPP50_UV 930000
59 #define OMAP4430_VDD_CORE_OPP100_UV 1100000
62 * struct voltagedomain - omap voltage domain global structure.
63 * @name: Name of the voltage domain which can be used as a unique
66 struct voltagedomain {
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
79 * @vp_errorgain: Error gain value for the voltage processor. This
80 * field also differs according to the voltage/opp.
82 struct omap_volt_data {
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.
96 struct omap_volt_pmic_info {
112 unsigned long (*vsel_to_uv) (const u8 vsel);
113 u8 (*uv_to_vsel) (unsigned long uV);
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,
126 unsigned long omap_voltage_get_nom_volt(struct voltagedomain *voltdm);
127 struct dentry *omap_voltage_get_dbgdir(struct voltagedomain *voltdm);
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);
136 int omap_voltage_late_init(void);
138 static inline int omap_voltage_register_pmic(struct voltagedomain *voltdm,
139 struct omap_volt_pmic_info *pmic_info)
143 static inline void omap_change_voltscale_method(struct voltagedomain *voltdm,
144 int voltscale_method) {}
145 static inline int omap_voltage_late_init(void)
149 static inline struct voltagedomain *omap_voltage_domain_lookup(char *name)
151 return ERR_PTR(-EINVAL);