aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/mmci.c18
-rw-r--r--drivers/mmc/host/mxs-mmc.c11
-rw-r--r--drivers/mmc/host/sdhci-esdhc-imx.c9
-rw-r--r--drivers/mmc/host/sdhci-tegra.c24
4 files changed, 42 insertions, 20 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index efc822df4b75..f0fcce40cd8d 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -96,6 +96,17 @@ static struct variant_data variant_u300 = {
96 .signal_direction = true, 96 .signal_direction = true,
97}; 97};
98 98
99static struct variant_data variant_nomadik = {
100 .fifosize = 16 * 4,
101 .fifohalfsize = 8 * 4,
102 .clkreg = MCI_CLK_ENABLE,
103 .datalength_bits = 24,
104 .sdio = true,
105 .st_clkdiv = true,
106 .pwrreg_powerup = MCI_PWR_ON,
107 .signal_direction = true,
108};
109
99static struct variant_data variant_ux500 = { 110static struct variant_data variant_ux500 = {
100 .fifosize = 30 * 4, 111 .fifosize = 30 * 4,
101 .fifohalfsize = 8 * 4, 112 .fifohalfsize = 8 * 4,
@@ -1454,7 +1465,7 @@ static int __devinit mmci_probe(struct amba_device *dev,
1454 if (ret) 1465 if (ret)
1455 goto unmap; 1466 goto unmap;
1456 1467
1457 if (dev->irq[1] == NO_IRQ || !dev->irq[1]) 1468 if (!dev->irq[1])
1458 host->singleirq = true; 1469 host->singleirq = true;
1459 else { 1470 else {
1460 ret = request_irq(dev->irq[1], mmci_pio_irq, IRQF_SHARED, 1471 ret = request_irq(dev->irq[1], mmci_pio_irq, IRQF_SHARED,
@@ -1626,6 +1637,11 @@ static struct amba_id mmci_ids[] = {
1626 .data = &variant_u300, 1637 .data = &variant_u300,
1627 }, 1638 },
1628 { 1639 {
1640 .id = 0x10180180,
1641 .mask = 0xf0ffffff,
1642 .data = &variant_nomadik,
1643 },
1644 {
1629 .id = 0x00280180, 1645 .id = 0x00280180,
1630 .mask = 0x00ffffff, 1646 .mask = 0x00ffffff,
1631 .data = &variant_u300, 1647 .data = &variant_u300,
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index b0f2ef988188..bb03ddda481d 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -39,6 +39,7 @@
39#include <linux/regulator/consumer.h> 39#include <linux/regulator/consumer.h>
40#include <linux/module.h> 40#include <linux/module.h>
41#include <linux/fsl/mxs-dma.h> 41#include <linux/fsl/mxs-dma.h>
42#include <linux/pinctrl/consumer.h>
42 43
43#include <mach/mxs.h> 44#include <mach/mxs.h>
44#include <mach/common.h> 45#include <mach/common.h>
@@ -363,6 +364,7 @@ static void mxs_mmc_bc(struct mxs_mmc_host *host)
363 goto out; 364 goto out;
364 365
365 dmaengine_submit(desc); 366 dmaengine_submit(desc);
367 dma_async_issue_pending(host->dmach);
366 return; 368 return;
367 369
368out: 370out:
@@ -403,6 +405,7 @@ static void mxs_mmc_ac(struct mxs_mmc_host *host)
403 goto out; 405 goto out;
404 406
405 dmaengine_submit(desc); 407 dmaengine_submit(desc);
408 dma_async_issue_pending(host->dmach);
406 return; 409 return;
407 410
408out: 411out:
@@ -531,6 +534,7 @@ static void mxs_mmc_adtc(struct mxs_mmc_host *host)
531 goto out; 534 goto out;
532 535
533 dmaengine_submit(desc); 536 dmaengine_submit(desc);
537 dma_async_issue_pending(host->dmach);
534 return; 538 return;
535out: 539out:
536 dev_warn(mmc_dev(host->mmc), 540 dev_warn(mmc_dev(host->mmc),
@@ -679,6 +683,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
679 struct mmc_host *mmc; 683 struct mmc_host *mmc;
680 struct resource *iores, *dmares, *r; 684 struct resource *iores, *dmares, *r;
681 struct mxs_mmc_platform_data *pdata; 685 struct mxs_mmc_platform_data *pdata;
686 struct pinctrl *pinctrl;
682 int ret = 0, irq_err, irq_dma; 687 int ret = 0, irq_err, irq_dma;
683 dma_cap_mask_t mask; 688 dma_cap_mask_t mask;
684 689
@@ -716,6 +721,12 @@ static int mxs_mmc_probe(struct platform_device *pdev)
716 host->irq = irq_err; 721 host->irq = irq_err;
717 host->sdio_irq_en = 0; 722 host->sdio_irq_en = 0;
718 723
724 pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
725 if (IS_ERR(pinctrl)) {
726 ret = PTR_ERR(pinctrl);
727 goto out_iounmap;
728 }
729
719 host->clk = clk_get(&pdev->dev, NULL); 730 host->clk = clk_get(&pdev->dev, NULL);
720 if (IS_ERR(host->clk)) { 731 if (IS_ERR(host->clk)) {
721 ret = PTR_ERR(host->clk); 732 ret = PTR_ERR(host->clk);
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 8abdaf6697a8..d190d04636a7 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -24,6 +24,7 @@
24#include <linux/of.h> 24#include <linux/of.h>
25#include <linux/of_device.h> 25#include <linux/of_device.h>
26#include <linux/of_gpio.h> 26#include <linux/of_gpio.h>
27#include <linux/pinctrl/consumer.h>
27#include <mach/esdhc.h> 28#include <mach/esdhc.h>
28#include "sdhci-pltfm.h" 29#include "sdhci-pltfm.h"
29#include "sdhci-esdhc.h" 30#include "sdhci-esdhc.h"
@@ -68,6 +69,7 @@ struct pltfm_imx_data {
68 int flags; 69 int flags;
69 u32 scratchpad; 70 u32 scratchpad;
70 enum imx_esdhc_type devtype; 71 enum imx_esdhc_type devtype;
72 struct pinctrl *pinctrl;
71 struct esdhc_platform_data boarddata; 73 struct esdhc_platform_data boarddata;
72}; 74};
73 75
@@ -467,6 +469,12 @@ static int __devinit sdhci_esdhc_imx_probe(struct platform_device *pdev)
467 clk_prepare_enable(clk); 469 clk_prepare_enable(clk);
468 pltfm_host->clk = clk; 470 pltfm_host->clk = clk;
469 471
472 imx_data->pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
473 if (IS_ERR(imx_data->pinctrl)) {
474 err = PTR_ERR(imx_data->pinctrl);
475 goto pin_err;
476 }
477
470 host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL; 478 host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
471 479
472 if (is_imx25_esdhc(imx_data) || is_imx35_esdhc(imx_data)) 480 if (is_imx25_esdhc(imx_data) || is_imx35_esdhc(imx_data))
@@ -558,6 +566,7 @@ no_card_detect_irq:
558 gpio_free(boarddata->wp_gpio); 566 gpio_free(boarddata->wp_gpio);
559no_card_detect_pin: 567no_card_detect_pin:
560no_board_data: 568no_board_data:
569pin_err:
561 clk_disable_unprepare(pltfm_host->clk); 570 clk_disable_unprepare(pltfm_host->clk);
562 clk_put(pltfm_host->clk); 571 clk_put(pltfm_host->clk);
563err_clk_get: 572err_clk_get:
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index cff0c522b4ab..b38d8a78f6a0 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -295,7 +295,6 @@ static int __devinit sdhci_tegra_probe(struct platform_device *pdev)
295 "failed to allocate power gpio\n"); 295 "failed to allocate power gpio\n");
296 goto err_power_req; 296 goto err_power_req;
297 } 297 }
298 tegra_gpio_enable(plat->power_gpio);
299 gpio_direction_output(plat->power_gpio, 1); 298 gpio_direction_output(plat->power_gpio, 1);
300 } 299 }
301 300
@@ -306,7 +305,6 @@ static int __devinit sdhci_tegra_probe(struct platform_device *pdev)
306 "failed to allocate cd gpio\n"); 305 "failed to allocate cd gpio\n");
307 goto err_cd_req; 306 goto err_cd_req;
308 } 307 }
309 tegra_gpio_enable(plat->cd_gpio);
310 gpio_direction_input(plat->cd_gpio); 308 gpio_direction_input(plat->cd_gpio);
311 309
312 rc = request_irq(gpio_to_irq(plat->cd_gpio), carddetect_irq, 310 rc = request_irq(gpio_to_irq(plat->cd_gpio), carddetect_irq,
@@ -327,7 +325,6 @@ static int __devinit sdhci_tegra_probe(struct platform_device *pdev)
327 "failed to allocate wp gpio\n"); 325 "failed to allocate wp gpio\n");
328 goto err_wp_req; 326 goto err_wp_req;
329 } 327 }
330 tegra_gpio_enable(plat->wp_gpio);
331 gpio_direction_input(plat->wp_gpio); 328 gpio_direction_input(plat->wp_gpio);
332 } 329 }
333 330
@@ -355,23 +352,17 @@ err_add_host:
355 clk_disable(pltfm_host->clk); 352 clk_disable(pltfm_host->clk);
356 clk_put(pltfm_host->clk); 353 clk_put(pltfm_host->clk);
357err_clk_get: 354err_clk_get:
358 if (gpio_is_valid(plat->wp_gpio)) { 355 if (gpio_is_valid(plat->wp_gpio))
359 tegra_gpio_disable(plat->wp_gpio);
360 gpio_free(plat->wp_gpio); 356 gpio_free(plat->wp_gpio);
361 }
362err_wp_req: 357err_wp_req:
363 if (gpio_is_valid(plat->cd_gpio)) 358 if (gpio_is_valid(plat->cd_gpio))
364 free_irq(gpio_to_irq(plat->cd_gpio), host); 359 free_irq(gpio_to_irq(plat->cd_gpio), host);
365err_cd_irq_req: 360err_cd_irq_req:
366 if (gpio_is_valid(plat->cd_gpio)) { 361 if (gpio_is_valid(plat->cd_gpio))
367 tegra_gpio_disable(plat->cd_gpio);
368 gpio_free(plat->cd_gpio); 362 gpio_free(plat->cd_gpio);
369 }
370err_cd_req: 363err_cd_req:
371 if (gpio_is_valid(plat->power_gpio)) { 364 if (gpio_is_valid(plat->power_gpio))
372 tegra_gpio_disable(plat->power_gpio);
373 gpio_free(plat->power_gpio); 365 gpio_free(plat->power_gpio);
374 }
375err_power_req: 366err_power_req:
376err_no_plat: 367err_no_plat:
377 sdhci_pltfm_free(pdev); 368 sdhci_pltfm_free(pdev);
@@ -388,21 +379,16 @@ static int __devexit sdhci_tegra_remove(struct platform_device *pdev)
388 379
389 sdhci_remove_host(host, dead); 380 sdhci_remove_host(host, dead);
390 381
391 if (gpio_is_valid(plat->wp_gpio)) { 382 if (gpio_is_valid(plat->wp_gpio))
392 tegra_gpio_disable(plat->wp_gpio);
393 gpio_free(plat->wp_gpio); 383 gpio_free(plat->wp_gpio);
394 }
395 384
396 if (gpio_is_valid(plat->cd_gpio)) { 385 if (gpio_is_valid(plat->cd_gpio)) {
397 free_irq(gpio_to_irq(plat->cd_gpio), host); 386 free_irq(gpio_to_irq(plat->cd_gpio), host);
398 tegra_gpio_disable(plat->cd_gpio);
399 gpio_free(plat->cd_gpio); 387 gpio_free(plat->cd_gpio);
400 } 388 }
401 389
402 if (gpio_is_valid(plat->power_gpio)) { 390 if (gpio_is_valid(plat->power_gpio))
403 tegra_gpio_disable(plat->power_gpio);
404 gpio_free(plat->power_gpio); 391 gpio_free(plat->power_gpio);
405 }
406 392
407 clk_disable(pltfm_host->clk); 393 clk_disable(pltfm_host->clk);
408 clk_put(pltfm_host->clk); 394 clk_put(pltfm_host->clk);