aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRajendra Nayak <rnayak@ti.com>2012-03-07 09:55:31 -0500
committerChris Ball <cjb@laptop.org>2012-03-27 12:20:02 -0400
commite3f1adb63cfa6f6ef6b4e63a546e13210c5f3cb2 (patch)
tree36b450fb8a6e6ca116274aef7b4a5e008fb05bd0 /drivers
parent1cb9af49a1ba2d7fc1c7236df5513449dda30a12 (diff)
mmc: omap_hsmmc: Don't expect MMC1 to always have vmmc supply
MMC1 is not the only instance that can be used/wired for SD. So remove this assumption from the driver. Now that all the mmc id based usage is removed, get rid of all the DEVID defines and also the 'id' field from the omap_hsmmc_host structure. Signed-off-by: Rajendra Nayak <rnayak@ti.com> Tested-by: Venkatraman S <svenkatr@ti.com> Tested-by: Balaji T K <balajitk@ti.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/omap_hsmmc.c31
1 files changed, 2 insertions, 29 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index e9215c264988..e5501704b2db 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -106,17 +106,6 @@
106#define SOFTRESET (1 << 1) 106#define SOFTRESET (1 << 1)
107#define RESETDONE (1 << 0) 107#define RESETDONE (1 << 0)
108 108
109/*
110 * FIXME: Most likely all the data using these _DEVID defines should come
111 * from the platform_data, or implemented in controller and slot specific
112 * functions.
113 */
114#define OMAP_MMC1_DEVID 0
115#define OMAP_MMC2_DEVID 1
116#define OMAP_MMC3_DEVID 2
117#define OMAP_MMC4_DEVID 3
118#define OMAP_MMC5_DEVID 4
119
120#define MMC_AUTOSUSPEND_DELAY 100 109#define MMC_AUTOSUSPEND_DELAY 100
121#define MMC_TIMEOUT_MS 20 110#define MMC_TIMEOUT_MS 20
122#define OMAP_MMC_MIN_CLOCK 400000 111#define OMAP_MMC_MIN_CLOCK 400000
@@ -164,7 +153,6 @@ struct omap_hsmmc_host {
164 void __iomem *base; 153 void __iomem *base;
165 resource_size_t mapbase; 154 resource_size_t mapbase;
166 spinlock_t irq_lock; /* Prevent races with irq handler */ 155 spinlock_t irq_lock; /* Prevent races with irq handler */
167 unsigned int id;
168 unsigned int dma_len; 156 unsigned int dma_len;
169 unsigned int dma_sg_idx; 157 unsigned int dma_sg_idx;
170 unsigned char bus_mode; 158 unsigned char bus_mode;
@@ -300,7 +288,6 @@ static int omap_hsmmc_set_power(struct device *dev, int slot, int power_on,
300static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) 288static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
301{ 289{
302 struct regulator *reg; 290 struct regulator *reg;
303 int ret = 0;
304 int ocr_value = 0; 291 int ocr_value = 0;
305 292
306 mmc_slot(host).set_power = omap_hsmmc_set_power; 293 mmc_slot(host).set_power = omap_hsmmc_set_power;
@@ -308,15 +295,6 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
308 reg = regulator_get(host->dev, "vmmc"); 295 reg = regulator_get(host->dev, "vmmc");
309 if (IS_ERR(reg)) { 296 if (IS_ERR(reg)) {
310 dev_dbg(host->dev, "vmmc regulator missing\n"); 297 dev_dbg(host->dev, "vmmc regulator missing\n");
311 /*
312 * HACK: until fixed.c regulator is usable,
313 * we don't require a main regulator
314 * for MMC2 or MMC3
315 */
316 if (host->id == OMAP_MMC1_DEVID) {
317 ret = PTR_ERR(reg);
318 goto err;
319 }
320 } else { 298 } else {
321 host->vcc = reg; 299 host->vcc = reg;
322 ocr_value = mmc_regulator_get_ocrmask(reg); 300 ocr_value = mmc_regulator_get_ocrmask(reg);
@@ -324,8 +302,8 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
324 mmc_slot(host).ocr_mask = ocr_value; 302 mmc_slot(host).ocr_mask = ocr_value;
325 } else { 303 } else {
326 if (!(mmc_slot(host).ocr_mask & ocr_value)) { 304 if (!(mmc_slot(host).ocr_mask & ocr_value)) {
327 pr_err("MMC%d ocrmask %x is not supported\n", 305 pr_err("MMC ocrmask %x is not supported\n",
328 host->id, mmc_slot(host).ocr_mask); 306 mmc_slot(host).ocr_mask);
329 mmc_slot(host).ocr_mask = 0; 307 mmc_slot(host).ocr_mask = 0;
330 return -EINVAL; 308 return -EINVAL;
331 } 309 }
@@ -358,10 +336,6 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
358 } 336 }
359 337
360 return 0; 338 return 0;
361
362err:
363 mmc_slot(host).set_power = NULL;
364 return ret;
365} 339}
366 340
367static void omap_hsmmc_reg_put(struct omap_hsmmc_host *host) 341static void omap_hsmmc_reg_put(struct omap_hsmmc_host *host)
@@ -1791,7 +1765,6 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
1791 host->dev->dma_mask = &pdata->dma_mask; 1765 host->dev->dma_mask = &pdata->dma_mask;
1792 host->dma_ch = -1; 1766 host->dma_ch = -1;
1793 host->irq = irq; 1767 host->irq = irq;
1794 host->id = pdev->id;
1795 host->slot_id = 0; 1768 host->slot_id = 0;
1796 host->mapbase = res->start; 1769 host->mapbase = res->start;
1797 host->base = ioremap(host->mapbase, SZ_4K); 1770 host->base = ioremap(host->mapbase, SZ_4K);