summaryrefslogtreecommitdiff
path: root/drivers/mmc/host
diff options
context:
space:
mode:
authorJeetesh Burman <jburman@nvidia.com>2015-06-18 11:19:27 +0530
committerWinnie Hsu <whsu@nvidia.com>2015-06-18 15:06:09 -0700
commitc733bffbc54e150312334ea74a5e741e04767720 (patch)
tree4c8d8e0a4ca3b225fa35d40a7fb6ab84cab030f2 /drivers/mmc/host
parentf4b7cea52cbb840d56154ab41772964773a728f1 (diff)
Revert "mmc: tegra: select fixed tap hole margin values"
This reverts commit 8eadba170693964dc30b1e6ab0a80df012858bc0. Signed-off-by: Jeetesh Burman <jburman@nvidia.com> Change-Id: Icd990d1e9c8df4c66c46e7e29a03cc6233e206bd Reviewed-on: http://git-master/r/759473 GVS: Gerrit_Virtual_Submit Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r--drivers/mmc/host/sdhci-tegra.c66
1 files changed, 31 insertions, 35 deletions
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index 18243806212b..add1615a2c9f 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -44,7 +44,6 @@
#include <linux/devfreq.h>
#include <linux/clk/tegra.h>
#include <linux/tegra-soc.h>
-#include <linux/tegra-fuse.h>
#include <linux/platform_data/mmc-sdhci-tegra.h>
#include <mach/pinmux.h>
@@ -1928,6 +1927,9 @@ static int slide_window_start(struct sdhci_host *sdhci,
struct tegra_tuning_data *tuning_data,
int tap_value, enum tap_win_edge_attr edge_attr, int tap_hole)
{
+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(sdhci);
+ struct sdhci_tegra *tegra_host = pltfm_host->priv;
+ const struct sdhci_tegra_soc_data *soc_data = tegra_host->soc_data;
int tap_margin = 0;
if (edge_attr == WIN_EDGE_BOUN_START) {
@@ -1937,8 +1939,12 @@ static int slide_window_start(struct sdhci_host *sdhci,
tap_value += (1000 / tuning_data->calc_values.t2t_vmax);
} else if (edge_attr == WIN_EDGE_HOLE) {
if (tap_hole >= 0) {
- tap_margin = get_tuning_tap_hole_margins(sdhci,
- tuning_data->calc_values.t2t_vmax);
+ if (soc_data->nvquirks & NVQUIRK_TMP_VAR_1_5_TAP_MARGIN)
+ tap_margin = 2;
+ else
+ tap_margin = (((2 * (450 /
+ tuning_data->calc_values.t2t_vmax)) +
+ 1) / 2);
tap_value += ((7 * tap_hole) / 100) + tap_margin;
}
}
@@ -1953,6 +1959,9 @@ static int slide_window_end(struct sdhci_host *sdhci,
struct tegra_tuning_data *tuning_data,
int tap_value, enum tap_win_edge_attr edge_attr, int tap_hole)
{
+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(sdhci);
+ struct sdhci_tegra *tegra_host = pltfm_host->priv;
+ const struct sdhci_tegra_soc_data *soc_data = tegra_host->soc_data;
int tap_margin = 0;
if (edge_attr == WIN_EDGE_BOUN_END) {
@@ -1962,8 +1971,12 @@ static int slide_window_end(struct sdhci_host *sdhci,
} else if (edge_attr == WIN_EDGE_HOLE) {
if (tap_hole >= 0) {
tap_value = tap_hole;
- tap_margin = get_tuning_tap_hole_margins(sdhci,
- tuning_data->calc_values.t2t_vmin);
+ if (soc_data->nvquirks & NVQUIRK_TMP_VAR_1_5_TAP_MARGIN)
+ tap_margin = 2;
+ else
+ tap_margin = (((2 * (450 /
+ tuning_data->calc_values.t2t_vmin)) +
+ 1) / 2);
}
tap_value -= ((7 * tap_hole) / 100) + tap_margin;
}
@@ -2865,18 +2878,21 @@ static int get_tuning_tap_hole_margins(struct sdhci_host *sdhci,
int i;
int tap_margin = 0;
- if (soc_data->nvquirks & NVQUIRK_SELECT_FIXED_TAP_HOLE_MARGINS &&
- soc_data->tap_hole_margins) {
- tap_hole = soc_data->tap_hole_margins;
- dev_id = dev_name(mmc_dev(sdhci->mmc));
- for (i = 0; i < soc_data->tap_hole_margins_count; i++) {
- if (!strcmp(dev_id, tap_hole->dev_id))
- return tap_hole->tap_hole_margin;
- tap_hole++;
+ if (soc_data->nvquirks & NVQUIRK_SELECT_FIXED_TAP_HOLE_MARGINS) {
+ if (soc_data->tap_hole_margins) {
+ tap_hole = soc_data->tap_hole_margins;
+ dev_id = dev_name(mmc_dev(sdhci->mmc));
+ for (i = 0; i < soc_data->tap_hole_margins_count; i++) {
+ if (!strcmp(dev_id, tap_hole->dev_id))
+ return tap_hole->tap_hole_margin;
+ tap_hole++;
+ }
+ } else {
+ dev_info(mmc_dev(sdhci->mmc),
+ "Fixed tap hole margins missing\n");
}
}
- dev_info(mmc_dev(sdhci->mmc),
- "Tap hole margins missing\n");
+
/* if no margin are available calculate tap margin */
tap_margin = (((2 * (450 / t2t_tuning_value)) +
1) / 2);
@@ -4388,26 +4404,6 @@ static int sdhci_tegra_probe(struct platform_device *pdev)
tegra_host->tap_cmd = TAP_CMD_TRIM_DEFAULT_VOLTAGE;
tegra_host->speedo = plat->cpu_speedo;
dev_info(mmc_dev(host->mmc), "Speedo value %d\n", tegra_host->speedo);
-
- /* update t2t and tap_hole for automotive speedo */
- if (tegra_is_soc_automotive_speedo() &&
- (soc_data == &soc_data_tegra12)) {
- soc_data_tegra12.t2t_coeffs = t12x_automotive_tuning_coeffs;
- soc_data_tegra12.t2t_coeffs_count =
- ARRAY_SIZE(t12x_automotive_tuning_coeffs);
- soc_data_tegra12.tap_hole_coeffs =
- t12x_automotive_tap_hole_coeffs;
- soc_data_tegra12.tap_hole_coeffs_count =
- ARRAY_SIZE(t12x_automotive_tap_hole_coeffs);
- /* For automotive SDR50 mode POR frequency is 99Mhz */
- soc_data_tegra12.tuning_freq_list[0] = 99000000;
- soc_data_tegra12.nvquirks |=
- NVQUIRK_SELECT_FIXED_TAP_HOLE_MARGINS;
- soc_data_tegra12.tap_hole_margins =
- t12x_automotive_tap_hole_margins;
- soc_data_tegra12.tap_hole_margins_count =
- ARRAY_SIZE(t12x_automotive_tap_hole_margins);
- }
host->mmc->pm_caps |= plat->pm_caps;
host->mmc->pm_flags |= plat->pm_flags;