public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Jisheng Zhang <jszhang@marvell.com>
To: Zhoujie Wu <zjwu@marvell.com>
Cc: ulf.hansson@linaro.org, adrian.hunter@intel.com,
	linux-mmc@vger.kernel.org, zmxu@marvell.com, nadavh@marvell.com,
	xigu@marvell.com, dingwei@marvell.com, kostap@marvell.com,
	hannah@marvell.com, hongd@marvell.com, dougj@marvell.com,
	ygao@marvell.com, liuw@marvell.com,
	gregory.clement@free-electrons.com,
	thomas.petazzoni@free-electrons.com
Subject: Re: [PATCH] mmc: sdhci-xenon: add gpio hard reset support
Date: Wed, 16 Aug 2017 10:22:16 +0800	[thread overview]
Message-ID: <20170816102216.3908b2d1@xhacker> (raw)
In-Reply-To: <5993790D.40305@marvell.com>

On Tue, 15 Aug 2017 15:43:25 -0700 Zhoujie Wu  wrote:

> Hi Jisheng,
> 
> On 08/14/2017 07:56 PM, Jisheng Zhang wrote:
> > On Mon, 14 Aug 2017 15:19:16 -0700 Zhoujie Wu wrote:
> >  
> >> On some platforms, like armada3700,  SD card need to
> >> do hard reset by gpio toggling to make it work properly
> >> after warm reset the board.
> >> Add gpio hard reset feature for this purpose.
> >>
> >> Signed-off-by: Zhoujie Wu <zjwu@marvell.com>
> >> ---
> >>   drivers/mmc/host/sdhci-xenon.c | 49 +++++++++++++++++++++++++++++++++++++++---
> >>   drivers/mmc/host/sdhci-xenon.h |  4 ++++
> >>   2 files changed, 50 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/mmc/host/sdhci-xenon.c b/drivers/mmc/host/sdhci-xenon.c
> >> index edd4d915..54a7057 100644
> >> --- a/drivers/mmc/host/sdhci-xenon.c
> >> +++ b/drivers/mmc/host/sdhci-xenon.c
> >> @@ -18,6 +18,8 @@
> >>   #include <linux/ktime.h>
> >>   #include <linux/module.h>
> >>   #include <linux/of.h>
> >> +#include <linux/of_gpio.h>
> >> +
> >>   
> >>   #include "sdhci-pltfm.h"
> >>   #include "sdhci-xenon.h"
> >> @@ -210,12 +212,25 @@ static void xenon_set_uhs_signaling(struct sdhci_host *host,
> >>   	sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2);
> >>   }
> >>   
> >> +static void xenon_hw_reset(struct sdhci_host *host)
> >> +{
> >> +	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> >> +	struct xenon_priv *priv = sdhci_pltfm_priv(pltfm_host);
> >> +
> >> +	if (priv->reset_gpio) {
> >> +		gpiod_set_value_cansleep(priv->reset_gpio, 0);
> >> +		msleep(30);
> >> +		gpiod_set_value_cansleep(priv->reset_gpio, 1);  
> > Does setting the pin to low means assert reset in your HW? You'd better
> > invert the logic in the DT.
> >
> > As for reset gpio, logic "1" means assert the reset, logic "0" means
> > de-assert the reset.  
> 
> Actually what I want is to cut the sd card power and enable it after that.
> the gpio is used to controller the power supply to sd card.
> I need this gpio init as low, then set it from 0->1 to do a power cycle.

If so, name the "reset" in the commit msg and source as "power", I.E

"mmc: sdhci-xenon: add power gpio support"

and

"power_gpio"

      reply	other threads:[~2017-08-16  2:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-14 22:19 [PATCH] mmc: sdhci-xenon: add gpio hard reset support Zhoujie Wu
2017-08-15  2:11 ` Shawn Lin
2017-08-15 22:40   ` [EXT] " Zhoujie Wu
2017-08-15 23:27     ` Zhoujie Wu
2017-08-16  0:32     ` Shawn Lin
2017-08-16  2:44       ` Jisheng Zhang
2017-08-16 22:46       ` Zhoujie Wu
2017-08-17  0:47         ` Shawn Lin
2017-08-17 18:34           ` Zhoujie Wu
2017-08-15  2:56 ` Jisheng Zhang
2017-08-15 22:43   ` Zhoujie Wu
2017-08-16  2:22     ` Jisheng Zhang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170816102216.3908b2d1@xhacker \
    --to=jszhang@marvell.com \
    --cc=adrian.hunter@intel.com \
    --cc=dingwei@marvell.com \
    --cc=dougj@marvell.com \
    --cc=gregory.clement@free-electrons.com \
    --cc=hannah@marvell.com \
    --cc=hongd@marvell.com \
    --cc=kostap@marvell.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=liuw@marvell.com \
    --cc=nadavh@marvell.com \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=ulf.hansson@linaro.org \
    --cc=xigu@marvell.com \
    --cc=ygao@marvell.com \
    --cc=zjwu@marvell.com \
    --cc=zmxu@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox