From: broonie@opensource.wolfsonmicro.com (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] regulator: pm8921-regulator: Add regulator driver for PM8921
Date: Sat, 2 Apr 2011 11:50:13 +0900 [thread overview]
Message-ID: <20110402025012.GD25424@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <4D965F9D.3060907@codeaurora.org>
On Fri, Apr 01, 2011 at 04:28:29PM -0700, David Collins wrote:
> the device while asleep. However, the regulator would need to be
> configured for pin control to ensure that it is enabled when the second
> consumer expects it to be. It is also normal to mask off pin control if
> the second consumer is to be disabled.
This all seems fairly standard and like many other regulators except for
the the masking off the pin control. The only unusual thing is that the
hardware control is being managed by software at runtime, usually it's
set up and then left alone by software.
The first thing I'm thinking here is that this maps fairly well onto a
semi-virtual regulator where the operations map onto the control for the
hardware mode. The enable/disable control via the pin is totally
orthogonal to the control via the regular register interface, and it
sounds like the mode control is too though that was less clear to me.
Enabling would then translate into turning pin control on rather than
actually enabling but that seems OK. Does that sound like it'd work?
> >> We consider this to be the native PMIC 8921 regulator driver because it
> >> accesses the PMIC directly. There will be a subsequent PMIC 8921
> >> regulator driver which issues requests to a separate processor which
> >> aggregates our requests with those of other SOC processors.
> > That's not an issue - the regulator API won't write to the regulators
> > unless the machine driver explicitly tells it that this is OK so all
> > that will happen is that we'll be able to read back the state of the
> > regulators directly. If your driver is modifying the state of the
> > regulators without the API telling it to then we should fix that as the
> > no-write behaviour is an important safety feature.
> The regulator probe function reads the regulator register values to figure
> out the initial hardware state. It also sets some regulator controls not
> handled by other regulator framework callback functions; e.g.: pull down
That just sounds like platform data which could just work in the same
way as the regulator core - no platform data would mean nothing gets
changed.
> enable. I'm not sure if this could be moved into an init_data
> regulator_init callback because that pointer would need to be specified in
> the board file where the function would be unknown.
I'm sorry, I don't understand what you're saying here. Could you
clarify?
> Also, it would pollute the system with unusable devices if all natively
> controlled regulator devices were registered if the shared driver was
> being used for many regulators.
Depends if you view it as pollution or not; also note that the devices
aren't totally unusuable as you can still use them for readback.
> I guess I will change the set voltage callbacks so that they round up the
> vprog value:
> vprog = (min_uV - band_min_uV + step_size - 1) / step_size
> instead of
> vprog = (min_uV - band_min_uV) / step_size
> It will also check that the resulting output voltage is <= max_uV.
That sounds right, yes.
next prev parent reply other threads:[~2011-04-02 2:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-30 22:16 [PATCH 0/2] regulator: msm: Add PM8921 regulator driver David Collins
2011-03-30 22:17 ` [PATCH 1/2] regulator: pm8921-regulator: Add regulator driver for PM8921 David Collins
2011-03-30 23:46 ` Mark Brown
2011-03-31 1:37 ` David Collins
2011-03-31 23:44 ` Mark Brown
2011-04-01 23:28 ` David Collins
2011-04-02 2:50 ` Mark Brown [this message]
2011-04-04 17:13 ` David Collins
2011-04-04 23:19 ` Mark Brown
2011-03-30 22:17 ` [PATCH 2/2] msm: board-8960: Add support for pm8921-regulator David Collins
2011-03-31 0:10 ` Mark Brown
2011-04-29 23:07 ` [PATCH v2 0/2] regulator: msm: Add PM8921 regulator driver David Collins
2011-04-29 23:09 ` [PATCH v2 1/2] regulator: pm8921-regulator: Add regulator driver for PM8921 David Collins
2011-04-29 23:11 ` [PATCH v2 2/2] msm: board-8960: Add support for pm8921-regulator David Collins
2011-05-03 16:08 ` Mark Brown
2011-05-03 9:48 ` [PATCH v2 0/2] regulator: msm: Add PM8921 regulator driver Mark Brown
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=20110402025012.GD25424@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=linux-arm-kernel@lists.infradead.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).