[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7b5c5f2e-a10f-88b5-907c-dfbf6eaa43c6@intel.com>
Date: Tue, 17 Mar 2020 11:57:07 +0200
From: Adrian Hunter <adrian.hunter@...el.com>
To: Michał Mirosław <mirq-linux@...e.qmqm.pl>,
Ludovic Desroches <ludovic.desroches@...rochip.com>,
Ulf Hansson <ulf.hansson@...aro.org>,
Nicolas Ferre <nicolas.ferre@...rochip.com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc: linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mmc: sdhci-of-at91: fix cd-gpios for SAMA5D2
On 15/03/20 6:44 pm, Michał Mirosław wrote:
> SAMA5D2x doesn't drive CMD line if GPIO is used as CD line (at least
> SAMA5D27 doesn't). Fix this by forcing card-detect in the module
> if module-controlled CD is not used.
>
> Fixed commit addresses the problem only for non-removable cards. This
> amends it to also cover gpio-cd case.
>
> Cc: stable@...r.kernel.org
> Fixes: 7a1e3f143176 ("mmc: sdhci-of-at91: force card detect value for non removable devices")
> Signed-off-by: Michał Mirosław <mirq-linux@...e.qmqm.pl>
Acked-by: Adrian Hunter <adrian.hunter@...el.com>
> ---
> drivers/mmc/host/sdhci-of-at91.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-of-at91.c b/drivers/mmc/host/sdhci-of-at91.c
> index d90f4ed18283..8f8da2fe48a9 100644
> --- a/drivers/mmc/host/sdhci-of-at91.c
> +++ b/drivers/mmc/host/sdhci-of-at91.c
> @@ -185,7 +185,8 @@ static void sdhci_at91_reset(struct sdhci_host *host, u8 mask)
>
> sdhci_reset(host, mask);
>
> - if (host->mmc->caps & MMC_CAP_NONREMOVABLE)
> + if ((host->mmc->caps & MMC_CAP_NONREMOVABLE)
> + || mmc_gpio_get_cd(host->mmc) >= 0)
> sdhci_at91_set_force_card_detect(host);
>
> if (priv->cal_always_on && (mask & SDHCI_RESET_ALL))
> @@ -487,8 +488,11 @@ static int sdhci_at91_probe(struct platform_device *pdev)
> * detection procedure using the SDMCC_CD signal is bypassed.
> * This bit is reset when a software reset for all command is performed
> * so we need to implement our own reset function to set back this bit.
> + *
> + * WA: SAMA5D2 doesn't drive CMD if using CD GPIO line.
> */
> - if (host->mmc->caps & MMC_CAP_NONREMOVABLE)
> + if ((host->mmc->caps & MMC_CAP_NONREMOVABLE)
> + || mmc_gpio_get_cd(host->mmc) >= 0)
> sdhci_at91_set_force_card_detect(host);
>
> pm_runtime_put_autosuspend(&pdev->dev);
>
Powered by blists - more mailing lists