Skip to content

Commit ccc0011

Browse files
committed
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
2 parents 241e99d + 739f04f commit ccc0011

File tree

4 files changed

+22
-42
lines changed

4 files changed

+22
-42
lines changed

drivers/mmc/host/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ config MMC_USHC
950950
config MMC_WMT
951951
tristate "Wondermedia SD/MMC Host Controller support"
952952
depends on ARCH_VT8500 || COMPILE_TEST
953-
default y
953+
default ARCH_VT8500
954954
help
955955
This selects support for the SD/MMC Host Controller on
956956
Wondermedia WM8505/WM8650 based SoCs.

drivers/mmc/host/dw_mmc-rockchip.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct dw_mci_rockchip_priv_data {
4242
*/
4343
static int rockchip_mmc_get_internal_phase(struct dw_mci *host, bool sample)
4444
{
45-
unsigned long rate = clk_get_rate(host->ciu_clk);
45+
unsigned long rate = clk_get_rate(host->ciu_clk) / RK3288_CLKGEN_DIV;
4646
u32 raw_value;
4747
u16 degrees;
4848
u32 delay_num = 0;
@@ -85,7 +85,7 @@ static int rockchip_mmc_get_phase(struct dw_mci *host, bool sample)
8585

8686
static int rockchip_mmc_set_internal_phase(struct dw_mci *host, bool sample, int degrees)
8787
{
88-
unsigned long rate = clk_get_rate(host->ciu_clk);
88+
unsigned long rate = clk_get_rate(host->ciu_clk) / RK3288_CLKGEN_DIV;
8989
u8 nineties, remainder;
9090
u8 delay_num;
9191
u32 raw_value;

drivers/mmc/host/pxamci.c

Lines changed: 18 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -652,10 +652,9 @@ static int pxamci_probe(struct platform_device *pdev)
652652
host->clkrt = CLKRT_OFF;
653653

654654
host->clk = devm_clk_get(dev, NULL);
655-
if (IS_ERR(host->clk)) {
656-
host->clk = NULL;
657-
return PTR_ERR(host->clk);
658-
}
655+
if (IS_ERR(host->clk))
656+
return dev_err_probe(dev, PTR_ERR(host->clk),
657+
"Failed to acquire clock\n");
659658

660659
host->clkrate = clk_get_rate(host->clk);
661660

@@ -703,46 +702,37 @@ static int pxamci_probe(struct platform_device *pdev)
703702

704703
platform_set_drvdata(pdev, mmc);
705704

706-
host->dma_chan_rx = dma_request_chan(dev, "rx");
707-
if (IS_ERR(host->dma_chan_rx)) {
708-
host->dma_chan_rx = NULL;
705+
host->dma_chan_rx = devm_dma_request_chan(dev, "rx");
706+
if (IS_ERR(host->dma_chan_rx))
709707
return dev_err_probe(dev, PTR_ERR(host->dma_chan_rx),
710708
"unable to request rx dma channel\n");
711-
}
712709

713-
host->dma_chan_tx = dma_request_chan(dev, "tx");
714-
if (IS_ERR(host->dma_chan_tx)) {
715-
dev_err(dev, "unable to request tx dma channel\n");
716-
ret = PTR_ERR(host->dma_chan_tx);
717-
host->dma_chan_tx = NULL;
718-
goto out;
719-
}
710+
711+
host->dma_chan_tx = devm_dma_request_chan(dev, "tx");
712+
if (IS_ERR(host->dma_chan_tx))
713+
return dev_err_probe(dev, PTR_ERR(host->dma_chan_tx),
714+
"unable to request tx dma channel\n");
720715

721716
if (host->pdata) {
722717
host->detect_delay_ms = host->pdata->detect_delay_ms;
723718

724719
host->power = devm_gpiod_get_optional(dev, "power", GPIOD_OUT_LOW);
725-
if (IS_ERR(host->power)) {
726-
ret = PTR_ERR(host->power);
727-
dev_err(dev, "Failed requesting gpio_power\n");
728-
goto out;
729-
}
720+
if (IS_ERR(host->power))
721+
return dev_err_probe(dev, PTR_ERR(host->power),
722+
"Failed requesting gpio_power\n");
730723

731724
/* FIXME: should we pass detection delay to debounce? */
732725
ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0);
733-
if (ret && ret != -ENOENT) {
734-
dev_err(dev, "Failed requesting gpio_cd\n");
735-
goto out;
736-
}
726+
if (ret && ret != -ENOENT)
727+
return dev_err_probe(dev, ret, "Failed requesting gpio_cd\n");
737728

738729
if (!host->pdata->gpio_card_ro_invert)
739730
mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
740731

741732
ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0);
742-
if (ret && ret != -ENOENT) {
743-
dev_err(dev, "Failed requesting gpio_ro\n");
744-
goto out;
745-
}
733+
if (ret && ret != -ENOENT)
734+
return dev_err_probe(dev, ret, "Failed requesting gpio_ro\n");
735+
746736
if (!ret)
747737
host->use_ro_gpio = true;
748738

@@ -759,16 +749,8 @@ static int pxamci_probe(struct platform_device *pdev)
759749
if (ret) {
760750
if (host->pdata && host->pdata->exit)
761751
host->pdata->exit(dev, mmc);
762-
goto out;
763752
}
764753

765-
return 0;
766-
767-
out:
768-
if (host->dma_chan_rx)
769-
dma_release_channel(host->dma_chan_rx);
770-
if (host->dma_chan_tx)
771-
dma_release_channel(host->dma_chan_tx);
772754
return ret;
773755
}
774756

@@ -791,8 +773,6 @@ static void pxamci_remove(struct platform_device *pdev)
791773

792774
dmaengine_terminate_all(host->dma_chan_rx);
793775
dmaengine_terminate_all(host->dma_chan_tx);
794-
dma_release_channel(host->dma_chan_rx);
795-
dma_release_channel(host->dma_chan_tx);
796776
}
797777
}
798778

drivers/mmc/host/sdhci-of-dwcmshc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
#define DLL_TXCLK_TAPNUM_DEFAULT 0x10
9595
#define DLL_TXCLK_TAPNUM_90_DEGREES 0xA
9696
#define DLL_TXCLK_TAPNUM_FROM_SW BIT(24)
97-
#define DLL_STRBIN_TAPNUM_DEFAULT 0x8
97+
#define DLL_STRBIN_TAPNUM_DEFAULT 0x4
9898
#define DLL_STRBIN_TAPNUM_FROM_SW BIT(24)
9999
#define DLL_STRBIN_DELAY_NUM_SEL BIT(26)
100100
#define DLL_STRBIN_DELAY_NUM_OFFSET 16

0 commit comments

Comments
 (0)