public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@gmail.com>
To: "Zhang, Sonic" <Sonic.Zhang@analog.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Liam Girdwood <lrg@ti.com>
Subject: RE: [PATCH v2] regulator: ad5398: Fix min/max current limit boundary checking
Date: Wed, 04 Jul 2012 11:18:48 +0800	[thread overview]
Message-ID: <1341371928.25411.2.camel@phoenix> (raw)
In-Reply-To: <DB904C5425BA6F4E8424B3B51A1414D1714080606C@NWD2CMBX1.ad.analog.com>


> >That is why we need to add:
> >if (min_uA < chip->min_uA)
> >        min_uA = chip->min_uA;
> >
> 
> Yes, but if you apply this logic to min_uA, you should apply the same logic to max_uA, even though it is not used in your application.

Actually, the logic is the same:
to find a supported (minmal) current in specified range.

The question is the equation used in current code does not allow
min_uA < chip->min_uA.
Setting min_uA = chip->min_uA if min_uA < chip->min_uA does make sense
because botch request actually returns the same current value.
( I mean no user visible change )

Adding below logic is not necessary.
( Note: Adding this or not does not have any user visible change, it's
just not necessary)

if (max_uA > chip->min_uA)
        max_uA = chip->max_uA;

It is not necessary because the equation to choose selector does not
depends on max_uA. No matter if we set max_uA = chip->max_uA or not in
this case, it does not impact the equation to choose the selector.

But, well, if you really prefer adding it. I'll send a v3 for it.
Just let me know how do you think.

Regards,
Axel



  reply	other threads:[~2012-07-04  3:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-03  7:42 [PATCH v2] regulator: ad5398: Fix min/max current limit boundary checking Axel Lin
2012-07-03  7:54 ` Zhang, Sonic
2012-07-03  8:06   ` Lars-Peter Clausen
2012-07-03  8:13     ` Zhang, Sonic
2012-07-03  8:24       ` Lars-Peter Clausen
2012-07-03  8:33         ` Zhang, Sonic
2012-07-03  9:44           ` Axel Lin
2012-07-03  9:51             ` Zhang, Sonic
2012-07-03 11:36               ` Axel Lin
2012-07-04  2:56                 ` Zhang, Sonic
2012-07-04  3:18                   ` Axel Lin [this message]
2012-07-04  3:44                     ` Zhang, Sonic

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=1341371928.25411.2.camel@phoenix \
    --to=axel.lin@gmail.com \
    --cc=Sonic.Zhang@analog.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.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