Skip to content

Commit 3c39e2c

Browse files
jbrun3tstorulf
authored andcommitted
mmc: meson-gx: cfg init overwrite values
cfg init function overwrite values set in the clk init function Remove the cfg pokes from the clk init. Actually, trying to use the CLK_AUTO, like initially tried in clk_init, would break the card initialization Reviewed-by: Kevin Hilman <[email protected]> Signed-off-by: Jerome Brunet <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
1 parent ef5c481 commit 3c39e2c

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

drivers/mmc/host/meson-gx-mmc.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ static int meson_mmc_clk_init(struct meson_host *host)
337337
int i, ret = 0;
338338
const char *mux_parent_names[MUX_CLK_NUM_PARENTS];
339339
const char *clk_div_parents[1];
340-
u32 clk_reg, cfg;
340+
u32 clk_reg;
341341

342342
/* init SD_EMMC_CLOCK to sane defaults w/min clock rate */
343343
clk_reg = 0;
@@ -402,12 +402,6 @@ static int meson_mmc_clk_init(struct meson_host *host)
402402
if (WARN_ON(PTR_ERR_OR_ZERO(host->cfg_div_clk)))
403403
return PTR_ERR(host->cfg_div_clk);
404404

405-
/* Ensure clock starts in "auto" mode, not "always on" */
406-
cfg = readl(host->regs + SD_EMMC_CFG);
407-
cfg &= ~CFG_CLK_ALWAYS_ON;
408-
cfg |= CFG_AUTO_CLK;
409-
writel(cfg, host->regs + SD_EMMC_CFG);
410-
411405
ret = clk_prepare_enable(host->cfg_div_clk);
412406
if (ret)
413407
return ret;
@@ -956,6 +950,9 @@ static int meson_mmc_probe(struct platform_device *pdev)
956950
if (ret)
957951
goto err_core_clk;
958952

953+
/* set config to sane default */
954+
meson_mmc_cfg_init(host);
955+
959956
/* Stop execution */
960957
writel(0, host->regs + SD_EMMC_START);
961958

@@ -964,9 +961,6 @@ static int meson_mmc_probe(struct platform_device *pdev)
964961
writel(IRQ_EN_MASK, host->regs + SD_EMMC_STATUS);
965962
writel(IRQ_EN_MASK, host->regs + SD_EMMC_IRQ_EN);
966963

967-
/* set config to sane default */
968-
meson_mmc_cfg_init(host);
969-
970964
ret = devm_request_threaded_irq(&pdev->dev, irq, meson_mmc_irq,
971965
meson_mmc_irq_thread, IRQF_SHARED,
972966
NULL, host);

0 commit comments

Comments
 (0)