aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2013-06-13 04:50:27 -0400
committerChris Ball <cjb@laptop.org>2013-07-05 12:46:25 -0400
commitb04fa064e72c301e075c2d52c146282f8f464083 (patch)
tree2cf681690ba40dfe4bb5836678f754790cf7bb28
parentc9faff6cbb3d2b37b3aa356ce455848f91685b24 (diff)
mmc: sdhci-acpi: add support for eMMC hardware reset for HID 80860F14
Add support for eMMC hardware reset for HID 80860F14. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r--drivers/mmc/host/sdhci-acpi.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index 08a85ec33224..cdd4ce0d7c90 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -37,6 +37,7 @@
37#include <linux/acpi_gpio.h> 37#include <linux/acpi_gpio.h>
38#include <linux/pm.h> 38#include <linux/pm.h>
39#include <linux/pm_runtime.h> 39#include <linux/pm_runtime.h>
40#include <linux/delay.h>
40 41
41#include <linux/mmc/host.h> 42#include <linux/mmc/host.h>
42#include <linux/mmc/pm.h> 43#include <linux/mmc/pm.h>
@@ -85,12 +86,37 @@ static int sdhci_acpi_enable_dma(struct sdhci_host *host)
85 return 0; 86 return 0;
86} 87}
87 88
89static void sdhci_acpi_int_hw_reset(struct sdhci_host *host)
90{
91 u8 reg;
92
93 reg = sdhci_readb(host, SDHCI_POWER_CONTROL);
94 reg |= 0x10;
95 sdhci_writeb(host, reg, SDHCI_POWER_CONTROL);
96 /* For eMMC, minimum is 1us but give it 9us for good measure */
97 udelay(9);
98 reg &= ~0x10;
99 sdhci_writeb(host, reg, SDHCI_POWER_CONTROL);
100 /* For eMMC, minimum is 200us but give it 300us for good measure */
101 usleep_range(300, 1000);
102}
103
88static const struct sdhci_ops sdhci_acpi_ops_dflt = { 104static const struct sdhci_ops sdhci_acpi_ops_dflt = {
89 .enable_dma = sdhci_acpi_enable_dma, 105 .enable_dma = sdhci_acpi_enable_dma,
90}; 106};
91 107
108static const struct sdhci_ops sdhci_acpi_ops_int = {
109 .enable_dma = sdhci_acpi_enable_dma,
110 .hw_reset = sdhci_acpi_int_hw_reset,
111};
112
113static const struct sdhci_acpi_chip sdhci_acpi_chip_int = {
114 .ops = &sdhci_acpi_ops_int,
115};
116
92static const struct sdhci_acpi_slot sdhci_acpi_slot_int_emmc = { 117static const struct sdhci_acpi_slot sdhci_acpi_slot_int_emmc = {
93 .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE, 118 .chip = &sdhci_acpi_chip_int,
119 .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE | MMC_CAP_HW_RESET,
94 .caps2 = MMC_CAP2_HC_ERASE_SZ, 120 .caps2 = MMC_CAP2_HC_ERASE_SZ,
95 .flags = SDHCI_ACPI_RUNTIME_PM, 121 .flags = SDHCI_ACPI_RUNTIME_PM,
96}; 122};