aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r--drivers/mmc/host/mmci.c178
-rw-r--r--drivers/mmc/host/mmci.h15
-rw-r--r--drivers/mmc/host/s3cmci.c4
-rw-r--r--drivers/mmc/host/sdhci-tegra.c1
-rw-r--r--drivers/mmc/host/sh_mmcif.c5
-rw-r--r--drivers/mmc/host/tmio_mmc_pio.c5
6 files changed, 137 insertions, 71 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index bdfd05517dd5..983e244eca76 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -53,6 +53,8 @@ static unsigned int fmax = 515633;
53 * @sdio: variant supports SDIO 53 * @sdio: variant supports SDIO
54 * @st_clkdiv: true if using a ST-specific clock divider algorithm 54 * @st_clkdiv: true if using a ST-specific clock divider algorithm
55 * @blksz_datactrl16: true if Block size is at b16..b30 position in datactrl register 55 * @blksz_datactrl16: true if Block size is at b16..b30 position in datactrl register
56 * @pwrreg_powerup: power up value for MMCIPOWER register
57 * @signal_direction: input/out direction of bus signals can be indicated
56 */ 58 */
57struct variant_data { 59struct variant_data {
58 unsigned int clkreg; 60 unsigned int clkreg;
@@ -63,18 +65,22 @@ struct variant_data {
63 bool sdio; 65 bool sdio;
64 bool st_clkdiv; 66 bool st_clkdiv;
65 bool blksz_datactrl16; 67 bool blksz_datactrl16;
68 u32 pwrreg_powerup;
69 bool signal_direction;
66}; 70};
67 71
68static struct variant_data variant_arm = { 72static struct variant_data variant_arm = {
69 .fifosize = 16 * 4, 73 .fifosize = 16 * 4,
70 .fifohalfsize = 8 * 4, 74 .fifohalfsize = 8 * 4,
71 .datalength_bits = 16, 75 .datalength_bits = 16,
76 .pwrreg_powerup = MCI_PWR_UP,
72}; 77};
73 78
74static struct variant_data variant_arm_extended_fifo = { 79static struct variant_data variant_arm_extended_fifo = {
75 .fifosize = 128 * 4, 80 .fifosize = 128 * 4,
76 .fifohalfsize = 64 * 4, 81 .fifohalfsize = 64 * 4,
77 .datalength_bits = 16, 82 .datalength_bits = 16,
83 .pwrreg_powerup = MCI_PWR_UP,
78}; 84};
79 85
80static struct variant_data variant_u300 = { 86static struct variant_data variant_u300 = {
@@ -83,6 +89,8 @@ static struct variant_data variant_u300 = {
83 .clkreg_enable = MCI_ST_U300_HWFCEN, 89 .clkreg_enable = MCI_ST_U300_HWFCEN,
84 .datalength_bits = 16, 90 .datalength_bits = 16,
85 .sdio = true, 91 .sdio = true,
92 .pwrreg_powerup = MCI_PWR_ON,
93 .signal_direction = true,
86}; 94};
87 95
88static struct variant_data variant_ux500 = { 96static struct variant_data variant_ux500 = {
@@ -93,6 +101,8 @@ static struct variant_data variant_ux500 = {
93 .datalength_bits = 24, 101 .datalength_bits = 24,
94 .sdio = true, 102 .sdio = true,
95 .st_clkdiv = true, 103 .st_clkdiv = true,
104 .pwrreg_powerup = MCI_PWR_ON,
105 .signal_direction = true,
96}; 106};
97 107
98static struct variant_data variant_ux500v2 = { 108static struct variant_data variant_ux500v2 = {
@@ -104,11 +114,35 @@ static struct variant_data variant_ux500v2 = {
104 .sdio = true, 114 .sdio = true,
105 .st_clkdiv = true, 115 .st_clkdiv = true,
106 .blksz_datactrl16 = true, 116 .blksz_datactrl16 = true,
117 .pwrreg_powerup = MCI_PWR_ON,
118 .signal_direction = true,
107}; 119};
108 120
109/* 121/*
110 * This must be called with host->lock held 122 * This must be called with host->lock held
111 */ 123 */
124static void mmci_write_clkreg(struct mmci_host *host, u32 clk)
125{
126 if (host->clk_reg != clk) {
127 host->clk_reg = clk;
128 writel(clk, host->base + MMCICLOCK);
129 }
130}
131
132/*
133 * This must be called with host->lock held
134 */
135static void mmci_write_pwrreg(struct mmci_host *host, u32 pwr)
136{
137 if (host->pwr_reg != pwr) {
138 host->pwr_reg = pwr;
139 writel(pwr, host->base + MMCIPOWER);
140 }
141}
142
143/*
144 * This must be called with host->lock held
145 */
112static void mmci_set_clkreg(struct mmci_host *host, unsigned int desired) 146static void mmci_set_clkreg(struct mmci_host *host, unsigned int desired)
113{ 147{
114 struct variant_data *variant = host->variant; 148 struct variant_data *variant = host->variant;
@@ -153,7 +187,7 @@ static void mmci_set_clkreg(struct mmci_host *host, unsigned int desired)
153 if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_8) 187 if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_8)
154 clk |= MCI_ST_8BIT_BUS; 188 clk |= MCI_ST_8BIT_BUS;
155 189
156 writel(clk, host->base + MMCICLOCK); 190 mmci_write_clkreg(host, clk);
157} 191}
158 192
159static void 193static void
@@ -166,14 +200,10 @@ mmci_request_end(struct mmci_host *host, struct mmc_request *mrq)
166 host->mrq = NULL; 200 host->mrq = NULL;
167 host->cmd = NULL; 201 host->cmd = NULL;
168 202
169 /*
170 * Need to drop the host lock here; mmc_request_done may call
171 * back into the driver...
172 */
173 spin_unlock(&host->lock);
174 pm_runtime_put(mmc_dev(host->mmc));
175 mmc_request_done(host->mmc, mrq); 203 mmc_request_done(host->mmc, mrq);
176 spin_lock(&host->lock); 204
205 pm_runtime_mark_last_busy(mmc_dev(host->mmc));
206 pm_runtime_put_autosuspend(mmc_dev(host->mmc));
177} 207}
178 208
179static void mmci_set_mask1(struct mmci_host *host, unsigned int mask) 209static void mmci_set_mask1(struct mmci_host *host, unsigned int mask)
@@ -607,6 +637,11 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
607 if (data->flags & MMC_DATA_READ) 637 if (data->flags & MMC_DATA_READ)
608 datactrl |= MCI_DPSM_DIRECTION; 638 datactrl |= MCI_DPSM_DIRECTION;
609 639
640 /* The ST Micro variants has a special bit to enable SDIO */
641 if (variant->sdio && host->mmc->card)
642 if (mmc_card_sdio(host->mmc->card))
643 datactrl |= MCI_ST_DPSM_SDIOEN;
644
610 /* 645 /*
611 * Attempt to use DMA operation mode, if this 646 * Attempt to use DMA operation mode, if this
612 * should fail, fall back to PIO mode 647 * should fail, fall back to PIO mode
@@ -635,11 +670,6 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
635 irqmask = MCI_TXFIFOHALFEMPTYMASK; 670 irqmask = MCI_TXFIFOHALFEMPTYMASK;
636 } 671 }
637 672
638 /* The ST Micro variants has a special bit to enable SDIO */
639 if (variant->sdio && host->mmc->card)
640 if (mmc_card_sdio(host->mmc->card))
641 datactrl |= MCI_ST_DPSM_SDIOEN;
642
643 writel(datactrl, base + MMCIDATACTRL); 673 writel(datactrl, base + MMCIDATACTRL);
644 writel(readl(base + MMCIMASK0) & ~MCI_DATAENDMASK, base + MMCIMASK0); 674 writel(readl(base + MMCIMASK0) & ~MCI_DATAENDMASK, base + MMCIMASK0);
645 mmci_set_mask1(host, irqmask); 675 mmci_set_mask1(host, irqmask);
@@ -786,7 +816,24 @@ static int mmci_pio_read(struct mmci_host *host, char *buffer, unsigned int rema
786 if (count <= 0) 816 if (count <= 0)
787 break; 817 break;
788 818
789 readsl(base + MMCIFIFO, ptr, count >> 2); 819 /*
820 * SDIO especially may want to send something that is
821 * not divisible by 4 (as opposed to card sectors
822 * etc). Therefore make sure to always read the last bytes
823 * while only doing full 32-bit reads towards the FIFO.
824 */
825 if (unlikely(count & 0x3)) {
826 if (count < 4) {
827 unsigned char buf[4];
828 readsl(base + MMCIFIFO, buf, 1);
829 memcpy(ptr, buf, count);
830 } else {
831 readsl(base + MMCIFIFO, ptr, count >> 2);
832 count &= ~0x3;
833 }
834 } else {
835 readsl(base + MMCIFIFO, ptr, count >> 2);
836 }
790 837
791 ptr += count; 838 ptr += count;
792 remain -= count; 839 remain -= count;
@@ -821,14 +868,13 @@ static int mmci_pio_write(struct mmci_host *host, char *buffer, unsigned int rem
821 */ 868 */
822 if (variant->sdio && 869 if (variant->sdio &&
823 mmc_card_sdio(host->mmc->card)) { 870 mmc_card_sdio(host->mmc->card)) {
871 u32 clk;
824 if (count < 8) 872 if (count < 8)
825 writel(readl(host->base + MMCICLOCK) & 873 clk = host->clk_reg & ~variant->clkreg_enable;
826 ~variant->clkreg_enable,
827 host->base + MMCICLOCK);
828 else 874 else
829 writel(readl(host->base + MMCICLOCK) | 875 clk = host->clk_reg | variant->clkreg_enable;
830 variant->clkreg_enable, 876
831 host->base + MMCICLOCK); 877 mmci_write_clkreg(host, clk);
832 } 878 }
833 879
834 /* 880 /*
@@ -1015,10 +1061,17 @@ static void mmci_request(struct mmc_host *mmc, struct mmc_request *mrq)
1015static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) 1061static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
1016{ 1062{
1017 struct mmci_host *host = mmc_priv(mmc); 1063 struct mmci_host *host = mmc_priv(mmc);
1064 struct variant_data *variant = host->variant;
1018 u32 pwr = 0; 1065 u32 pwr = 0;
1019 unsigned long flags; 1066 unsigned long flags;
1020 int ret; 1067 int ret;
1021 1068
1069 pm_runtime_get_sync(mmc_dev(mmc));
1070
1071 if (host->plat->ios_handler &&
1072 host->plat->ios_handler(mmc_dev(mmc), ios))
1073 dev_err(mmc_dev(mmc), "platform ios_handler failed\n");
1074
1022 switch (ios->power_mode) { 1075 switch (ios->power_mode) {
1023 case MMC_POWER_OFF: 1076 case MMC_POWER_OFF:
1024 if (host->vcc) 1077 if (host->vcc)
@@ -1035,22 +1088,38 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
1035 * power should be rare so we print an error 1088 * power should be rare so we print an error
1036 * and return here. 1089 * and return here.
1037 */ 1090 */
1038 return; 1091 goto out;
1039 } 1092 }
1040 } 1093 }
1041 if (host->plat->vdd_handler) 1094 /*
1042 pwr |= host->plat->vdd_handler(mmc_dev(mmc), ios->vdd, 1095 * The ST Micro variant doesn't have the PL180s MCI_PWR_UP
1043 ios->power_mode); 1096 * and instead uses MCI_PWR_ON so apply whatever value is
1044 /* The ST version does not have this, fall through to POWER_ON */ 1097 * configured in the variant data.
1045 if (host->hw_designer != AMBA_VENDOR_ST) { 1098 */
1046 pwr |= MCI_PWR_UP; 1099 pwr |= variant->pwrreg_powerup;
1047 break; 1100
1048 } 1101 break;
1049 case MMC_POWER_ON: 1102 case MMC_POWER_ON:
1050 pwr |= MCI_PWR_ON; 1103 pwr |= MCI_PWR_ON;
1051 break; 1104 break;
1052 } 1105 }
1053 1106
1107 if (variant->signal_direction && ios->power_mode != MMC_POWER_OFF) {
1108 /*
1109 * The ST Micro variant has some additional bits
1110 * indicating signal direction for the signals in
1111 * the SD/MMC bus and feedback-clock usage.
1112 */
1113 pwr |= host->plat->sigdir;
1114
1115 if (ios->bus_width == MMC_BUS_WIDTH_4)
1116 pwr &= ~MCI_ST_DATA74DIREN;
1117 else if (ios->bus_width == MMC_BUS_WIDTH_1)
1118 pwr &= (~MCI_ST_DATA74DIREN &
1119 ~MCI_ST_DATA31DIREN &
1120 ~MCI_ST_DATA2DIREN);
1121 }
1122
1054 if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN) { 1123 if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN) {
1055 if (host->hw_designer != AMBA_VENDOR_ST) 1124 if (host->hw_designer != AMBA_VENDOR_ST)
1056 pwr |= MCI_ROD; 1125 pwr |= MCI_ROD;
@@ -1066,13 +1135,13 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
1066 spin_lock_irqsave(&host->lock, flags); 1135 spin_lock_irqsave(&host->lock, flags);
1067 1136
1068 mmci_set_clkreg(host, ios->clock); 1137 mmci_set_clkreg(host, ios->clock);
1069 1138 mmci_write_pwrreg(host, pwr);
1070 if (host->pwr != pwr) {
1071 host->pwr = pwr;
1072 writel(pwr, host->base + MMCIPOWER);
1073 }
1074 1139
1075 spin_unlock_irqrestore(&host->lock, flags); 1140 spin_unlock_irqrestore(&host->lock, flags);
1141
1142 out:
1143 pm_runtime_mark_last_busy(mmc_dev(mmc));
1144 pm_runtime_put_autosuspend(mmc_dev(mmc));
1076} 1145}
1077 1146
1078static int mmci_get_ro(struct mmc_host *mmc) 1147static int mmci_get_ro(struct mmc_host *mmc)
@@ -1346,6 +1415,8 @@ static int __devinit mmci_probe(struct amba_device *dev,
1346 1415
1347 mmci_dma_setup(host); 1416 mmci_dma_setup(host);
1348 1417
1418 pm_runtime_set_autosuspend_delay(&dev->dev, 50);
1419 pm_runtime_use_autosuspend(&dev->dev);
1349 pm_runtime_put(&dev->dev); 1420 pm_runtime_put(&dev->dev);
1350 1421
1351 mmc_add_host(mmc); 1422 mmc_add_host(mmc);
@@ -1430,43 +1501,49 @@ static int __devexit mmci_remove(struct amba_device *dev)
1430 return 0; 1501 return 0;
1431} 1502}
1432 1503
1433#ifdef CONFIG_PM 1504#ifdef CONFIG_SUSPEND
1434static int mmci_suspend(struct amba_device *dev, pm_message_t state) 1505static int mmci_suspend(struct device *dev)
1435{ 1506{
1436 struct mmc_host *mmc = amba_get_drvdata(dev); 1507 struct amba_device *adev = to_amba_device(dev);
1508 struct mmc_host *mmc = amba_get_drvdata(adev);
1437 int ret = 0; 1509 int ret = 0;
1438 1510
1439 if (mmc) { 1511 if (mmc) {
1440 struct mmci_host *host = mmc_priv(mmc); 1512 struct mmci_host *host = mmc_priv(mmc);
1441 1513
1442 ret = mmc_suspend_host(mmc); 1514 ret = mmc_suspend_host(mmc);
1443 if (ret == 0) 1515 if (ret == 0) {
1516 pm_runtime_get_sync(dev);
1444 writel(0, host->base + MMCIMASK0); 1517 writel(0, host->base + MMCIMASK0);
1518 }
1445 } 1519 }
1446 1520
1447 return ret; 1521 return ret;
1448} 1522}
1449 1523
1450static int mmci_resume(struct amba_device *dev) 1524static int mmci_resume(struct device *dev)
1451{ 1525{
1452 struct mmc_host *mmc = amba_get_drvdata(dev); 1526 struct amba_device *adev = to_amba_device(dev);
1527 struct mmc_host *mmc = amba_get_drvdata(adev);
1453 int ret = 0; 1528 int ret = 0;
1454 1529
1455 if (mmc) { 1530 if (mmc) {
1456 struct mmci_host *host = mmc_priv(mmc); 1531 struct mmci_host *host = mmc_priv(mmc);
1457 1532
1458 writel(MCI_IRQENABLE, host->base + MMCIMASK0); 1533 writel(MCI_IRQENABLE, host->base + MMCIMASK0);
1534 pm_runtime_put(dev);
1459 1535
1460 ret = mmc_resume_host(mmc); 1536 ret = mmc_resume_host(mmc);
1461 } 1537 }
1462 1538
1463 return ret; 1539 return ret;
1464} 1540}
1465#else
1466#define mmci_suspend NULL
1467#define mmci_resume NULL
1468#endif 1541#endif
1469 1542
1543static const struct dev_pm_ops mmci_dev_pm_ops = {
1544 SET_SYSTEM_SLEEP_PM_OPS(mmci_suspend, mmci_resume)
1545};
1546
1470static struct amba_id mmci_ids[] = { 1547static struct amba_id mmci_ids[] = {
1471 { 1548 {
1472 .id = 0x00041180, 1549 .id = 0x00041180,
@@ -1512,26 +1589,15 @@ MODULE_DEVICE_TABLE(amba, mmci_ids);
1512static struct amba_driver mmci_driver = { 1589static struct amba_driver mmci_driver = {
1513 .drv = { 1590 .drv = {
1514 .name = DRIVER_NAME, 1591 .name = DRIVER_NAME,
1592 .pm = &mmci_dev_pm_ops,
1515 }, 1593 },
1516 .probe = mmci_probe, 1594 .probe = mmci_probe,
1517 .remove = __devexit_p(mmci_remove), 1595 .remove = __devexit_p(mmci_remove),
1518 .suspend = mmci_suspend,
1519 .resume = mmci_resume,
1520 .id_table = mmci_ids, 1596 .id_table = mmci_ids,
1521}; 1597};
1522 1598
1523static int __init mmci_init(void) 1599module_amba_driver(mmci_driver);
1524{
1525 return amba_driver_register(&mmci_driver);
1526}
1527
1528static void __exit mmci_exit(void)
1529{
1530 amba_driver_unregister(&mmci_driver);
1531}
1532 1600
1533module_init(mmci_init);
1534module_exit(mmci_exit);
1535module_param(fmax, uint, 0444); 1601module_param(fmax, uint, 0444);
1536 1602
1537MODULE_DESCRIPTION("ARM PrimeCell PL180/181 Multimedia Card Interface driver"); 1603MODULE_DESCRIPTION("ARM PrimeCell PL180/181 Multimedia Card Interface driver");
diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h
index 79e4143ab9df..d437ccf62d6b 100644
--- a/drivers/mmc/host/mmci.h
+++ b/drivers/mmc/host/mmci.h
@@ -13,16 +13,6 @@
13#define MCI_PWR_ON 0x03 13#define MCI_PWR_ON 0x03
14#define MCI_OD (1 << 6) 14#define MCI_OD (1 << 6)
15#define MCI_ROD (1 << 7) 15#define MCI_ROD (1 << 7)
16/*
17 * The ST Micro version does not have ROD and reuse the voltage registers
18 * for direction settings
19 */
20#define MCI_ST_DATA2DIREN (1 << 2)
21#define MCI_ST_CMDDIREN (1 << 3)
22#define MCI_ST_DATA0DIREN (1 << 4)
23#define MCI_ST_DATA31DIREN (1 << 5)
24#define MCI_ST_FBCLKEN (1 << 7)
25#define MCI_ST_DATA74DIREN (1 << 8)
26 16
27#define MMCICLOCK 0x004 17#define MMCICLOCK 0x004
28#define MCI_CLK_ENABLE (1 << 8) 18#define MCI_CLK_ENABLE (1 << 8)
@@ -160,7 +150,7 @@
160 (MCI_RXFIFOHALFFULLMASK | MCI_RXDATAAVLBLMASK | \ 150 (MCI_RXFIFOHALFFULLMASK | MCI_RXDATAAVLBLMASK | \
161 MCI_TXFIFOHALFEMPTYMASK) 151 MCI_TXFIFOHALFEMPTYMASK)
162 152
163#define NR_SG 16 153#define NR_SG 128
164 154
165struct clk; 155struct clk;
166struct variant_data; 156struct variant_data;
@@ -189,7 +179,8 @@ struct mmci_host {
189 179
190 unsigned int mclk; 180 unsigned int mclk;
191 unsigned int cclk; 181 unsigned int cclk;
192 u32 pwr; 182 u32 pwr_reg;
183 u32 clk_reg;
193 struct mmci_platform_data *plat; 184 struct mmci_platform_data *plat;
194 struct variant_data *variant; 185 struct variant_data *variant;
195 186
diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
index 1bcfd6dbb5cc..c3622a69f432 100644
--- a/drivers/mmc/host/s3cmci.c
+++ b/drivers/mmc/host/s3cmci.c
@@ -1606,7 +1606,7 @@ static int __devinit s3cmci_probe(struct platform_device *pdev)
1606 host->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1606 host->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1607 if (!host->mem) { 1607 if (!host->mem) {
1608 dev_err(&pdev->dev, 1608 dev_err(&pdev->dev,
1609 "failed to get io memory region resouce.\n"); 1609 "failed to get io memory region resource.\n");
1610 1610
1611 ret = -ENOENT; 1611 ret = -ENOENT;
1612 goto probe_free_gpio; 1612 goto probe_free_gpio;
@@ -1630,7 +1630,7 @@ static int __devinit s3cmci_probe(struct platform_device *pdev)
1630 1630
1631 host->irq = platform_get_irq(pdev, 0); 1631 host->irq = platform_get_irq(pdev, 0);
1632 if (host->irq == 0) { 1632 if (host->irq == 0) {
1633 dev_err(&pdev->dev, "failed to get interrupt resouce.\n"); 1633 dev_err(&pdev->dev, "failed to get interrupt resource.\n");
1634 ret = -EINVAL; 1634 ret = -EINVAL;
1635 goto probe_iounmap; 1635 goto probe_iounmap;
1636 } 1636 }
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index 78a36eba4df0..cb348569454b 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -23,7 +23,6 @@
23#include <linux/gpio.h> 23#include <linux/gpio.h>
24#include <linux/mmc/card.h> 24#include <linux/mmc/card.h>
25#include <linux/mmc/host.h> 25#include <linux/mmc/host.h>
26#include <linux/module.h>
27 26
28#include <asm/gpio.h> 27#include <asm/gpio.h>
29 28
diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 352d4797865b..75a485448796 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -56,6 +56,7 @@
56#include <linux/mmc/sh_mmcif.h> 56#include <linux/mmc/sh_mmcif.h>
57#include <linux/pagemap.h> 57#include <linux/pagemap.h>
58#include <linux/platform_device.h> 58#include <linux/platform_device.h>
59#include <linux/pm_qos.h>
59#include <linux/pm_runtime.h> 60#include <linux/pm_runtime.h>
60#include <linux/spinlock.h> 61#include <linux/spinlock.h>
61#include <linux/module.h> 62#include <linux/module.h>
@@ -1346,6 +1347,8 @@ static int __devinit sh_mmcif_probe(struct platform_device *pdev)
1346 if (ret < 0) 1347 if (ret < 0)
1347 goto clean_up5; 1348 goto clean_up5;
1348 1349
1350 dev_pm_qos_expose_latency_limit(&pdev->dev, 100);
1351
1349 dev_info(&pdev->dev, "driver version %s\n", DRIVER_VERSION); 1352 dev_info(&pdev->dev, "driver version %s\n", DRIVER_VERSION);
1350 dev_dbg(&pdev->dev, "chip ver H'%04x\n", 1353 dev_dbg(&pdev->dev, "chip ver H'%04x\n",
1351 sh_mmcif_readl(host->addr, MMCIF_CE_VERSION) & 0x0000ffff); 1354 sh_mmcif_readl(host->addr, MMCIF_CE_VERSION) & 0x0000ffff);
@@ -1376,6 +1379,8 @@ static int __devexit sh_mmcif_remove(struct platform_device *pdev)
1376 host->dying = true; 1379 host->dying = true;
1377 pm_runtime_get_sync(&pdev->dev); 1380 pm_runtime_get_sync(&pdev->dev);
1378 1381
1382 dev_pm_qos_hide_latency_limit(&pdev->dev);
1383
1379 mmc_remove_host(host->mmc); 1384 mmc_remove_host(host->mmc);
1380 sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, MASK_ALL); 1385 sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, MASK_ALL);
1381 1386
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 5f9ad74fbf80..e21988901c36 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -39,6 +39,7 @@
39#include <linux/module.h> 39#include <linux/module.h>
40#include <linux/pagemap.h> 40#include <linux/pagemap.h>
41#include <linux/platform_device.h> 41#include <linux/platform_device.h>
42#include <linux/pm_qos.h>
42#include <linux/pm_runtime.h> 43#include <linux/pm_runtime.h>
43#include <linux/scatterlist.h> 44#include <linux/scatterlist.h>
44#include <linux/spinlock.h> 45#include <linux/spinlock.h>
@@ -955,6 +956,8 @@ int __devinit tmio_mmc_host_probe(struct tmio_mmc_host **host,
955 956
956 mmc_add_host(mmc); 957 mmc_add_host(mmc);
957 958
959 dev_pm_qos_expose_latency_limit(&pdev->dev, 100);
960
958 /* Unmask the IRQs we want to know about */ 961 /* Unmask the IRQs we want to know about */
959 if (!_host->chan_rx) 962 if (!_host->chan_rx)
960 irq_mask |= TMIO_MASK_READOP; 963 irq_mask |= TMIO_MASK_READOP;
@@ -993,6 +996,8 @@ void tmio_mmc_host_remove(struct tmio_mmc_host *host)
993 || host->mmc->caps & MMC_CAP_NONREMOVABLE) 996 || host->mmc->caps & MMC_CAP_NONREMOVABLE)
994 pm_runtime_get_sync(&pdev->dev); 997 pm_runtime_get_sync(&pdev->dev);
995 998
999 dev_pm_qos_hide_latency_limit(&pdev->dev);
1000
996 mmc_remove_host(host->mmc); 1001 mmc_remove_host(host->mmc);
997 cancel_work_sync(&host->done); 1002 cancel_work_sync(&host->done);
998 cancel_delayed_work_sync(&host->delayed_reset_work); 1003 cancel_delayed_work_sync(&host->delayed_reset_work);