Re: [PATCH 2/3] mmc: mmci: Implement .hw_reset() callback

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

 



On Sun, 20 Jun 2021 at 00:54, Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:
>
> The .hw_reset() callback is optionally called when attaching
> a host if and only if MMC_CAP_HW_RESET is set on the host,
> which can be done from the device tree by putting the flag
> cap-mmc-hw-reset in the DT node. This is sometimes helpful
> for eMMC.
>
> Cc: Russell King <linux@xxxxxxxxxxxxxxx>
> Cc: Yann Gautier <yann.gautier@xxxxxxxxxxx>
> Cc: Ludovic Barre <ludovic.barre@xxxxxx>
> Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
> ---
>  drivers/mmc/host/mmci.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
> index af2ed6013ef9..97fa5e67ca0c 100644
> --- a/drivers/mmc/host/mmci.c
> +++ b/drivers/mmc/host/mmci.c
> @@ -1883,6 +1883,15 @@ static int mmci_sig_volt_switch(struct mmc_host *mmc, struct mmc_ios *ios)
>         return ret;
>  }
>
> +static void mmci_hw_reset(struct mmc_host *mmc)
> +{
> +       struct mmci_host *host = mmc_priv(mmc);
> +
> +       reset_control_assert(host->rst);
> +       udelay(2);
> +       reset_control_deassert(host->rst);
> +}

Unfortunately, this is not the purpose of the ->hw_reset() ops.
Instead, it's supposed to be used to make a HW reset of the card, not
the controller.

> +
>  static struct mmc_host_ops mmci_ops = {
>         .request        = mmci_request,
>         .pre_req        = mmci_pre_request,
> @@ -1891,6 +1900,7 @@ static struct mmc_host_ops mmci_ops = {
>         .get_ro         = mmc_gpio_get_ro,
>         .get_cd         = mmci_get_cd,
>         .start_signal_voltage_switch = mmci_sig_volt_switch,
> +       .hw_reset       = mmci_hw_reset,
>  };
>
>  static void mmci_probe_level_translator(struct mmc_host *mmc)
> --
> 2.31.1
>

Kind regards
Uffe



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

  Powered by Linux