summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorVishal Singh <vissingh@nvidia.com>2012-04-27 18:10:33 +0530
committerSimone Willett <swillett@nvidia.com>2012-05-15 15:12:15 -0700
commitb21def416c5850657ea7a366b8eb5dbb3a562452 (patch)
tree236d354654cdb15df3084e8a5668c9f298b9bd8e /drivers/mmc
parent4c5a8859490c249ce8a7310f04053d5a4741833f (diff)
mmc: enable background ops in driver
Adding a new config option and enabling background ops in driver. Correcting the EXT_CSD byte that needs to be written in order to trigger background ops in the MMC firmware. Bug 847037. Change-Id: Ibc517540cab43fa5070b142a416f6b67f2f7e7be Signed-off-by: Vishal Singh <vissingh@nvidia.com> Reviewed-on: http://git-master/r/99117 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/card/Kconfig10
-rw-r--r--drivers/mmc/core/mmc_ops.c2
-rw-r--r--drivers/mmc/host/sdhci-tegra.c5
3 files changed, 16 insertions, 1 deletions
diff --git a/drivers/mmc/card/Kconfig b/drivers/mmc/card/Kconfig
index ebb4afe6c702..3875c21e04fa 100644
--- a/drivers/mmc/card/Kconfig
+++ b/drivers/mmc/card/Kconfig
@@ -76,3 +76,13 @@ config MMC_TEST
This driver is only of interest to those developing or
testing a host driver. Most people should say N here.
+
+config MMC_BKOPS
+ bool "Enable background ops"
+ default n
+ help
+ Say Y here to enable background ops in driver. This will result
+ in issuing of MMC_SWITCH command to write byte 164 of EXT_CSD,
+ in order to trigger background ops in the MMC device's
+ firmware, whenever URGENT_BKOPS flag is found to be set in a
+ read/write command's response.
diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
index 330b968393d6..28bed97ae1a5 100644
--- a/drivers/mmc/core/mmc_ops.c
+++ b/drivers/mmc/core/mmc_ops.c
@@ -588,7 +588,7 @@ int mmc_send_bk_ops_cmd(struct mmc_card *card, bool is_synchronous)
cmd.opcode = MMC_SWITCH;
cmd.arg = (MMC_SWITCH_MODE_WRITE_BYTE << 24) |
- (EXT_CSD_BKOPS_EN << 16) |
+ (EXT_CSD_BKOPS_START << 16) |
(1 << 8) |
EXT_CSD_CMD_SET_NORMAL;
if (is_synchronous)
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index 9bbec43dda99..8fec147471a8 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -1122,6 +1122,11 @@ static int __devinit sdhci_tegra_probe(struct platform_device *pdev)
host->mmc->caps |= MMC_CAP_NONREMOVABLE;
}
host->mmc->pm_flags |= MMC_PM_IGNORE_PM_NOTIFY;
+
+#ifdef CONFIG_MMC_BKOPS
+ host->mmc->caps |= MMC_CAP_BKOPS;
+#endif
+
#ifdef CONFIG_MMC_EMBEDDED_SDIO
/* Do not turn OFF embedded sdio cards as it support Wake on Wireless */
if (plat->mmc_data.embedded_sdio)