mmc: Merge branch fixes into next

Merge the mmc fixes for v6.18-rc[n] into the next branch, to allow them to
get tested together with the new mmc changes that are targeted for v6.19.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
Ulf Hansson
2025-11-11 18:34:14 +01:00
2 changed files with 20 additions and 40 deletions

View File

@@ -42,7 +42,7 @@ struct dw_mci_rockchip_priv_data {
*/ */
static int rockchip_mmc_get_internal_phase(struct dw_mci *host, bool sample) static int rockchip_mmc_get_internal_phase(struct dw_mci *host, bool sample)
{ {
unsigned long rate = clk_get_rate(host->ciu_clk); unsigned long rate = clk_get_rate(host->ciu_clk) / RK3288_CLKGEN_DIV;
u32 raw_value; u32 raw_value;
u16 degrees; u16 degrees;
u32 delay_num = 0; u32 delay_num = 0;
@@ -85,7 +85,7 @@ static int rockchip_mmc_get_phase(struct dw_mci *host, bool sample)
static int rockchip_mmc_set_internal_phase(struct dw_mci *host, bool sample, int degrees) static int rockchip_mmc_set_internal_phase(struct dw_mci *host, bool sample, int degrees)
{ {
unsigned long rate = clk_get_rate(host->ciu_clk); unsigned long rate = clk_get_rate(host->ciu_clk) / RK3288_CLKGEN_DIV;
u8 nineties, remainder; u8 nineties, remainder;
u8 delay_num; u8 delay_num;
u32 raw_value; u32 raw_value;

View File

@@ -652,10 +652,9 @@ static int pxamci_probe(struct platform_device *pdev)
host->clkrt = CLKRT_OFF; host->clkrt = CLKRT_OFF;
host->clk = devm_clk_get(dev, NULL); host->clk = devm_clk_get(dev, NULL);
if (IS_ERR(host->clk)) { if (IS_ERR(host->clk))
host->clk = NULL; return dev_err_probe(dev, PTR_ERR(host->clk),
return PTR_ERR(host->clk); "Failed to acquire clock\n");
}
host->clkrate = clk_get_rate(host->clk); host->clkrate = clk_get_rate(host->clk);
@@ -703,46 +702,37 @@ static int pxamci_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, mmc); platform_set_drvdata(pdev, mmc);
host->dma_chan_rx = dma_request_chan(dev, "rx"); host->dma_chan_rx = devm_dma_request_chan(dev, "rx");
if (IS_ERR(host->dma_chan_rx)) { if (IS_ERR(host->dma_chan_rx))
host->dma_chan_rx = NULL;
return dev_err_probe(dev, PTR_ERR(host->dma_chan_rx), return dev_err_probe(dev, PTR_ERR(host->dma_chan_rx),
"unable to request rx dma channel\n"); "unable to request rx dma channel\n");
}
host->dma_chan_tx = dma_request_chan(dev, "tx");
if (IS_ERR(host->dma_chan_tx)) { host->dma_chan_tx = devm_dma_request_chan(dev, "tx");
dev_err(dev, "unable to request tx dma channel\n"); if (IS_ERR(host->dma_chan_tx))
ret = PTR_ERR(host->dma_chan_tx); return dev_err_probe(dev, PTR_ERR(host->dma_chan_tx),
host->dma_chan_tx = NULL; "unable to request tx dma channel\n");
goto out;
}
if (host->pdata) { if (host->pdata) {
host->detect_delay_ms = host->pdata->detect_delay_ms; host->detect_delay_ms = host->pdata->detect_delay_ms;
host->power = devm_gpiod_get_optional(dev, "power", GPIOD_OUT_LOW); host->power = devm_gpiod_get_optional(dev, "power", GPIOD_OUT_LOW);
if (IS_ERR(host->power)) { if (IS_ERR(host->power))
ret = PTR_ERR(host->power); return dev_err_probe(dev, PTR_ERR(host->power),
dev_err(dev, "Failed requesting gpio_power\n"); "Failed requesting gpio_power\n");
goto out;
}
/* FIXME: should we pass detection delay to debounce? */ /* FIXME: should we pass detection delay to debounce? */
ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0); ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0);
if (ret && ret != -ENOENT) { if (ret && ret != -ENOENT)
dev_err(dev, "Failed requesting gpio_cd\n"); return dev_err_probe(dev, ret, "Failed requesting gpio_cd\n");
goto out;
}
if (!host->pdata->gpio_card_ro_invert) if (!host->pdata->gpio_card_ro_invert)
mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH; mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0); ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0);
if (ret && ret != -ENOENT) { if (ret && ret != -ENOENT)
dev_err(dev, "Failed requesting gpio_ro\n"); return dev_err_probe(dev, ret, "Failed requesting gpio_ro\n");
goto out;
}
if (!ret) if (!ret)
host->use_ro_gpio = true; host->use_ro_gpio = true;
@@ -759,16 +749,8 @@ static int pxamci_probe(struct platform_device *pdev)
if (ret) { if (ret) {
if (host->pdata && host->pdata->exit) if (host->pdata && host->pdata->exit)
host->pdata->exit(dev, mmc); host->pdata->exit(dev, mmc);
goto out;
} }
return 0;
out:
if (host->dma_chan_rx)
dma_release_channel(host->dma_chan_rx);
if (host->dma_chan_tx)
dma_release_channel(host->dma_chan_tx);
return ret; return ret;
} }
@@ -791,8 +773,6 @@ static void pxamci_remove(struct platform_device *pdev)
dmaengine_terminate_all(host->dma_chan_rx); dmaengine_terminate_all(host->dma_chan_rx);
dmaengine_terminate_all(host->dma_chan_tx); dmaengine_terminate_all(host->dma_chan_tx);
dma_release_channel(host->dma_chan_rx);
dma_release_channel(host->dma_chan_tx);
} }
} }