Commit c0200efa authored by Martin Blumenstingl's avatar Martin Blumenstingl Committed by Ulf Hansson

mmc: meson-mx-sdhc: Remove .card_hw_reset callback

Commit 32f18e59 ("mmc: improve API to make clear hw_reset callback
is for cards") made it clear that the hw_reset callback is intended for
resetting the card. Remove the .card_hw_reset callback from the
meson-mx-sdhc-mmc driver because it's purpose is to reset the SDHC
controller (FIFOs, PHY, DMA interface, ...).

While here also rename and change the argument of meson_mx_sdhc_hw_reset
so it cannot be called by accident as a replacement for card_hw_reset in
the future.
Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Link: https://lore.kernel.org/r/20240217100200.1494980-3-martin.blumenstingl@googlemail.comSigned-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 4c5e3efa
...@@ -65,10 +65,8 @@ static const struct regmap_config meson_mx_sdhc_regmap_config = { ...@@ -65,10 +65,8 @@ static const struct regmap_config meson_mx_sdhc_regmap_config = {
.max_register = MESON_SDHC_CLK2, .max_register = MESON_SDHC_CLK2,
}; };
static void meson_mx_sdhc_hw_reset(struct mmc_host *mmc) static void meson_mx_sdhc_reset(struct meson_mx_sdhc_host *host)
{ {
struct meson_mx_sdhc_host *host = mmc_priv(mmc);
regmap_write(host->regmap, MESON_SDHC_SRST, MESON_SDHC_SRST_MAIN_CTRL | regmap_write(host->regmap, MESON_SDHC_SRST, MESON_SDHC_SRST_MAIN_CTRL |
MESON_SDHC_SRST_RXFIFO | MESON_SDHC_SRST_TXFIFO | MESON_SDHC_SRST_RXFIFO | MESON_SDHC_SRST_TXFIFO |
MESON_SDHC_SRST_DPHY_RX | MESON_SDHC_SRST_DPHY_TX | MESON_SDHC_SRST_DPHY_RX | MESON_SDHC_SRST_DPHY_TX |
...@@ -116,7 +114,7 @@ static void meson_mx_sdhc_wait_cmd_ready(struct mmc_host *mmc) ...@@ -116,7 +114,7 @@ static void meson_mx_sdhc_wait_cmd_ready(struct mmc_host *mmc)
dev_warn(mmc_dev(mmc), dev_warn(mmc_dev(mmc),
"Failed to poll for CMD_BUSY while processing CMD%d\n", "Failed to poll for CMD_BUSY while processing CMD%d\n",
host->cmd->opcode); host->cmd->opcode);
meson_mx_sdhc_hw_reset(mmc); meson_mx_sdhc_reset(host);
} }
ret = regmap_read_poll_timeout(host->regmap, MESON_SDHC_ESTA, esta, ret = regmap_read_poll_timeout(host->regmap, MESON_SDHC_ESTA, esta,
...@@ -127,7 +125,7 @@ static void meson_mx_sdhc_wait_cmd_ready(struct mmc_host *mmc) ...@@ -127,7 +125,7 @@ static void meson_mx_sdhc_wait_cmd_ready(struct mmc_host *mmc)
dev_warn(mmc_dev(mmc), dev_warn(mmc_dev(mmc),
"Failed to poll for ESTA[13:11] while processing CMD%d\n", "Failed to poll for ESTA[13:11] while processing CMD%d\n",
host->cmd->opcode); host->cmd->opcode);
meson_mx_sdhc_hw_reset(mmc); meson_mx_sdhc_reset(host);
} }
} }
...@@ -495,7 +493,6 @@ static int meson_mx_sdhc_execute_tuning(struct mmc_host *mmc, u32 opcode) ...@@ -495,7 +493,6 @@ static int meson_mx_sdhc_execute_tuning(struct mmc_host *mmc, u32 opcode)
} }
static const struct mmc_host_ops meson_mx_sdhc_ops = { static const struct mmc_host_ops meson_mx_sdhc_ops = {
.card_hw_reset = meson_mx_sdhc_hw_reset,
.request = meson_mx_sdhc_request, .request = meson_mx_sdhc_request,
.set_ios = meson_mx_sdhc_set_ios, .set_ios = meson_mx_sdhc_set_ios,
.card_busy = meson_mx_sdhc_card_busy, .card_busy = meson_mx_sdhc_card_busy,
...@@ -618,7 +615,7 @@ static irqreturn_t meson_mx_sdhc_irq_thread(int irq, void *irq_data) ...@@ -618,7 +615,7 @@ static irqreturn_t meson_mx_sdhc_irq_thread(int irq, void *irq_data)
} }
if (cmd->error == -EIO || cmd->error == -ETIMEDOUT) if (cmd->error == -EIO || cmd->error == -ETIMEDOUT)
meson_mx_sdhc_hw_reset(host->mmc); meson_mx_sdhc_reset(host);
else if (cmd->data) else if (cmd->data)
/* /*
* Clear the FIFOs after completing data transfers to prevent * Clear the FIFOs after completing data transfers to prevent
...@@ -728,7 +725,7 @@ static void meson_mx_sdhc_init_hw(struct mmc_host *mmc) ...@@ -728,7 +725,7 @@ static void meson_mx_sdhc_init_hw(struct mmc_host *mmc)
{ {
struct meson_mx_sdhc_host *host = mmc_priv(mmc); struct meson_mx_sdhc_host *host = mmc_priv(mmc);
meson_mx_sdhc_hw_reset(mmc); meson_mx_sdhc_reset(host);
regmap_write(host->regmap, MESON_SDHC_CTRL, regmap_write(host->regmap, MESON_SDHC_CTRL,
FIELD_PREP(MESON_SDHC_CTRL_RX_PERIOD, 0xf) | FIELD_PREP(MESON_SDHC_CTRL_RX_PERIOD, 0xf) |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment