Commit ba606975 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'mmc-v5.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc

Pull MMC fixes from Ulf Hansson:

 - sdhci-acpi: Fixup build dependency for PCI

 - sdhci-omap: Resolve Kconfig warnings on keystone

 - sdhci-iproc: Propagate errors from DT parsing

 - meson-gx: Fixup IRQ handling in release callback

 - meson-gx: Use signal re-sampling to fixup tuning

 - dw_mmc-bluefield: Fix the license information

* tag 'mmc-v5.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
  mmc: dw_mmc-bluefield: : Fix the license information
  mmc: meson-gx: enable signal re-sampling together with tuning
  mmc: sdhci-iproc: handle mmc_of_parse() errors during probe
  mmc: meson-gx: Free irq in release() callback
  mmc: host: Fix Kconfig warnings on keystone_defconfig
  mmc: sdhci-acpi: Make PCI dependency explicit
parents d488bd21 f3716b8a
...@@ -116,7 +116,7 @@ config MMC_RICOH_MMC ...@@ -116,7 +116,7 @@ config MMC_RICOH_MMC
config MMC_SDHCI_ACPI config MMC_SDHCI_ACPI
tristate "SDHCI support for ACPI enumerated SDHCI controllers" tristate "SDHCI support for ACPI enumerated SDHCI controllers"
depends on MMC_SDHCI && ACPI depends on MMC_SDHCI && ACPI && PCI
select IOSF_MBI if X86 select IOSF_MBI if X86
help help
This selects support for ACPI enumerated SDHCI controllers, This selects support for ACPI enumerated SDHCI controllers,
...@@ -978,7 +978,7 @@ config MMC_SDHCI_OMAP ...@@ -978,7 +978,7 @@ config MMC_SDHCI_OMAP
tristate "TI SDHCI Controller Support" tristate "TI SDHCI Controller Support"
depends on MMC_SDHCI_PLTFM && OF depends on MMC_SDHCI_PLTFM && OF
select THERMAL select THERMAL
select TI_SOC_THERMAL imply TI_SOC_THERMAL
help help
This selects the Secure Digital Host Controller Interface (SDHCI) This selects the Secure Digital Host Controller Interface (SDHCI)
support present in TI's DRA7 SOCs. The controller supports support present in TI's DRA7 SOCs. The controller supports
......
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
/* /*
* Copyright (C) 2018 Mellanox Technologies. * Copyright (C) 2018 Mellanox Technologies.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/ */
#include <linux/bitfield.h> #include <linux/bitfield.h>
......
...@@ -179,6 +179,8 @@ struct meson_host { ...@@ -179,6 +179,8 @@ struct meson_host {
struct sd_emmc_desc *descs; struct sd_emmc_desc *descs;
dma_addr_t descs_dma_addr; dma_addr_t descs_dma_addr;
int irq;
bool vqmmc_enabled; bool vqmmc_enabled;
}; };
...@@ -738,6 +740,11 @@ static int meson_mmc_clk_phase_tuning(struct mmc_host *mmc, u32 opcode, ...@@ -738,6 +740,11 @@ static int meson_mmc_clk_phase_tuning(struct mmc_host *mmc, u32 opcode,
static int meson_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode) static int meson_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode)
{ {
struct meson_host *host = mmc_priv(mmc); struct meson_host *host = mmc_priv(mmc);
int adj = 0;
/* enable signal resampling w/o delay */
adj = ADJUST_ADJ_EN;
writel(adj, host->regs + host->data->adjust);
return meson_mmc_clk_phase_tuning(mmc, opcode, host->rx_clk); return meson_mmc_clk_phase_tuning(mmc, opcode, host->rx_clk);
} }
...@@ -768,6 +775,9 @@ static void meson_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) ...@@ -768,6 +775,9 @@ static void meson_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
if (!IS_ERR(mmc->supply.vmmc)) if (!IS_ERR(mmc->supply.vmmc))
mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd); mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd);
/* disable signal resampling */
writel(0, host->regs + host->data->adjust);
/* Reset rx phase */ /* Reset rx phase */
clk_set_phase(host->rx_clk, 0); clk_set_phase(host->rx_clk, 0);
...@@ -1166,7 +1176,7 @@ static int meson_mmc_get_cd(struct mmc_host *mmc) ...@@ -1166,7 +1176,7 @@ static int meson_mmc_get_cd(struct mmc_host *mmc)
static void meson_mmc_cfg_init(struct meson_host *host) static void meson_mmc_cfg_init(struct meson_host *host)
{ {
u32 cfg = 0, adj = 0; u32 cfg = 0;
cfg |= FIELD_PREP(CFG_RESP_TIMEOUT_MASK, cfg |= FIELD_PREP(CFG_RESP_TIMEOUT_MASK,
ilog2(SD_EMMC_CFG_RESP_TIMEOUT)); ilog2(SD_EMMC_CFG_RESP_TIMEOUT));
...@@ -1177,10 +1187,6 @@ static void meson_mmc_cfg_init(struct meson_host *host) ...@@ -1177,10 +1187,6 @@ static void meson_mmc_cfg_init(struct meson_host *host)
cfg |= CFG_ERR_ABORT; cfg |= CFG_ERR_ABORT;
writel(cfg, host->regs + SD_EMMC_CFG); writel(cfg, host->regs + SD_EMMC_CFG);
/* enable signal resampling w/o delay */
adj = ADJUST_ADJ_EN;
writel(adj, host->regs + host->data->adjust);
} }
static int meson_mmc_card_busy(struct mmc_host *mmc) static int meson_mmc_card_busy(struct mmc_host *mmc)
...@@ -1231,7 +1237,7 @@ static int meson_mmc_probe(struct platform_device *pdev) ...@@ -1231,7 +1237,7 @@ static int meson_mmc_probe(struct platform_device *pdev)
struct resource *res; struct resource *res;
struct meson_host *host; struct meson_host *host;
struct mmc_host *mmc; struct mmc_host *mmc;
int ret, irq; int ret;
mmc = mmc_alloc_host(sizeof(struct meson_host), &pdev->dev); mmc = mmc_alloc_host(sizeof(struct meson_host), &pdev->dev);
if (!mmc) if (!mmc)
...@@ -1276,8 +1282,8 @@ static int meson_mmc_probe(struct platform_device *pdev) ...@@ -1276,8 +1282,8 @@ static int meson_mmc_probe(struct platform_device *pdev)
goto free_host; goto free_host;
} }
irq = platform_get_irq(pdev, 0); host->irq = platform_get_irq(pdev, 0);
if (irq <= 0) { if (host->irq <= 0) {
dev_err(&pdev->dev, "failed to get interrupt resource.\n"); dev_err(&pdev->dev, "failed to get interrupt resource.\n");
ret = -EINVAL; ret = -EINVAL;
goto free_host; goto free_host;
...@@ -1331,9 +1337,8 @@ static int meson_mmc_probe(struct platform_device *pdev) ...@@ -1331,9 +1337,8 @@ static int meson_mmc_probe(struct platform_device *pdev)
writel(IRQ_CRC_ERR | IRQ_TIMEOUTS | IRQ_END_OF_CHAIN, writel(IRQ_CRC_ERR | IRQ_TIMEOUTS | IRQ_END_OF_CHAIN,
host->regs + SD_EMMC_IRQ_EN); host->regs + SD_EMMC_IRQ_EN);
ret = devm_request_threaded_irq(&pdev->dev, irq, meson_mmc_irq, ret = request_threaded_irq(host->irq, meson_mmc_irq,
meson_mmc_irq_thread, IRQF_SHARED, meson_mmc_irq_thread, IRQF_SHARED, NULL, host);
NULL, host);
if (ret) if (ret)
goto err_init_clk; goto err_init_clk;
...@@ -1351,7 +1356,7 @@ static int meson_mmc_probe(struct platform_device *pdev) ...@@ -1351,7 +1356,7 @@ static int meson_mmc_probe(struct platform_device *pdev)
if (host->bounce_buf == NULL) { if (host->bounce_buf == NULL) {
dev_err(host->dev, "Unable to map allocate DMA bounce buffer.\n"); dev_err(host->dev, "Unable to map allocate DMA bounce buffer.\n");
ret = -ENOMEM; ret = -ENOMEM;
goto err_init_clk; goto err_free_irq;
} }
host->descs = dma_alloc_coherent(host->dev, SD_EMMC_DESC_BUF_LEN, 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,6 +1375,8 @@ static int meson_mmc_probe(struct platform_device *pdev)
err_bounce_buf: err_bounce_buf:
dma_free_coherent(host->dev, host->bounce_buf_size, dma_free_coherent(host->dev, host->bounce_buf_size,
host->bounce_buf, host->bounce_dma_addr); host->bounce_buf, host->bounce_dma_addr);
err_free_irq:
free_irq(host->irq, host);
err_init_clk: err_init_clk:
clk_disable_unprepare(host->mmc_clk); clk_disable_unprepare(host->mmc_clk);
err_core_clk: err_core_clk:
...@@ -1387,6 +1394,7 @@ static int meson_mmc_remove(struct platform_device *pdev) ...@@ -1387,6 +1394,7 @@ static int meson_mmc_remove(struct platform_device *pdev)
/* disable interrupts */ /* disable interrupts */
writel(0, host->regs + SD_EMMC_IRQ_EN); writel(0, host->regs + SD_EMMC_IRQ_EN);
free_irq(host->irq, host);
dma_free_coherent(host->dev, SD_EMMC_DESC_BUF_LEN, dma_free_coherent(host->dev, SD_EMMC_DESC_BUF_LEN,
host->descs, host->descs_dma_addr); host->descs, host->descs_dma_addr);
......
...@@ -296,7 +296,10 @@ static int sdhci_iproc_probe(struct platform_device *pdev) ...@@ -296,7 +296,10 @@ static int sdhci_iproc_probe(struct platform_device *pdev)
iproc_host->data = iproc_data; iproc_host->data = iproc_data;
mmc_of_parse(host->mmc); ret = mmc_of_parse(host->mmc);
if (ret)
goto err;
sdhci_get_property(pdev); sdhci_get_property(pdev);
host->mmc->caps |= iproc_host->data->mmc_caps; host->mmc->caps |= iproc_host->data->mmc_caps;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment