Lines Matching refs:voltdm

47  * @voltdm:	pointer to the voltdm for which current voltage info is needed
52 unsigned long voltdm_get_voltage(struct voltagedomain *voltdm)
54 if (!voltdm || IS_ERR(voltdm)) {
59 return voltdm->nominal_volt;
64 * @voltdm: pointer to the voltage domain which is to be scaled.
70 static int voltdm_scale(struct voltagedomain *voltdm,
76 if (!voltdm || IS_ERR(voltdm)) {
81 if (!voltdm->scale) {
83 __func__, voltdm->name);
87 if (!voltdm->volt_data) {
89 __func__, voltdm->name);
94 for (i = 0; voltdm->volt_data[i].volt_nominal != 0; i++) {
95 if (voltdm->volt_data[i].volt_nominal >= target_volt) {
96 volt = voltdm->volt_data[i].volt_nominal;
107 ret = voltdm->scale(voltdm, volt);
109 voltdm->nominal_volt = volt;
117 * @voltdm: pointer to the voltage domain whose voltage is to be reset.
123 void voltdm_reset(struct voltagedomain *voltdm)
127 if (!voltdm || IS_ERR(voltdm)) {
132 target_volt = voltdm_get_voltage(voltdm);
135 __func__, voltdm->name);
139 voltdm_scale(voltdm, target_volt);
145 * @voltdm: pointer to the VDD for which the voltage table is required
154 void omap_voltage_get_volttable(struct voltagedomain *voltdm,
157 if (!voltdm || IS_ERR(voltdm)) {
162 *volt_data = voltdm->volt_data;
168 * @voltdm: pointer to the VDD whose voltage table has to be searched
180 struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm,
185 if (!voltdm || IS_ERR(voltdm)) {
190 if (!voltdm->volt_data) {
192 __func__, voltdm->name);
196 for (i = 0; voltdm->volt_data[i].volt_nominal != 0; i++) {
197 if (voltdm->volt_data[i].volt_nominal == volt)
198 return &voltdm->volt_data[i];
202 __func__, voltdm->name);
209 * @voltdm: pointer to the VDD for which the PMIC specific data is
216 int omap_voltage_register_pmic(struct voltagedomain *voltdm,
219 if (!voltdm || IS_ERR(voltdm)) {
224 voltdm->pmic = pmic;
238 struct voltagedomain *voltdm;
246 list_for_each_entry(voltdm, &voltdm_list, node) {
249 if (!voltdm->scalable)
252 sys_ck = clk_get(NULL, voltdm->sys_clk.name);
257 voltdm->sys_clk.rate = clk_get_rate(sys_ck);
258 WARN_ON(!voltdm->sys_clk.rate);
261 if (voltdm->vc) {
262 voltdm->scale = omap_vc_bypass_scale;
263 omap_vc_init_channel(voltdm);
266 if (voltdm->vp) {
267 voltdm->scale = omap_vp_forceupdate_scale;
268 omap_vp_init(voltdm);
277 struct voltagedomain *voltdm, *temp_voltdm;
279 voltdm = NULL;
283 voltdm = temp_voltdm;
288 return voltdm;
291 static int _voltdm_register(struct voltagedomain *voltdm)
293 if (!voltdm || !voltdm->name)
296 list_add(&voltdm->node, &voltdm_list);
298 pr_debug("voltagedomain: registered %s\n", voltdm->name);
312 struct voltagedomain *voltdm ;
317 voltdm = _voltdm_lookup(name);
319 return voltdm;