aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/Kconfig2
-rw-r--r--drivers/mmc/host/tmio_mmc.c13
-rw-r--r--drivers/mmc/host/tmio_mmc.h6
3 files changed, 13 insertions, 8 deletions
diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index 7b431bbab7f1..2e13b94769fd 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -365,7 +365,7 @@ config MMC_SDRICOH_CS
365 365
366config MMC_TMIO 366config MMC_TMIO
367 tristate "Toshiba Mobile IO Controller (TMIO) MMC/SD function support" 367 tristate "Toshiba Mobile IO Controller (TMIO) MMC/SD function support"
368 depends on MFD_TMIO || MFD_ASIC3 || SUPERH 368 depends on MFD_TMIO || MFD_ASIC3 || MFD_SH_MOBILE_SDHI
369 help 369 help
370 This provides support for the SD/MMC cell found in TC6393XB, 370 This provides support for the SD/MMC cell found in TC6393XB,
371 T7L66XB and also HTC ASIC3 371 T7L66XB and also HTC ASIC3
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index e22c3fa3516a..b2b577f6afd4 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -323,7 +323,7 @@ static irqreturn_t tmio_mmc_irq(int irq, void *devid)
323 if (ireg & (TMIO_STAT_CARD_INSERT | TMIO_STAT_CARD_REMOVE)) { 323 if (ireg & (TMIO_STAT_CARD_INSERT | TMIO_STAT_CARD_REMOVE)) {
324 ack_mmc_irqs(host, TMIO_STAT_CARD_INSERT | 324 ack_mmc_irqs(host, TMIO_STAT_CARD_INSERT |
325 TMIO_STAT_CARD_REMOVE); 325 TMIO_STAT_CARD_REMOVE);
326 mmc_detect_change(host->mmc, 0); 326 mmc_detect_change(host->mmc, msecs_to_jiffies(100));
327 } 327 }
328 328
329 /* CRC and other errors */ 329 /* CRC and other errors */
@@ -550,6 +550,7 @@ static int __devinit tmio_mmc_probe(struct platform_device *dev)
550 550
551 mmc->ops = &tmio_mmc_ops; 551 mmc->ops = &tmio_mmc_ops;
552 mmc->caps = MMC_CAP_4_BIT_DATA; 552 mmc->caps = MMC_CAP_4_BIT_DATA;
553 mmc->caps |= pdata->capabilities;
553 mmc->f_max = pdata->hclk; 554 mmc->f_max = pdata->hclk;
554 mmc->f_min = mmc->f_max / 512; 555 mmc->f_min = mmc->f_max / 512;
555 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; 556 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
@@ -568,14 +569,14 @@ static int __devinit tmio_mmc_probe(struct platform_device *dev)
568 if (ret >= 0) 569 if (ret >= 0)
569 host->irq = ret; 570 host->irq = ret;
570 else 571 else
571 goto unmap_ctl; 572 goto cell_disable;
572 573
573 disable_mmc_irqs(host, TMIO_MASK_ALL); 574 disable_mmc_irqs(host, TMIO_MASK_ALL);
574 575
575 ret = request_irq(host->irq, tmio_mmc_irq, IRQF_DISABLED | 576 ret = request_irq(host->irq, tmio_mmc_irq, IRQF_DISABLED |
576 IRQF_TRIGGER_FALLING, dev_name(&dev->dev), host); 577 IRQF_TRIGGER_FALLING, dev_name(&dev->dev), host);
577 if (ret) 578 if (ret)
578 goto unmap_ctl; 579 goto cell_disable;
579 580
580 mmc_add_host(mmc); 581 mmc_add_host(mmc);
581 582
@@ -587,6 +588,9 @@ static int __devinit tmio_mmc_probe(struct platform_device *dev)
587 588
588 return 0; 589 return 0;
589 590
591cell_disable:
592 if (cell->disable)
593 cell->disable(dev);
590unmap_ctl: 594unmap_ctl:
591 iounmap(host->ctl); 595 iounmap(host->ctl);
592host_free: 596host_free:
@@ -597,6 +601,7 @@ out:
597 601
598static int __devexit tmio_mmc_remove(struct platform_device *dev) 602static int __devexit tmio_mmc_remove(struct platform_device *dev)
599{ 603{
604 struct mfd_cell *cell = (struct mfd_cell *)dev->dev.platform_data;
600 struct mmc_host *mmc = platform_get_drvdata(dev); 605 struct mmc_host *mmc = platform_get_drvdata(dev);
601 606
602 platform_set_drvdata(dev, NULL); 607 platform_set_drvdata(dev, NULL);
@@ -605,6 +610,8 @@ static int __devexit tmio_mmc_remove(struct platform_device *dev)
605 struct tmio_mmc_host *host = mmc_priv(mmc); 610 struct tmio_mmc_host *host = mmc_priv(mmc);
606 mmc_remove_host(mmc); 611 mmc_remove_host(mmc);
607 free_irq(host->irq, host); 612 free_irq(host->irq, host);
613 if (cell->disable)
614 cell->disable(dev);
608 iounmap(host->ctl); 615 iounmap(host->ctl);
609 mmc_free_host(mmc); 616 mmc_free_host(mmc);
610 } 617 }
diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
index 692dc23363b9..dafecfbcd91a 100644
--- a/drivers/mmc/host/tmio_mmc.h
+++ b/drivers/mmc/host/tmio_mmc.h
@@ -55,10 +55,8 @@
55/* Define some IRQ masks */ 55/* Define some IRQ masks */
56/* This is the mask used at reset by the chip */ 56/* This is the mask used at reset by the chip */
57#define TMIO_MASK_ALL 0x837f031d 57#define TMIO_MASK_ALL 0x837f031d
58#define TMIO_MASK_READOP (TMIO_STAT_RXRDY | TMIO_STAT_DATAEND | \ 58#define TMIO_MASK_READOP (TMIO_STAT_RXRDY | TMIO_STAT_DATAEND)
59 TMIO_STAT_CARD_REMOVE | TMIO_STAT_CARD_INSERT) 59#define TMIO_MASK_WRITEOP (TMIO_STAT_TXRQ | TMIO_STAT_DATAEND)
60#define TMIO_MASK_WRITEOP (TMIO_STAT_TXRQ | TMIO_STAT_DATAEND | \
61 TMIO_STAT_CARD_REMOVE | TMIO_STAT_CARD_INSERT)
62#define TMIO_MASK_CMD (TMIO_STAT_CMDRESPEND | TMIO_STAT_CMDTIMEOUT | \ 60#define TMIO_MASK_CMD (TMIO_STAT_CMDRESPEND | TMIO_STAT_CMDTIMEOUT | \
63 TMIO_STAT_CARD_REMOVE | TMIO_STAT_CARD_INSERT) 61 TMIO_STAT_CARD_REMOVE | TMIO_STAT_CARD_INSERT)
64#define TMIO_MASK_IRQ (TMIO_MASK_READOP | TMIO_MASK_WRITEOP | TMIO_MASK_CMD) 62#define TMIO_MASK_IRQ (TMIO_MASK_READOP | TMIO_MASK_WRITEOP | TMIO_MASK_CMD)