From: pHilipp Zabel <philipp.zabel@gmail.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: linux-kernel@vger.kernel.org,
Robert Jarzmik <robert.jarzmik@free.fr>,
Liam Girdwood <lrg@slimlogic.co.uk>
Subject: Re: [PATCH] regulator/max1586: support increased V3 voltage range
Date: Tue, 26 May 2009 23:26:32 +0200 [thread overview]
Message-ID: <74d0deb30905261426w7739c394ge3246c80890f1de6@mail.gmail.com> (raw)
In-Reply-To: <20090526204302.GB4951@sirena.org.uk>
Hi Mark,
thanks for the review.
On Tue, May 26, 2009 at 10:43 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> On Tue, May 26, 2009 at 09:39:08PM +0200, Philipp Zabel wrote:
>
> Please don't use my @wolfsonmicro.com address for anything kernel
> related - use @opensource.wolfsonmicro.com or @sirena.org.uk.
Copy&paste error, won't happen again.
>> -#define MAX1586_V3_MIN_UV 700000
>> -#define MAX1586_V3_MAX_UV 1475000
>> -#define MAX1586_V3_STEP_UV 25000
>
> I don't see these values being re-added elsewhere in the code?
Ouh, strange thinko. For some reason I left them out of the switch
statement because they felt like default values. And why wouldn't the
structure be initialised with default values, right? Will add them
there.
>> + selector = (min_uV - max1586->min_uV) * 31 / range_uV;
>> + if (max1586_v3_calc_voltage(max1586, selector) > max_uV)
>> return -EINVAL;
>
> Might be nice to have a #define for the 31 but then it's the only
> reference to it.
There is a "#define MAX1586_V3_MAX_VSEL 31" already, I'll use that.
(And there's a second reference in _calc_voltage)
>> rdev = kzalloc(sizeof(struct regulator_dev *) * (MAX1586_V6 + 1),
>> GFP_KERNEL);
>> if (!rdev)
>> - return -ENOMEM;
>> + goto out;
>> +
>> + max1586 = kzalloc(sizeof(struct max1586_data *), GFP_KERNEL);
>> + if (!max1586)
>> + goto out_unmap;
>
> Could perhaps make these one struct? But either way is fine.
Yes, I could put the struct regulator_dev[] at the end of max1586_data.
>> + switch (pdata->r24) {
>> + case MAX1586_R24_3k32:
>
> This switch statement doesn't reject invalid values which I'd expect it
> to and...
>
>> + * @r24: external regulator to increase V3 range
>> + * (0, MAX1586_R24_3k32, MAX1586_R24_5k11 or MAX1586_R24_7k5)
>
> ...I think I'd be more comfortable if an explicit configuration were
> required for the no feedback case since otherwise the driver will
> happily start up and begin producing the wrong output voltages by
> default on platforms which have this feedback resistor fitted. This
> could make the system non-obviously unstable and in the worst case
> possibly lead to long term hardware damage if something is consistently
> driven over voltage.
Ok. I'll add something like "#define MAX1586_NO_R24 -1" and reject
everything else with -EINVAL.
regards
Philipp
next prev parent reply other threads:[~2009-05-26 21:26 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-26 19:39 Philipp Zabel
2009-05-26 20:43 ` Mark Brown
2009-05-26 21:26 ` pHilipp Zabel [this message]
2009-05-26 21:31 ` Robert Jarzmik
2009-05-26 23:40 ` pHilipp Zabel
2009-05-27 15:12 ` Robert Jarzmik
2009-05-28 5:15 ` Philipp Zabel
2009-05-28 5:15 ` [PATCH 1/3] regulator/max1586: support increased V3 voltage range Philipp Zabel
2009-05-28 8:59 ` Mark Brown
2009-05-28 19:00 ` [PATCH] regulator/max1586: fix V3 gain calculation integer overflow Philipp Zabel
2009-05-28 20:36 ` Robert Jarzmik
2009-05-29 9:04 ` Liam Girdwood
2009-05-28 18:58 ` [PATCH 1/3] regulator/max1586: support increased V3 voltage range Robert Jarzmik
2009-05-28 19:01 ` pHilipp Zabel
2009-05-28 20:36 ` Robert Jarzmik
2009-05-28 5:15 ` [PATCH 4/5] pxa/mioa701: add V3 gain configuration for Maxim 1586 voltage regulator Philipp Zabel
2009-05-28 5:16 ` pHilipp Zabel
2009-05-29 6:22 ` Robert Jarzmik
2009-06-01 5:39 ` Eric Miao
2009-05-28 5:15 ` [PATCH 3/3] pxa/hx4700: add Maxim 1587A " Philipp Zabel
2009-06-01 5:37 ` Eric Miao
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=74d0deb30905261426w7739c394ge3246c80890f1de6@mail.gmail.com \
--to=philipp.zabel@gmail.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@slimlogic.co.uk \
--cc=robert.jarzmik@free.fr \
/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
all inboxes | Powered by JetHome®