[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190116123216.GC30993@ulmo>
Date: Wed, 16 Jan 2019 13:32:16 +0100
From: Thierry Reding <thierry.reding@...il.com>
To: Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Cc: Adrian Hunter <adrian.hunter@...el.com>,
Kishon Vijay Abraham I <kishon@...com>,
Ulf Hansson <ulf.hansson@...aro.org>,
Jonathan Hunter <jonathanh@...dia.com>,
linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-tegra@...r.kernel.org,
Gregory Clement <gregory.clement@...tlin.com>
Subject: Re: [PATCH 1/3] mmc: sdhci: use WP GPIO in sdhci_check_ro()
On Tue, Jan 15, 2019 at 05:28:35PM +0100, Thomas Petazzoni wrote:
> Even though SDHCI controllers may have a dedicated WP pin that can be
> queried using the SDHCI_PRESENT_STATE register, some platforms may
> chose to use a separate regular GPIO to route the WP signal. Such a
> GPIO is typically represented using the wp-gpios property in the
> Device Tree.
>
> Unfortunately, the current sdhci_check_ro() function does not make use
> of such GPIO when available: it either uses a host controller specific
> ->get_ro() operation, or uses the SDHCI_PRESENT_STATE. Several host
> controller specific ->get_ro() functions are implemented just to use
> check a WP GPIO state.
"use check" was probably meant to be just "check"?
>
> Instead of pushing this to more controller-specific implementations,
> let's handle this in the core SDHCI code, just like it is already done
> for the CD GPIO in sdhci_get_cd().
>
> The below patch simply changes sdhci_check_ro() to use the value of
> the WP GPIO if available. We need to adjust the prototype of the
> function to use a mmc_host* as argument instead of sdhci_host*, since
> the mmc_can_gpio_ro() and mmc_gpio_get_ro() helpers take a mmc_host*.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@...tlin.com>
> ---
> drivers/mmc/host/sdhci.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
Other than the typo in the commit message, this looks fine:
Reviewed-by: Thierry Reding <treding@...dia.com>
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists