From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 01/01] regulator: support max8649
Date: Mon, 25 Jan 2010 13:56:28 +0000 [thread overview]
Message-ID: <20100125135628.GB26613@rakim.wolfsonmicro.main> (raw)
In-Reply-To: <771cded01001250301q465a9f8ma484f597ae9a292f@mail.gmail.com>
On Mon, Jan 25, 2010 at 06:01:41AM -0500, Haojian Zhuang wrote:
> On Tue, Jan 12, 2010 at 6:51 AM, Mark Brown
> >> + if (pdata->ramp_timing) {
> >> + info->ramp_timing = pdata->ramp_timing;
> >> + max8649_set_bits(info->i2c, MAX8649_RAMP, MAX8649_RAMP_MASK,
> >> + info->ramp_timing << 5);
> >> + }
> > You might want to implement the new enable_time() API for this.
> This ramp timing is the time interval of each step on adjusting
> voltage. I just want to control the timing in initialization.
If this applies to any voltage change at all then rather than just power
on I need to finish off the stuff I've been sitting on for handling slew
times for voltage changes. If the regulator hasn't yet reached the
requested output when the consumer tries using it the consumer might get
broken.
If the ramp also gets applied when initially turning on the regulator
you'd still want to implement enable_time() for the same reason.
> enable_time() is only called before enabling regulator. And I don't
> understand what would be done in enable_time().
You'd return the amount of time taken to turn on the regulator and get
the output voltage stable in the current configuration. This will then
be used by the core to ensure that the consumer only tries to use the
regulator once it's fully enabled.
> +static int max8649_set_mode(struct regulator_dev *rdev, unsigned int mode)
> +{
> + struct max8649_regulator_info *info = rdev_get_drvdata(rdev);
> +
> + switch (mode) {
> + case REGULATOR_MODE_FAST:
> + case REGULATOR_MODE_NORMAL:
> + max8649_set_bits(info->i2c, info->vol_reg, MAX8649_FORCE_PWM,
> + MAX8649_FORCE_PWM);
> + break;
Are you sure about this? I'd expect to see force PWM used only for
_FAST, for _NORMAL pulse skipping is usually desired behaviour.
> + case REGULATOR_MODE_IDLE:
> + case REGULATOR_MODE_STANDBY:
> + max8649_set_bits(info->i2c, info->vol_reg,
> + MAX8649_FORCE_PWM, 0);
I'd just leave these unimplemented (there's no need to support all
modes) and make sure that this ties in with...
> +static unsigned int max8649_get_mode(struct regulator_dev *rdev)
> +{
> + struct max8649_regulator_info *info = rdev_get_drvdata(rdev);
> + int ret;
> +
> + ret = max8649_reg_read(info->i2c, info->vol_reg);
> + if (ret & MAX8649_FORCE_PWM)
> + return REGULATOR_MODE_NORMAL;
> + return REGULATOR_MODE_IDLE;
...this.
next prev parent reply other threads:[~2010-01-25 13:56 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <771cded01001120041ue24edabk8e4638ef7151c947@mail.gmail.com>
[not found] ` <771cded01001120051l44fd76bx80d2fd4b6f60bd0b@mail.gmail.com>
2010-01-12 11:51 ` Mark Brown
2010-01-25 11:01 ` Haojian Zhuang
2010-01-25 13:56 ` Mark Brown [this message]
2010-01-26 6:26 ` Haojian Zhuang
2010-01-26 11:01 ` Liam Girdwood
2010-01-26 11:51 ` Haojian Zhuang
2010-01-26 11:04 ` Mark Brown
2010-01-26 11:54 ` Haojian Zhuang
2010-01-26 12:00 ` Mark Brown
2010-01-26 12:14 ` Haojian Zhuang
2010-01-26 12:41 ` Mark Brown
2010-01-26 16:10 ` Liam Girdwood
2010-03-08 6:28 ` Haojian Zhuang
2010-03-08 8:18 ` Liam Girdwood
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=20100125135628.GB26613@rakim.wolfsonmicro.main \
--to=broonie@opensource.wolfsonmicro.com \
--cc=haojian.zhuang@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@slimlogic.co.uk \
/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
Powered by JetHome