summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJeetesh Burman <jburman@nvidia.com>2015-06-18 11:20:20 +0530
committerWinnie Hsu <whsu@nvidia.com>2015-06-18 15:07:02 -0700
commit85d31bca627a4c2027d124a4efa807e3fbf5d4d0 (patch)
tree02588706f3e808b1fcccb79ddc18fd1a189dad9f /drivers
parent936b87435df999e93e6cf7d09bbb988761bcd8e9 (diff)
Revert "mmc: tegra: Use 100000 precision instead of 1000"
This reverts commit 3c5f4d1060669ec73dc0ceb4e9a876a55a89c5eb. Signed-off-by: Jeetesh Burman <jburman@nvidia.com> Change-Id: Ic0e3eb4bb892e69dbd808c1d55721290c561ac7c Reviewed-on: http://git-master/r/759475 GVS: Gerrit_Virtual_Submit Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/sdhci-tegra.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index 6f2b566a1b67..30a44e832155 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -228,7 +228,6 @@
#define TUNING_RETRIES 1
#define DFS_FREQ_COUNT 2
#define NEG_MAR_CHK_WIN_COUNT 2
-#define PRECISION_FOR_ESTIMATE 100000
/* Tuning core voltage requirements */
#define NOMINAL_VCORE_TUN BIT(0)
#define BOOT_VCORE_TUN BIT(1)
@@ -2316,22 +2315,19 @@ static int calculate_estimated_tuning_values(int speedo,
} else if (voltage_mv == t2t_coeffs->vmax) {
est_values->t2t_vmax = vmax_t2t;
} else {
- vmax_t2t = PRECISION_FOR_ESTIMATE / vmax_t2t;
- vmin_t2t = PRECISION_FOR_ESTIMATE / vmin_t2t;
+ vmax_t2t = 1000 / vmax_t2t;
+ vmin_t2t = 1000 / vmin_t2t;
/*
- * For any intermediate voltage between 0.95V and max vcore,
+ * For any intermediate voltage between 0.95V and 1.25V,
* calculate the slope and intercept from the T2T and tap hole
- * values of 0.95V and max vcore and use them to calculate the
+ * values of 0.95V and 1.25V and use them to calculate the
* actual values. 1/T2T is a linear function of voltage.
*/
- slope = ((vmax_t2t - vmin_t2t) * PRECISION_FOR_ESTIMATE) /
- (t2t_coeffs->vmax - t2t_coeffs->vmin);
- inpt = (vmax_t2t * PRECISION_FOR_ESTIMATE -
- (slope * t2t_coeffs->vmax)) / PRECISION_FOR_ESTIMATE;
- est_values->t2t_vmax = ((slope * voltage_mv) /
- PRECISION_FOR_ESTIMATE + inpt);
- est_values->t2t_vmax = (PRECISION_FOR_ESTIMATE /
- est_values->t2t_vmax);
+ slope = ((vmax_t2t - vmin_t2t) * 1000) /
+ (t2t_coeffs->vmax - t2t_coeffs->vmin);
+ inpt = (vmax_t2t * 1000 - (slope * t2t_coeffs->vmax)) / 1000;
+ est_values->t2t_vmax = (slope * voltage_mv) / 1000 + inpt;
+ est_values->t2t_vmax = (1000 / est_values->t2t_vmax);
}
/* Est_UI = (1000000/freq_MHz)/Est_T2T_Vmax */
@@ -2352,17 +2348,15 @@ static int calculate_estimated_tuning_values(int speedo,
est_values->vmax_thole = vmax_thole;
} else {
/*
- * For any intermediate voltage between 0.95V and max vcore,
+ * For any intermediate voltage between 0.95V and 1.25V,
* calculate the slope and intercept from the t2t and tap hole
- * values of 0.95V and max vcore and use them to calculate the
+ * values of 0.95V and 1.25V and use them to calculate the
* actual values. Tap hole is a linear function of voltage.
*/
- slope = ((vmax_thole - vmin_thole) * PRECISION_FOR_ESTIMATE) /
- (t2t_coeffs->vmax - t2t_coeffs->vmin);
- inpt = (vmax_thole * PRECISION_FOR_ESTIMATE -
- (slope * t2t_coeffs->vmax)) / PRECISION_FOR_ESTIMATE;
- est_values->vmax_thole = (slope * voltage_mv) /
- PRECISION_FOR_ESTIMATE + inpt;
+ slope = ((vmax_thole - vmin_thole) * 1000) /
+ (t2t_coeffs->vmax - t2t_coeffs->vmin);
+ inpt = (vmax_thole * 1000 - (slope * t2t_coeffs->vmax)) / 1000;
+ est_values->vmax_thole = (slope * voltage_mv) / 1000 + inpt;
}
est_values->vmin_thole = vmin_thole;