diff options
| -rw-r--r-- | drivers/mmc/host/Kconfig | 4 | ||||
| -rw-r--r-- | drivers/mmc/host/dw_mmc-bluefield.c | 5 | ||||
| -rw-r--r-- | drivers/mmc/host/meson-gx-mmc.c | 32 | ||||
| -rw-r--r-- | drivers/mmc/host/sdhci-iproc.c | 5 |
4 files changed, 26 insertions, 20 deletions
diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index e26b8145efb3..a44ec8bb5418 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig | |||
| @@ -116,7 +116,7 @@ config MMC_RICOH_MMC | |||
| 116 | 116 | ||
| 117 | config MMC_SDHCI_ACPI | 117 | config MMC_SDHCI_ACPI |
| 118 | tristate "SDHCI support for ACPI enumerated SDHCI controllers" | 118 | tristate "SDHCI support for ACPI enumerated SDHCI controllers" |
| 119 | depends on MMC_SDHCI && ACPI | 119 | depends on MMC_SDHCI && ACPI && PCI |
| 120 | select IOSF_MBI if X86 | 120 | select IOSF_MBI if X86 |
| 121 | help | 121 | help |
| 122 | This selects support for ACPI enumerated SDHCI controllers, | 122 | This selects support for ACPI enumerated SDHCI controllers, |
| @@ -978,7 +978,7 @@ config MMC_SDHCI_OMAP | |||
| 978 | tristate "TI SDHCI Controller Support" | 978 | tristate "TI SDHCI Controller Support" |
| 979 | depends on MMC_SDHCI_PLTFM && OF | 979 | depends on MMC_SDHCI_PLTFM && OF |
| 980 | select THERMAL | 980 | select THERMAL |
| 981 | select TI_SOC_THERMAL | 981 | imply TI_SOC_THERMAL |
| 982 | help | 982 | help |
| 983 | This selects the Secure Digital Host Controller Interface (SDHCI) | 983 | This selects the Secure Digital Host Controller Interface (SDHCI) |
| 984 | support present in TI's DRA7 SOCs. The controller supports | 984 | support present in TI's DRA7 SOCs. The controller supports |
diff --git a/drivers/mmc/host/dw_mmc-bluefield.c b/drivers/mmc/host/dw_mmc-bluefield.c index ed8f2254b66a..aa38b1a8017e 100644 --- a/drivers/mmc/host/dw_mmc-bluefield.c +++ b/drivers/mmc/host/dw_mmc-bluefield.c | |||
| @@ -1,11 +1,6 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | /* | 2 | /* |
| 3 | * Copyright (C) 2018 Mellanox Technologies. | 3 | * Copyright (C) 2018 Mellanox Technologies. |
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | */ | 4 | */ |
| 10 | 5 | ||
| 11 | #include <linux/bitfield.h> | 6 | #include <linux/bitfield.h> |
diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index c2690c1a50ff..f19ec60bcbdc 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c | |||
| @@ -179,6 +179,8 @@ struct meson_host { | |||
| 179 | struct sd_emmc_desc *descs; | 179 | struct sd_emmc_desc *descs; |
| 180 | dma_addr_t descs_dma_addr; | 180 | dma_addr_t descs_dma_addr; |
| 181 | 181 | ||
| 182 | int irq; | ||
| 183 | |||
| 182 | bool vqmmc_enabled; | 184 | bool vqmmc_enabled; |
| 183 | }; | 185 | }; |
| 184 | 186 | ||
| @@ -738,6 +740,11 @@ static int meson_mmc_clk_phase_tuning(struct mmc_host *mmc, u32 opcode, | |||
| 738 | static int meson_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode) | 740 | static int meson_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode) |
| 739 | { | 741 | { |
| 740 | struct meson_host *host = mmc_priv(mmc); | 742 | struct meson_host *host = mmc_priv(mmc); |
| 743 | int adj = 0; | ||
| 744 | |||
| 745 | /* enable signal resampling w/o delay */ | ||
| 746 | adj = ADJUST_ADJ_EN; | ||
| 747 | writel(adj, host->regs + host->data->adjust); | ||
| 741 | 748 | ||
| 742 | return meson_mmc_clk_phase_tuning(mmc, opcode, host->rx_clk); | 749 | return meson_mmc_clk_phase_tuning(mmc, opcode, host->rx_clk); |
| 743 | } | 750 | } |
| @@ -768,6 +775,9 @@ static void meson_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
| 768 | if (!IS_ERR(mmc->supply.vmmc)) | 775 | if (!IS_ERR(mmc->supply.vmmc)) |
| 769 | mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd); | 776 | mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd); |
| 770 | 777 | ||
| 778 | /* disable signal resampling */ | ||
| 779 | writel(0, host->regs + host->data->adjust); | ||
| 780 | |||
| 771 | /* Reset rx phase */ | 781 | /* Reset rx phase */ |
| 772 | clk_set_phase(host->rx_clk, 0); | 782 | clk_set_phase(host->rx_clk, 0); |
| 773 | 783 | ||
| @@ -1166,7 +1176,7 @@ static int meson_mmc_get_cd(struct mmc_host *mmc) | |||
| 1166 | 1176 | ||
| 1167 | static void meson_mmc_cfg_init(struct meson_host *host) | 1177 | static void meson_mmc_cfg_init(struct meson_host *host) |
| 1168 | { | 1178 | { |
| 1169 | u32 cfg = 0, adj = 0; | 1179 | u32 cfg = 0; |
| 1170 | 1180 | ||
| 1171 | cfg |= FIELD_PREP(CFG_RESP_TIMEOUT_MASK, | 1181 | cfg |= FIELD_PREP(CFG_RESP_TIMEOUT_MASK, |
| 1172 | ilog2(SD_EMMC_CFG_RESP_TIMEOUT)); | 1182 | ilog2(SD_EMMC_CFG_RESP_TIMEOUT)); |
| @@ -1177,10 +1187,6 @@ static void meson_mmc_cfg_init(struct meson_host *host) | |||
| 1177 | cfg |= CFG_ERR_ABORT; | 1187 | cfg |= CFG_ERR_ABORT; |
| 1178 | 1188 | ||
| 1179 | writel(cfg, host->regs + SD_EMMC_CFG); | 1189 | writel(cfg, host->regs + SD_EMMC_CFG); |
| 1180 | |||
| 1181 | /* enable signal resampling w/o delay */ | ||
| 1182 | adj = ADJUST_ADJ_EN; | ||
| 1183 | writel(adj, host->regs + host->data->adjust); | ||
| 1184 | } | 1190 | } |
| 1185 | 1191 | ||
| 1186 | static int meson_mmc_card_busy(struct mmc_host *mmc) | 1192 | static int meson_mmc_card_busy(struct mmc_host *mmc) |
| @@ -1231,7 +1237,7 @@ static int meson_mmc_probe(struct platform_device *pdev) | |||
| 1231 | struct resource *res; | 1237 | struct resource *res; |
| 1232 | struct meson_host *host; | 1238 | struct meson_host *host; |
| 1233 | struct mmc_host *mmc; | 1239 | struct mmc_host *mmc; |
| 1234 | int ret, irq; | 1240 | int ret; |
| 1235 | 1241 | ||
| 1236 | mmc = mmc_alloc_host(sizeof(struct meson_host), &pdev->dev); | 1242 | mmc = mmc_alloc_host(sizeof(struct meson_host), &pdev->dev); |
| 1237 | if (!mmc) | 1243 | if (!mmc) |
| @@ -1276,8 +1282,8 @@ static int meson_mmc_probe(struct platform_device *pdev) | |||
| 1276 | goto free_host; | 1282 | goto free_host; |
| 1277 | } | 1283 | } |
| 1278 | 1284 | ||
| 1279 | irq = platform_get_irq(pdev, 0); | 1285 | host->irq = platform_get_irq(pdev, 0); |
| 1280 | if (irq <= 0) { | 1286 | if (host->irq <= 0) { |
| 1281 | dev_err(&pdev->dev, "failed to get interrupt resource.\n"); | 1287 | dev_err(&pdev->dev, "failed to get interrupt resource.\n"); |
| 1282 | ret = -EINVAL; | 1288 | ret = -EINVAL; |
| 1283 | goto free_host; | 1289 | goto free_host; |
| @@ -1331,9 +1337,8 @@ static int meson_mmc_probe(struct platform_device *pdev) | |||
| 1331 | writel(IRQ_CRC_ERR | IRQ_TIMEOUTS | IRQ_END_OF_CHAIN, | 1337 | writel(IRQ_CRC_ERR | IRQ_TIMEOUTS | IRQ_END_OF_CHAIN, |
| 1332 | host->regs + SD_EMMC_IRQ_EN); | 1338 | host->regs + SD_EMMC_IRQ_EN); |
| 1333 | 1339 | ||
| 1334 | ret = devm_request_threaded_irq(&pdev->dev, irq, meson_mmc_irq, | 1340 | ret = request_threaded_irq(host->irq, meson_mmc_irq, |
| 1335 | meson_mmc_irq_thread, IRQF_SHARED, | 1341 | meson_mmc_irq_thread, IRQF_SHARED, NULL, host); |
| 1336 | NULL, host); | ||
| 1337 | if (ret) | 1342 | if (ret) |
| 1338 | goto err_init_clk; | 1343 | goto err_init_clk; |
| 1339 | 1344 | ||
| @@ -1351,7 +1356,7 @@ static int meson_mmc_probe(struct platform_device *pdev) | |||
| 1351 | if (host->bounce_buf == NULL) { | 1356 | if (host->bounce_buf == NULL) { |
| 1352 | dev_err(host->dev, "Unable to map allocate DMA bounce buffer.\n"); | 1357 | dev_err(host->dev, "Unable to map allocate DMA bounce buffer.\n"); |
| 1353 | ret = -ENOMEM; | 1358 | ret = -ENOMEM; |
| 1354 | goto err_init_clk; | 1359 | goto err_free_irq; |
| 1355 | } | 1360 | } |
| 1356 | 1361 | ||
| 1357 | host->descs = dma_alloc_coherent(host->dev, SD_EMMC_DESC_BUF_LEN, | 1362 | host->descs = dma_alloc_coherent(host->dev, SD_EMMC_DESC_BUF_LEN, |
| @@ -1370,6 +1375,8 @@ static int meson_mmc_probe(struct platform_device *pdev) | |||
| 1370 | err_bounce_buf: | 1375 | err_bounce_buf: |
| 1371 | dma_free_coherent(host->dev, host->bounce_buf_size, | 1376 | dma_free_coherent(host->dev, host->bounce_buf_size, |
| 1372 | host->bounce_buf, host->bounce_dma_addr); | 1377 | host->bounce_buf, host->bounce_dma_addr); |
| 1378 | err_free_irq: | ||
| 1379 | free_irq(host->irq, host); | ||
| 1373 | err_init_clk: | 1380 | err_init_clk: |
| 1374 | clk_disable_unprepare(host->mmc_clk); | 1381 | clk_disable_unprepare(host->mmc_clk); |
| 1375 | err_core_clk: | 1382 | err_core_clk: |
| @@ -1387,6 +1394,7 @@ static int meson_mmc_remove(struct platform_device *pdev) | |||
| 1387 | 1394 | ||
| 1388 | /* disable interrupts */ | 1395 | /* disable interrupts */ |
| 1389 | writel(0, host->regs + SD_EMMC_IRQ_EN); | 1396 | writel(0, host->regs + SD_EMMC_IRQ_EN); |
| 1397 | free_irq(host->irq, host); | ||
| 1390 | 1398 | ||
| 1391 | dma_free_coherent(host->dev, SD_EMMC_DESC_BUF_LEN, | 1399 | dma_free_coherent(host->dev, SD_EMMC_DESC_BUF_LEN, |
| 1392 | host->descs, host->descs_dma_addr); | 1400 | host->descs, host->descs_dma_addr); |
diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c index 0db99057c44f..9d12c06c7fd6 100644 --- a/drivers/mmc/host/sdhci-iproc.c +++ b/drivers/mmc/host/sdhci-iproc.c | |||
| @@ -296,7 +296,10 @@ static int sdhci_iproc_probe(struct platform_device *pdev) | |||
| 296 | 296 | ||
| 297 | iproc_host->data = iproc_data; | 297 | iproc_host->data = iproc_data; |
| 298 | 298 | ||
| 299 | mmc_of_parse(host->mmc); | 299 | ret = mmc_of_parse(host->mmc); |
| 300 | if (ret) | ||
| 301 | goto err; | ||
| 302 | |||
| 300 | sdhci_get_property(pdev); | 303 | sdhci_get_property(pdev); |
| 301 | 304 | ||
| 302 | host->mmc->caps |= iproc_host->data->mmc_caps; | 305 | host->mmc->caps |= iproc_host->data->mmc_caps; |
