devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Robin Gong <b38343@freescale.com>
Cc: linux-kernel@vger.kernel.org, grant.likely@linaro.org,
	rob.herring@calxeda.com, lgirdwood@gmail.com,
	shawn.guo@linaro.org, devicetree-discuss@lists.ozlabs.org,
	linux-doc@vger.kernel.org, rob@landley.net
Subject: Re: [PATCH v2] regulator: pfuze100: add pfuze100 regulator driver
Date: Mon, 15 Jul 2013 16:09:28 +0100	[thread overview]
Message-ID: <20130715150928.GI11538@sirena.org.uk> (raw)
In-Reply-To: <20130712161511.GA21203@Robin-OptiPlex-780>

[-- Attachment #1: Type: text/plain, Size: 1871 bytes --]

On Sat, Jul 13, 2013 at 12:15:12AM +0800, Robin Gong wrote:

Please fix your mail program to word wrap between paragraphs.

> On Fri, Jul 12, 2013 at 03:40:37PM +0100, Mark Brown wrote:

> > > +static const int pfuze100_swbst[] = {
> > > +	5000000, 5050000, 5100000, 5150000,
> > > +};

> > This looks like a linear map, the steps are all 50mV?

> Yes, but the swbst regulator share the same define type with the vsnvs
> regulator, and the later voltage table is not linear, so I use
> volt_table in swbst regulator . I don't want to  add another regulator
> type for this.

You should do so; it's not hard.

> > You should just register all the regulators rather than only registering
> > those that the user explicitly selects.  This allows users to inpect the
> > current configuration and simplifies the code - for example you don't
> > need to count the DT nodes and you can just have a simple array in the
> > platform data (see how wm831x does this for an example).

> Yes, it will simplifies the code, but sometimes we will not use all
> the regulators on boards, in this case, Is it better that only
> register the available regulators?

It's better to have everything, that way the framework can do things
like power down unused regualtors that got left enabled.

> > You should really be doing this on a copy of the regulators table rather
> > than on the table itself.

> everyone of the four regulators(SW2~SW4) has two different linear
> voltage table which decided by the specific bit(one regulator ,one
> different bit) . So  will modify the voltage table dynamically before
> regulator register. I think this way is more simple , although looks
> little weird and uncomfortable.

You're missing the point here.  You shouldn't be modifying global data
(which should be marked as const) at all, you should be working on a
copy of it if it needs modifying.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-07-15 15:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-12  4:54 [PATCH v2] regulator: pfuze100: add pfuze100 regulator driver Robin Gong
     [not found] ` <1373604855-17714-1-git-send-email-b38343-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2013-07-12 14:40   ` Mark Brown
2013-07-12 16:15     ` Robin Gong
2013-07-15 15:09       ` Mark Brown [this message]
2013-07-15  1:22 ` Shawn Guo
2013-07-15  6:40   ` Robin Gong
2013-07-15  6:49     ` Shawn Guo

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=20130715150928.GI11538@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=b38343@freescale.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=shawn.guo@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;
as well as URLs for NNTP newsgroup(s).