Re: [PATCH 5/5] mmc: core: Implement ->sw_reset bus ops for SDIO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ulf,

On 2018/4/6 4:19, Ulf Hansson wrote:
Let's implement the ->sw_reset() bus ops to allow SDIO func drivers, in
particular, to make a SW reset without doing a full power cycle of the SDIO
card.

Signed-off-by: Ulf Hansson <ulf.hansson@xxxxxxxxxx>
---
  drivers/mmc/core/sdio.c | 13 +++++++++++++
  1 file changed, 13 insertions(+)

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 0124e0e..088c80c 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -1044,6 +1044,18 @@ static int mmc_sdio_hw_reset(struct mmc_host *host)
  	return mmc_sdio_power_restore(host);
  }
+static int mmc_sdio_sw_reset(struct mmc_host *host)
+{
+	mmc_set_clock(host, host->f_init);

This reminds me to think that why we don't fold it
into mmc_set_initial_state()? See mmc_power_up() calls
mmc_set_initial_state () and then the clock is set to host->f_init
later.

+	sdio_reset(host);
+	mmc_go_idle(host);
+

mmc_sdio_reinit_card() will reset I/O and memory portion internally.
So maybe we don't need these extra reset ahead?

+	mmc_set_initial_state(host);
+	mmc_set_initial_signal_voltage(host);
+
+	return mmc_sdio_reinit_card(host, 0);
+}
+
  static const struct mmc_bus_ops mmc_sdio_ops = {
  	.remove = mmc_sdio_remove,
  	.detect = mmc_sdio_detect,
@@ -1055,6 +1067,7 @@ static const struct mmc_bus_ops mmc_sdio_ops = {
  	.power_restore = mmc_sdio_power_restore,
  	.alive = mmc_sdio_alive,
  	.hw_reset = mmc_sdio_hw_reset,
+	.sw_reset = mmc_sdio_sw_reset,
  };

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux