MMC host:

- dw_mmc-rockchip: Fix internal phase calculation
  - pxamci: Simplify and fix ->probe() error handling
  - sdhci-of-dwcmshc: Fix strbin signal delay
  - wmt-sdmmc: Fix compile test default
 -----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCgA1FiEEugLDXPmKSktSkQsV/iaEJXNYjCkFAmkXV0IXHHVsZi5oYW5z
 c29uQGxpbmFyby5vcmcACgkQ/iaEJXNYjCn4cg//dgxz5D8jpFvEingdOeUzw0iq
 47Xb8zgqtP9kRrGoi8s4DcBc3kratVgndUaPC0g0ZR0I2yV9yKheOSXaph8/yA/g
 L37sVPNIGIFSQ4cvpcRyXMQ1EmILp0Uw6SK0wGvKwnfe71Bv1iWzr+3j4WBPMuKp
 CU7L3GWIkWSmcSGqQk0WM+E5kWwHfsUSw/qHGsji+i2GL6LMS/g1Y1NI6EXRJq0t
 QfiFeQ+2Mm4ZGeqeRlez5OErrXNIZm83mC5wXHBLmc6vK0GY38IzTE39xkvTaiRw
 5/x8ivQghDREmIDDIXT/tDGrLsTBwBxBuQ59lZw5yBD0orTCVZOFvNnli70j0xc4
 mKgdVdG0WwURXPHhBv2Z8TvHQnZcZ3b3aUBiR4+PBvFspWtED9GsrgSrpDmpSbRk
 EnLNOW+sWDRSdoIMwHLCZ0QNYlfDMZjrjyTMhFwdxWiLQaz6Rr4EspMA55jYYCRP
 9nodxGya8EdeRnCZQYCSr8mEz34xwZELX23rw/IcKXTWbMJ2Fuwsjx3Bb2nQn0iZ
 b+L+wrsp2nIZTpUT6iIbHFWGJoX8+hmMpH7LwUbGnbB/PavVnDFpLw1qLnFIK/wb
 JXCAx67Ldclq4ikwi7lkiHw/GFPCDI7g5uEMt/TFe/aO5M5hDEoIN3MxjPH41D71
 YI6/SjrANHAgKXh06iI=
 =V0qh
 -----END PGP SIGNATURE-----

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

Pull MMC fixes from Ulf Hansson:

 - dw_mmc-rockchip: Fix internal phase calculation

 - pxamci: Simplify and fix ->probe() error handling

 - sdhci-of-dwcmshc: Fix strbin signal delay

 - wmt-sdmmc: Fix compile test default

* tag 'mmc-v6.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
  mmc: dw_mmc-rockchip: Fix wrong internal phase calculate
  mmc: pxamci: Simplify pxamci_probe() error handling using devm APIs
  mmc: sdhci-of-dwcmshc: Change DLL_STRBIN_TAPNUM_DEFAULT to 0x4
  mmc: wmt-sdmmc: fix compile test default
This commit is contained in:
Linus Torvalds 2025-11-14 13:34:36 -08:00
commit ccc0011804
4 changed files with 22 additions and 42 deletions

View File

@ -950,7 +950,7 @@ config MMC_USHC
config MMC_WMT
tristate "Wondermedia SD/MMC Host Controller support"
depends on ARCH_VT8500 || COMPILE_TEST
default y
default ARCH_VT8500
help
This selects support for the SD/MMC Host Controller on
Wondermedia WM8505/WM8650 based SoCs.

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)
{
unsigned long rate = clk_get_rate(host->ciu_clk);
unsigned long rate = clk_get_rate(host->ciu_clk) / RK3288_CLKGEN_DIV;
u32 raw_value;
u16 degrees;
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)
{
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 delay_num;
u32 raw_value;

View File

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

View File

@ -94,7 +94,7 @@
#define DLL_TXCLK_TAPNUM_DEFAULT 0x10
#define DLL_TXCLK_TAPNUM_90_DEGREES 0xA
#define DLL_TXCLK_TAPNUM_FROM_SW BIT(24)
#define DLL_STRBIN_TAPNUM_DEFAULT 0x8
#define DLL_STRBIN_TAPNUM_DEFAULT 0x4
#define DLL_STRBIN_TAPNUM_FROM_SW BIT(24)
#define DLL_STRBIN_DELAY_NUM_SEL BIT(26)
#define DLL_STRBIN_DELAY_NUM_OFFSET 16