diff options
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 4 | ||||
-rw-r--r-- | drivers/mmc/host/sh_mmcif.c | 12 | ||||
-rw-r--r-- | drivers/mmc/host/tmio_mmc.c | 30 |
3 files changed, 39 insertions, 7 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index e865032a52eb..82a1079bbdc7 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
@@ -483,8 +483,6 @@ static int omap_hsmmc_gpio_init(struct omap_mmc_platform_data *pdata) | |||
483 | int ret; | 483 | int ret; |
484 | 484 | ||
485 | if (gpio_is_valid(pdata->slots[0].switch_pin)) { | 485 | if (gpio_is_valid(pdata->slots[0].switch_pin)) { |
486 | pdata->suspend = omap_hsmmc_suspend_cdirq; | ||
487 | pdata->resume = omap_hsmmc_resume_cdirq; | ||
488 | if (pdata->slots[0].cover) | 486 | if (pdata->slots[0].cover) |
489 | pdata->slots[0].get_cover_state = | 487 | pdata->slots[0].get_cover_state = |
490 | omap_hsmmc_get_cover_state; | 488 | omap_hsmmc_get_cover_state; |
@@ -2218,6 +2216,8 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) | |||
2218 | "Unable to grab MMC CD IRQ\n"); | 2216 | "Unable to grab MMC CD IRQ\n"); |
2219 | goto err_irq_cd; | 2217 | goto err_irq_cd; |
2220 | } | 2218 | } |
2219 | pdata->suspend = omap_hsmmc_suspend_cdirq; | ||
2220 | pdata->resume = omap_hsmmc_resume_cdirq; | ||
2221 | } | 2221 | } |
2222 | 2222 | ||
2223 | omap_hsmmc_disable_irq(host); | 2223 | omap_hsmmc_disable_irq(host); |
diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c index 0f06b8002814..ddd09840520b 100644 --- a/drivers/mmc/host/sh_mmcif.c +++ b/drivers/mmc/host/sh_mmcif.c | |||
@@ -710,9 +710,21 @@ static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
710 | host->bus_width = ios->bus_width; | 710 | host->bus_width = ios->bus_width; |
711 | } | 711 | } |
712 | 712 | ||
713 | static int sh_mmcif_get_cd(struct mmc_host *mmc) | ||
714 | { | ||
715 | struct sh_mmcif_host *host = mmc_priv(mmc); | ||
716 | struct sh_mmcif_plat_data *p = host->pd->dev.platform_data; | ||
717 | |||
718 | if (!p->get_cd) | ||
719 | return -ENOSYS; | ||
720 | else | ||
721 | return p->get_cd(host->pd); | ||
722 | } | ||
723 | |||
713 | static struct mmc_host_ops sh_mmcif_ops = { | 724 | static struct mmc_host_ops sh_mmcif_ops = { |
714 | .request = sh_mmcif_request, | 725 | .request = sh_mmcif_request, |
715 | .set_ios = sh_mmcif_set_ios, | 726 | .set_ios = sh_mmcif_set_ios, |
727 | .get_cd = sh_mmcif_get_cd, | ||
716 | }; | 728 | }; |
717 | 729 | ||
718 | static void sh_mmcif_detect(struct mmc_host *mmc) | 730 | static void sh_mmcif_detect(struct mmc_host *mmc) |
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index 69d98e3bf6ab..e7765a89593e 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c | |||
@@ -658,14 +658,21 @@ static void tmio_mmc_release_dma(struct tmio_mmc_host *host) | |||
658 | static int tmio_mmc_start_data(struct tmio_mmc_host *host, | 658 | static int tmio_mmc_start_data(struct tmio_mmc_host *host, |
659 | struct mmc_data *data) | 659 | struct mmc_data *data) |
660 | { | 660 | { |
661 | struct mfd_cell *cell = host->pdev->dev.platform_data; | ||
662 | struct tmio_mmc_data *pdata = cell->driver_data; | ||
663 | |||
661 | pr_debug("setup data transfer: blocksize %08x nr_blocks %d\n", | 664 | pr_debug("setup data transfer: blocksize %08x nr_blocks %d\n", |
662 | data->blksz, data->blocks); | 665 | data->blksz, data->blocks); |
663 | 666 | ||
664 | /* Hardware cannot perform 1 and 2 byte requests in 4 bit mode */ | 667 | /* Some hardware cannot perform 2 byte requests in 4 bit mode */ |
665 | if (data->blksz < 4 && host->mmc->ios.bus_width == MMC_BUS_WIDTH_4) { | 668 | if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_4) { |
666 | pr_err("%s: %d byte block unsupported in 4 bit mode\n", | 669 | int blksz_2bytes = pdata->flags & TMIO_MMC_BLKSZ_2BYTES; |
667 | mmc_hostname(host->mmc), data->blksz); | 670 | |
668 | return -EINVAL; | 671 | if (data->blksz < 2 || (data->blksz < 4 && !blksz_2bytes)) { |
672 | pr_err("%s: %d byte block unsupported in 4 bit mode\n", | ||
673 | mmc_hostname(host->mmc), data->blksz); | ||
674 | return -EINVAL; | ||
675 | } | ||
669 | } | 676 | } |
670 | 677 | ||
671 | tmio_mmc_init_sg(host, data); | 678 | tmio_mmc_init_sg(host, data); |
@@ -756,10 +763,23 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc) | |||
756 | (sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_WRPROTECT)) ? 0 : 1; | 763 | (sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_WRPROTECT)) ? 0 : 1; |
757 | } | 764 | } |
758 | 765 | ||
766 | static int tmio_mmc_get_cd(struct mmc_host *mmc) | ||
767 | { | ||
768 | struct tmio_mmc_host *host = mmc_priv(mmc); | ||
769 | struct mfd_cell *cell = host->pdev->dev.platform_data; | ||
770 | struct tmio_mmc_data *pdata = cell->driver_data; | ||
771 | |||
772 | if (!pdata->get_cd) | ||
773 | return -ENOSYS; | ||
774 | else | ||
775 | return pdata->get_cd(host->pdev); | ||
776 | } | ||
777 | |||
759 | static const struct mmc_host_ops tmio_mmc_ops = { | 778 | static const struct mmc_host_ops tmio_mmc_ops = { |
760 | .request = tmio_mmc_request, | 779 | .request = tmio_mmc_request, |
761 | .set_ios = tmio_mmc_set_ios, | 780 | .set_ios = tmio_mmc_set_ios, |
762 | .get_ro = tmio_mmc_get_ro, | 781 | .get_ro = tmio_mmc_get_ro, |
782 | .get_cd = tmio_mmc_get_cd, | ||
763 | }; | 783 | }; |
764 | 784 | ||
765 | #ifdef CONFIG_PM | 785 | #ifdef CONFIG_PM |