sdhci: tegra: Add option to use 3.2V input voltage.
Sumeet Gupta [Wed, 2 Jan 2013 07:19:31 +0000 (12:19 +0530)]
Bug 1187691

Change-Id: I01dbd648e3fa8264b5e8706ccef49ac88b8bb106
Signed-off-by: Sumeet Gupta <sumeetg@nvidia.com>
Reviewed-on: http://git-master/r/187928
(cherry picked from commit a0dbcca0706d94c00ca472e029b94003d2db98ac)
Reviewed-on: http://git-master/r/194583
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

drivers/mmc/host/sdhci-tegra.c
include/linux/platform_data/mmc-sdhci-tegra.h

index d09de32..723f17a 100644 (file)
@@ -82,6 +82,7 @@
 #define SDHOST_HIGH_VOLT_2V8   2800000
 #define SDHOST_LOW_VOLT_MIN    1800000
 #define SDHOST_LOW_VOLT_MAX    1800000
+#define SDHOST_HIGH_VOLT_3V2   3200000
 
 #define TEGRA_SDHOST_MIN_FREQ  50000000
 #define TEGRA2_SDHOST_STD_FREQ 50000000
@@ -1370,6 +1371,8 @@ static struct tegra_sdhci_platform_data *sdhci_tegra_dt_parse_pdata(
                        plat->mmc_data.ocr_mask = MMC_OCR_1V8_MASK;
                else if (val == 1)
                        plat->mmc_data.ocr_mask = MMC_OCR_2V8_MASK;
+               else if (val == 2)
+                       plat->mmc_data.ocr_mask = MMC_OCR_3V2_MASK;
        }
        return plat;
 }
@@ -1503,6 +1506,9 @@ static int sdhci_tegra_probe(struct platform_device *pdev)
        } else if (plat->mmc_data.ocr_mask & MMC_OCR_2V8_MASK) {
                        tegra_host->vddio_min_uv = SDHOST_HIGH_VOLT_2V8;
                        tegra_host->vddio_max_uv = SDHOST_HIGH_VOLT_MAX;
+       } else if (plat->mmc_data.ocr_mask & MMC_OCR_3V2_MASK) {
+                       tegra_host->vddio_min_uv = SDHOST_HIGH_VOLT_3V2;
+                       tegra_host->vddio_max_uv = SDHOST_HIGH_VOLT_MAX;
        } else {
                /*
                 * Set the minV and maxV to default
index 87ac1be..06d969b 100644 (file)
@@ -2,6 +2,8 @@
  * Copyright (C) 2009 Palm, Inc.
  * Author: Yvonne Yip <y@palm.com>
  *
+ * Copyright (c) 2012-13, NVIDIA CORPORATION.
+ *
  * This software is licensed under the terms of the GNU General Public
  * License version 2, as published by the Free Software Foundation, and
  * may be copied, distributed, and modified under those terms.
@@ -26,6 +28,7 @@
  */
 #define MMC_OCR_1V8_MASK    0x00000008
 #define MMC_OCR_2V8_MASK    0x00010000
+#define MMC_OCR_3V2_MASK    0x00200000
 
 /* uhs mask can be used to mask any of the UHS modes support */
 #define MMC_UHS_MASK_SDR25     1