Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 1 | #include <linux/kernel.h> |
| 2 | #include <linux/init.h> |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 3 | |
| 4 | #include <plat/common.h> |
| 5 | |
| 6 | #include "voltage.h" |
| 7 | #include "vp.h" |
| 8 | #include "prm-regbits-34xx.h" |
| 9 | #include "prm-regbits-44xx.h" |
| 10 | #include "prm44xx.h" |
| 11 | |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 12 | static void vp_latch_vsel(struct voltagedomain *voltdm) |
| 13 | { |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 14 | struct omap_vp_instance *vp = voltdm->vp; |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 15 | u32 vpconfig; |
| 16 | unsigned long uvdc; |
| 17 | char vsel; |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 18 | |
| 19 | uvdc = omap_voltage_get_nom_volt(voltdm); |
| 20 | if (!uvdc) { |
| 21 | pr_warning("%s: unable to find current voltage for vdd_%s\n", |
| 22 | __func__, voltdm->name); |
| 23 | return; |
| 24 | } |
| 25 | |
Kevin Hilman | ce8ebe0 | 2011-03-30 11:01:10 -0700 | [diff] [blame] | 26 | if (!voltdm->pmic || !voltdm->pmic->uv_to_vsel) { |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 27 | pr_warning("%s: PMIC function to convert voltage in uV to" |
| 28 | " vsel not registered\n", __func__); |
| 29 | return; |
| 30 | } |
| 31 | |
Kevin Hilman | ce8ebe0 | 2011-03-30 11:01:10 -0700 | [diff] [blame] | 32 | vsel = voltdm->pmic->uv_to_vsel(uvdc); |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 33 | |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 34 | vpconfig = voltdm->read(vp->vpconfig); |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 35 | vpconfig &= ~(vp->common->vpconfig_initvoltage_mask | |
| 36 | vp->common->vpconfig_initvdd); |
| 37 | vpconfig |= vsel << vp->common->vpconfig_initvoltage_shift; |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 38 | |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 39 | voltdm->write(vpconfig, vp->vpconfig); |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 40 | |
| 41 | /* Trigger initVDD value copy to voltage processor */ |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 42 | voltdm->write((vpconfig | vp->common->vpconfig_initvdd), |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 43 | vp->vpconfig); |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 44 | |
| 45 | /* Clear initVDD copy trigger bit */ |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 46 | voltdm->write(vpconfig, vp->vpconfig); |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | /* Generic voltage init functions */ |
| 50 | void __init omap_vp_init(struct voltagedomain *voltdm) |
| 51 | { |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 52 | struct omap_vp_instance *vp = voltdm->vp; |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 53 | struct omap_vdd_info *vdd = voltdm->vdd; |
| 54 | u32 vp_val; |
| 55 | |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 56 | if (!voltdm->read || !voltdm->write) { |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 57 | pr_err("%s: No read/write API for accessing vdd_%s regs\n", |
| 58 | __func__, voltdm->name); |
| 59 | return; |
| 60 | } |
| 61 | |
| 62 | vp_val = vdd->vp_rt_data.vpconfig_erroroffset | |
| 63 | (vdd->vp_rt_data.vpconfig_errorgain << |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 64 | vp->common->vpconfig_errorgain_shift) | |
| 65 | vp->common->vpconfig_timeouten; |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 66 | voltdm->write(vp_val, vp->vpconfig); |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 67 | |
| 68 | vp_val = ((vdd->vp_rt_data.vstepmin_smpswaittimemin << |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 69 | vp->common->vstepmin_smpswaittimemin_shift) | |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 70 | (vdd->vp_rt_data.vstepmin_stepmin << |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 71 | vp->common->vstepmin_stepmin_shift)); |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 72 | voltdm->write(vp_val, vp->vstepmin); |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 73 | |
| 74 | vp_val = ((vdd->vp_rt_data.vstepmax_smpswaittimemax << |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 75 | vp->common->vstepmax_smpswaittimemax_shift) | |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 76 | (vdd->vp_rt_data.vstepmax_stepmax << |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 77 | vp->common->vstepmax_stepmax_shift)); |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 78 | voltdm->write(vp_val, vp->vstepmax); |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 79 | |
| 80 | vp_val = ((vdd->vp_rt_data.vlimitto_vddmax << |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 81 | vp->common->vlimitto_vddmax_shift) | |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 82 | (vdd->vp_rt_data.vlimitto_vddmin << |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 83 | vp->common->vlimitto_vddmin_shift) | |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 84 | (vdd->vp_rt_data.vlimitto_timeout << |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 85 | vp->common->vlimitto_timeout_shift)); |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 86 | voltdm->write(vp_val, vp->vlimitto); |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 87 | } |
| 88 | |
| 89 | /* VP force update method of voltage scaling */ |
| 90 | int omap_vp_forceupdate_scale(struct voltagedomain *voltdm, |
| 91 | unsigned long target_volt) |
| 92 | { |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 93 | struct omap_vp_instance *vp = voltdm->vp; |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 94 | u32 vpconfig; |
| 95 | u8 target_vsel, current_vsel; |
| 96 | int ret, timeout = 0; |
| 97 | |
| 98 | ret = omap_vc_pre_scale(voltdm, target_volt, &target_vsel, ¤t_vsel); |
| 99 | if (ret) |
| 100 | return ret; |
| 101 | |
| 102 | /* |
| 103 | * Clear all pending TransactionDone interrupt/status. Typical latency |
| 104 | * is <3us |
| 105 | */ |
| 106 | while (timeout++ < VP_TRANXDONE_TIMEOUT) { |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 107 | vp->common->ops->clear_txdone(vp->id); |
| 108 | if (!vp->common->ops->check_txdone(vp->id)) |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 109 | break; |
| 110 | udelay(1); |
| 111 | } |
| 112 | if (timeout >= VP_TRANXDONE_TIMEOUT) { |
| 113 | pr_warning("%s: vdd_%s TRANXDONE timeout exceeded." |
| 114 | "Voltage change aborted", __func__, voltdm->name); |
| 115 | return -ETIMEDOUT; |
| 116 | } |
| 117 | |
| 118 | /* Configure for VP-Force Update */ |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 119 | vpconfig = voltdm->read(vp->vpconfig); |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 120 | vpconfig &= ~(vp->common->vpconfig_initvdd | |
| 121 | vp->common->vpconfig_forceupdate | |
| 122 | vp->common->vpconfig_initvoltage_mask); |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 123 | vpconfig |= ((target_vsel << |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 124 | vp->common->vpconfig_initvoltage_shift)); |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 125 | voltdm->write(vpconfig, vp->vpconfig); |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 126 | |
| 127 | /* Trigger initVDD value copy to voltage processor */ |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 128 | vpconfig |= vp->common->vpconfig_initvdd; |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 129 | voltdm->write(vpconfig, vp->vpconfig); |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 130 | |
| 131 | /* Force update of voltage */ |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 132 | vpconfig |= vp->common->vpconfig_forceupdate; |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 133 | voltdm->write(vpconfig, vp->vpconfig); |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 134 | |
| 135 | /* |
| 136 | * Wait for TransactionDone. Typical latency is <200us. |
| 137 | * Depends on SMPSWAITTIMEMIN/MAX and voltage change |
| 138 | */ |
| 139 | timeout = 0; |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 140 | omap_test_timeout(vp->common->ops->check_txdone(vp->id), |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 141 | VP_TRANXDONE_TIMEOUT, timeout); |
| 142 | if (timeout >= VP_TRANXDONE_TIMEOUT) |
| 143 | pr_err("%s: vdd_%s TRANXDONE timeout exceeded." |
| 144 | "TRANXDONE never got set after the voltage update\n", |
| 145 | __func__, voltdm->name); |
| 146 | |
| 147 | omap_vc_post_scale(voltdm, target_volt, target_vsel, current_vsel); |
| 148 | |
| 149 | /* |
| 150 | * Disable TransactionDone interrupt , clear all status, clear |
| 151 | * control registers |
| 152 | */ |
| 153 | timeout = 0; |
| 154 | while (timeout++ < VP_TRANXDONE_TIMEOUT) { |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 155 | vp->common->ops->clear_txdone(vp->id); |
| 156 | if (!vp->common->ops->check_txdone(vp->id)) |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 157 | break; |
| 158 | udelay(1); |
| 159 | } |
| 160 | |
| 161 | if (timeout >= VP_TRANXDONE_TIMEOUT) |
| 162 | pr_warning("%s: vdd_%s TRANXDONE timeout exceeded while trying" |
| 163 | "to clear the TRANXDONE status\n", |
| 164 | __func__, voltdm->name); |
| 165 | |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 166 | vpconfig = voltdm->read(vp->vpconfig); |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 167 | /* Clear initVDD copy trigger bit */ |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 168 | vpconfig &= ~vp->common->vpconfig_initvdd; |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 169 | voltdm->write(vpconfig, vp->vpconfig); |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 170 | /* Clear force bit */ |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 171 | vpconfig &= ~vp->common->vpconfig_forceupdate; |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 172 | voltdm->write(vpconfig, vp->vpconfig); |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 173 | |
| 174 | return 0; |
| 175 | } |
| 176 | |
| 177 | /** |
| 178 | * omap_vp_get_curr_volt() - API to get the current vp voltage. |
| 179 | * @voltdm: pointer to the VDD. |
| 180 | * |
| 181 | * This API returns the current voltage for the specified voltage processor |
| 182 | */ |
| 183 | unsigned long omap_vp_get_curr_volt(struct voltagedomain *voltdm) |
| 184 | { |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 185 | struct omap_vp_instance *vp = voltdm->vp; |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 186 | u8 curr_vsel; |
| 187 | |
| 188 | if (!voltdm || IS_ERR(voltdm)) { |
| 189 | pr_warning("%s: VDD specified does not exist!\n", __func__); |
| 190 | return 0; |
| 191 | } |
| 192 | |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 193 | if (!voltdm->read) { |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 194 | pr_err("%s: No read API for reading vdd_%s regs\n", |
| 195 | __func__, voltdm->name); |
| 196 | return 0; |
| 197 | } |
| 198 | |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 199 | curr_vsel = voltdm->read(vp->voltage); |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 200 | |
Kevin Hilman | ce8ebe0 | 2011-03-30 11:01:10 -0700 | [diff] [blame] | 201 | if (!voltdm->pmic || !voltdm->pmic->vsel_to_uv) { |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 202 | pr_warning("%s: PMIC function to convert vsel to voltage" |
| 203 | "in uV not registerd\n", __func__); |
| 204 | return 0; |
| 205 | } |
| 206 | |
Kevin Hilman | ce8ebe0 | 2011-03-30 11:01:10 -0700 | [diff] [blame] | 207 | return voltdm->pmic->vsel_to_uv(curr_vsel); |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 208 | } |
| 209 | |
| 210 | /** |
| 211 | * omap_vp_enable() - API to enable a particular VP |
| 212 | * @voltdm: pointer to the VDD whose VP is to be enabled. |
| 213 | * |
| 214 | * This API enables a particular voltage processor. Needed by the smartreflex |
| 215 | * class drivers. |
| 216 | */ |
| 217 | void omap_vp_enable(struct voltagedomain *voltdm) |
| 218 | { |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 219 | struct omap_vp_instance *vp; |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 220 | u32 vpconfig; |
| 221 | |
| 222 | if (!voltdm || IS_ERR(voltdm)) { |
| 223 | pr_warning("%s: VDD specified does not exist!\n", __func__); |
| 224 | return; |
| 225 | } |
| 226 | |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 227 | vp = voltdm->vp; |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 228 | if (!voltdm->read || !voltdm->write) { |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 229 | pr_err("%s: No read/write API for accessing vdd_%s regs\n", |
| 230 | __func__, voltdm->name); |
| 231 | return; |
| 232 | } |
| 233 | |
| 234 | /* If VP is already enabled, do nothing. Return */ |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 235 | if (vp->enabled) |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 236 | return; |
| 237 | |
| 238 | vp_latch_vsel(voltdm); |
| 239 | |
| 240 | /* Enable VP */ |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 241 | vpconfig = voltdm->read(vp->vpconfig); |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 242 | vpconfig |= vp->common->vpconfig_vpenable; |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 243 | voltdm->write(vpconfig, vp->vpconfig); |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 244 | vp->enabled = true; |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 245 | } |
| 246 | |
| 247 | /** |
| 248 | * omap_vp_disable() - API to disable a particular VP |
| 249 | * @voltdm: pointer to the VDD whose VP is to be disabled. |
| 250 | * |
| 251 | * This API disables a particular voltage processor. Needed by the smartreflex |
| 252 | * class drivers. |
| 253 | */ |
| 254 | void omap_vp_disable(struct voltagedomain *voltdm) |
| 255 | { |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 256 | struct omap_vp_instance *vp; |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 257 | u32 vpconfig; |
| 258 | int timeout; |
| 259 | |
| 260 | if (!voltdm || IS_ERR(voltdm)) { |
| 261 | pr_warning("%s: VDD specified does not exist!\n", __func__); |
| 262 | return; |
| 263 | } |
| 264 | |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 265 | vp = voltdm->vp; |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 266 | if (!voltdm->read || !voltdm->write) { |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 267 | pr_err("%s: No read/write API for accessing vdd_%s regs\n", |
| 268 | __func__, voltdm->name); |
| 269 | return; |
| 270 | } |
| 271 | |
| 272 | /* If VP is already disabled, do nothing. Return */ |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 273 | if (!vp->enabled) { |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 274 | pr_warning("%s: Trying to disable VP for vdd_%s when" |
| 275 | "it is already disabled\n", __func__, voltdm->name); |
| 276 | return; |
| 277 | } |
| 278 | |
| 279 | /* Disable VP */ |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 280 | vpconfig = voltdm->read(vp->vpconfig); |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 281 | vpconfig &= ~vp->common->vpconfig_vpenable; |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 282 | voltdm->write(vpconfig, vp->vpconfig); |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 283 | |
| 284 | /* |
| 285 | * Wait for VP idle Typical latency is <2us. Maximum latency is ~100us |
| 286 | */ |
Kevin Hilman | 4bcc475 | 2011-03-28 10:40:15 -0700 | [diff] [blame] | 287 | omap_test_timeout((voltdm->read(vp->vstatus)), |
| 288 | VP_IDLE_TIMEOUT, timeout); |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 289 | |
| 290 | if (timeout >= VP_IDLE_TIMEOUT) |
| 291 | pr_warning("%s: vdd_%s idle timedout\n", |
| 292 | __func__, voltdm->name); |
| 293 | |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 294 | vp->enabled = false; |
Kevin Hilman | 01f48d3 | 2011-03-21 14:29:13 -0700 | [diff] [blame] | 295 | |
| 296 | return; |
| 297 | } |