Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 71e3e00c authored by Andreas Fenkart's avatar Andreas Fenkart Committed by Ulf Hansson
Browse files

mmc: meson-gx: enable signal re-sampling together with tuning



card detection fails on "BeeLink Mini M8 SII" if enabled too early
mmc1: error -110 whilst initialising MMC card

Fixes: 71645e65 ("mmc: meson-gx: add signal resampling")
Signed-off-by: default avatarAndreas Fenkart <afenkart@gmail.com>
Reviewed-by: default avatarJerome Brunet <jbrunet@baylibre.com>
Tested-by: default avatarJerome Brunet <jbrunet@baylibre.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 2bd44dad
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -740,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)
{
	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);
}
@@ -770,6 +775,9 @@ static void meson_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
		if (!IS_ERR(mmc->supply.vmmc))
			mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd);

		/* disable signal resampling */
		writel(0, host->regs + host->data->adjust);

		/* Reset rx phase */
		clk_set_phase(host->rx_clk, 0);

@@ -1168,7 +1176,7 @@ static int meson_mmc_get_cd(struct mmc_host *mmc)

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,
			  ilog2(SD_EMMC_CFG_RESP_TIMEOUT));
@@ -1179,10 +1187,6 @@ static void meson_mmc_cfg_init(struct meson_host *host)
	cfg |= CFG_ERR_ABORT;

	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)