From: Mark Brown <broonie@kernel.org>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
David Collins <collinsd@codeaurora.org>,
devicetree@vger.kernel.org
Subject: Re: [PATCH] regulator: Add SPMI regulator driver
Date: Thu, 14 May 2015 20:20:18 +0100 [thread overview]
Message-ID: <20150514192018.GU2761@sirena.org.uk> (raw)
In-Reply-To: <5553F434.4020102@codeaurora.org>
[-- Attachment #1: Type: text/plain, Size: 3991 bytes --]
On Wed, May 13, 2015 at 06:02:44PM -0700, Stephen Boyd wrote:
> This is about configuring the regulator to switch mode between HPM and
> LPM automatically based on current. You're right that it's not about
> pulse skipping, but it isn't about letting other processors control
> things either. I think you're thinking about pin control?
Possibly, this stuff is all system jargon heavy and I've not context
switched that in recently. The above sounds like it pretty much *is*
the equivalent of pulse skipping in which case it's much more like the
normal modes (that we were going to abandon...).
> The register field is called AUTO_MODE, so I'm finding it hard to come
> up with a better name. Perhaps qcom,auto-efficient-mode-enable?
> qcom,auto-current-mode-enable?
This definitely sounds like traditional regulator modes.
> >> +- qcom,bypass-mode-enable:
> >> + Usage: optional
> >> + Value type: <u32>
> >> + Description: 1 = Enable bypass mode for an LDO type regulator so that
> >> + it acts like a switch and simply outputs its input
> >> + voltage. 0 = Do not enable bypass mode.
> > We have generic regulator API support for this, we should have a generic
> > DT binding for it.
> Given that regulator_allow_bypass() is a consumer facing API should I
> just change this to regulator-allow-bypass and then add a set_bypass() op?
Yes.
> >> +- qcom,soft-start-enable:
> >> + Usage: optional
> >> + Value type: <u32>
> >> + Description: 1 = Enable soft start for LDO and voltage switch type
> >> + regulators so that output voltage slowly ramps up when the
> >> + regulator is enabled. 0 = Disable soft start
> > These also seem like generic properties (we don't currently have generic
> > APIs for them but these are by no means the only regulators I've seen
> > with these features).
> So for these sorts of generic properties how do I get them all the way
> into the driver? Are you suggesting adding new ops for setting pull-down
> and soft-start-enable and then parsing DT properties, setting those in
> the regulation_constraints structure, and then calling the ops when we
> apply constraints in set_machine_constraints()?
Yeah, if it's becoming something that does need setting from DT (which
it seems to) then we probably need to go through all that. With helpers
and so on.
> >> +- qcom,boost-current-limit:
> >> + Usage: optional
> >> + Value type: <u32>
> >> + Description: This property sets the current limit of boost type
> >> + regulators; supported values are:
> >> + 0 = 300 mA
> > Again seems generic - there seems like overlap with your own OCP
> > properties further above.
> Yes it's generic. This property only applies to boost regulators on this
> PMIC whereas OCP is only used for voltage switch type regulators. I
> wonder if this should be done via regulator-min-microamp and
> regulator-max-microamp being set to the same value and then implementing
> a .set_current_limit() function?
Yes, that was what I was thinking. Perhaps a current-limit or something
property rather than the min and max thing for clarity (to avoid
confusion with actual current regulators).
> >> +#define VOLTAGE_RANGE(_range_sel, _min_uV, _set_point_min_uV, \
> >> + _set_point_max_uV, _max_uV, _step_uV) \
> >> + { \
> > A lot of these macros have very generic names. Also I have to say I'm a
> > bit confused about what a set point is and how it's used, "allowed
> > voltage" doesn't mean a huge amount in comparison with "programmable
> > voltage".
> These regulators have two registers. The first register says what range
> (or row in the *_ranges arrays) we should use. The second register is a
> selector that's used in the linear range calculation min_uV + sel *
> step. The complication is here because we want to try and keep using the
Hardware engineers are truly innovative and creative people sometimes.
That all makes sense, but the thing about the generic names still
applies - at least namespace them please.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2015-05-14 19:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-12 21:39 Stephen Boyd
2015-05-13 11:41 ` Mark Brown
2015-05-14 1:02 ` Stephen Boyd
2015-05-14 19:20 ` Mark Brown [this message]
2015-05-16 1:50 ` Frank Rowand
2015-05-16 10:54 ` 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=20150514192018.GU2761@sirena.org.uk \
--to=broonie@kernel.org \
--cc=collinsd@codeaurora.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sboyd@codeaurora.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
all inboxes | Powered by JetHome®