public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ben Chuang <benchuanggli@gmail.com>,
	ulf.hansson@linaro.org, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org, ben.chuang@genesyslogic.com.tw,
	greg.tu@genesyslogic.com.tw
Subject: Re: [RFC PATCH V3 15/21] mmc: sdhci: UHS-II support, modify set_power() to handle vdd2
Date: Tue, 15 Sep 2020 15:24:43 +0900	[thread overview]
Message-ID: <20200915062443.GB2860208@laputa> (raw)
In-Reply-To: <f0ff6c0a-4029-72a9-559c-8930ef0ea8bb@intel.com>

Adrain,

On Mon, Sep 14, 2020 at 09:36:02AM +0300, Adrian Hunter wrote:
> On 14/09/20 8:45 am, AKASHI Takahiro wrote:
> > Adrian,
> > 
> > On Fri, Aug 21, 2020 at 05:11:18PM +0300, Adrian Hunter wrote:
> >> On 10/07/20 2:11 pm, Ben Chuang wrote:
> >>> From: AKASHI Takahiro <takahiro.akashi@linaro.org>
> >>>
> >>> VDD2 is used for powering UHS-II interface.
> >>> Modify sdhci_set_power_and_bus_voltage(), sdhci_set_power_noreg()
> >>> and sdhci_set_power_noreg() to handle VDD2.
> >>
> >> vdd2 is always 1.8 V and I suspect there may never be support for anything
> >> else, so we should start with 1.8 V only.
> > 
> > What do you mean here?
> > You don't want to add an extra argument, vdd2, to sdhci_set_power().
> > Correct?
> 
> Yes
> 
> > 
> >> Also can we create uhs2_set_power_reg() and uhs2_set_power_noreg() and use
> >> the existing ->set_power() callback
> > 
> > Again what do you expect here?
> > 
> > Do you want to see any platform-specific mmc driver who supports UHS-II
> > to implement its own call back like:
> 
> Not exactly.  I expect there to be a common implementation in sdhci-uhs2.c
> called sdhci_uhs2_set_power() for example, that drivers can use by setting
> their .set_power = sdhci_uhs2_set_power.  If they need platform-specific
> code as well then their platform-specific code can call
> sdhci_uhs2_set_power() if desired.
> 
> > 
> > void sdhci_foo_set_power(struct sdhci_host *host, unsigned char mode,
> >                                   unsigned short vdd)
> > {
> >         sdhci_set_power(host, mode,vdd);
> > 
> >         /* in case that sdhci_uhs2 module is not inserted */
> >         if (!(mmc->caps & MMC_CAP_UHS2))
> >                 return;
> > 
> >         /* vdd2 specific operation */
> >         if (IS_ERR_OR_NULL(host->mmc->supply.vmmc2))
> >                 sdhci_uhs2_set_power_noreg(host, mode);
> >         else
> >                 sdhci_uhs2_set_power_reg(host, mode);
> > 
> >         /* maybe more platform-specific initialization */
> > }
> > 
> > struct sdhci_ops sdhci_foo_ops = {
> >         .set_power = sdhci_foo_set_power,
> >         ...
> > }

What do you think about this logic in general?
(If necessary, read it replacing "foo" to "uhs2".)

What I'm concerned about is SDHCI_POWER_CONTROL register.
Vdd and vdd2 are controlled with corresponding bits in this register.
It seems to be "natural" to me that vdd and vdd2 are enabled
in a single function rather than putting them in separate ones.

In particular, in the case of sdhci_set_power_noreg(), there exist a couple
of "quirks" around writing the bits to SDHCI_POWER_CONTROL register.
I don't know how we should handle them if we have a separate function,
say, sdhci_uhs2_set_power_noreg().
Do you want to see a copy of the same logic in sdhci_uhs2_set_power_noreg()? 

-Takahiro Akashi


> > 
> > Is this what you mean?
> > (I'm not quite sure yet that sdhci_ush2_set_power_noreg() can be split off
> > from sdhci_set_power_noreg().)
> > 
> > -Takahiro Akashi

  reply	other threads:[~2020-09-15  6:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10 11:11 [RFC PATCH V3 15/21] mmc: sdhci: UHS-II support, modify set_power() to handle vdd2 Ben Chuang
2020-08-21 14:11 ` Adrian Hunter
2020-09-14  5:45   ` AKASHI Takahiro
2020-09-14  6:36     ` Adrian Hunter
2020-09-15  6:24       ` AKASHI Takahiro [this message]
2020-09-16  6:42         ` Adrian Hunter
2020-09-16  7:46           ` AKASHI Takahiro

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=20200915062443.GB2860208@laputa \
    --to=takahiro.akashi@linaro.org \
    --cc=adrian.hunter@intel.com \
    --cc=ben.chuang@genesyslogic.com.tw \
    --cc=benchuanggli@gmail.com \
    --cc=greg.tu@genesyslogic.com.tw \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    /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