From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com,
Liam Girdwood <lrg@slimlogic.co.uk>,
Alessandro Zummo <a.zummo@towertech.it>,
Samuel Ortiz <sameo@linux.intel.com>,
kyungmin.park@samsung.com, myungjoo.ham@gmail.com
Subject: Re: [PATCH v4 2/4] MAX8997/8966 PMIC Regulator Driver Initial Release
Date: Tue, 8 Mar 2011 23:46:29 +0000 [thread overview]
Message-ID: <20110308234629.GD2717@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1299573443-24784-3-git-send-email-myungjoo.ham@samsung.com>
On Tue, Mar 08, 2011 at 05:37:21PM +0900, MyungJoo Ham wrote:
> This patch supports PMIC/Regulator part of MAX8997/MAX8966 MFD.
> In this initial release, selecting voltages or current-limit
> and switching on/off the regulators are supported.
This looks pretty good, it's probably OK to apply as-is and clean up
some more stuff later on.
> +static int max8997_list_voltage_charger_cv(struct regulator_dev *rdev,
> + unsigned int selector)
> +{
> + int rid = max8997_get_rid(rdev);
> +
> + if (rid == MAX8997_CHARGER_CV) {
A little nicer to do if != then error out (saves indentation for the
entire rest of the function.
> +/*
> + * Assess the damage on the voltage setting of BUCK1,2,5 by the change.
> + *
> + * When GPIO-DVS mode is used for multiple bucks, changing the voltage value
> + * of one of the bucks may affect that of another buck, which is the side
> + * effect of the change (set_voltage). This function examines the GPIO-DVS
> + * configurations and checks whether such side-effect exists.
> + */
I'm not 100% sure I understand exactly what the mechanism for side
effects to occur is here (the code is a little abstruse, I'd expect it
to go through and set a flag if it finds a side effect would occur).
However, one thing that occurs to me is that you're not using the fact
that the regulator API passes in voltage ranges in the checks - you're
checking for any change, but it's possible that a side effect could
occur and still be in the range that was requested which should ideally
be allowed. For example, if the side effect would be to change from
1.1V to 1.2V but the requested range was 1.1-1.3V then while there is
a side effect all the requirements that drivers provided are still being
met so we don't need to worry.
This sort of side effect is something we shouild probably add to the
core, other hardware has the possibility of having similar gang control
of the regulators although the mechanism here seems unusually complex.
I don't think we need to do that for this driver though.
next prev parent reply other threads:[~2011-03-08 23:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-08 8:37 [PATCH v4 0/4] MAX8997/8966 MFD (including PMIC&RTC) Initial Release MyungJoo Ham
2011-03-08 8:37 ` [PATCH v4 1/4] MAX8997/8966 MFD Driver Initial Release (PMIC+RTC+MUIC+Haptic+...) MyungJoo Ham
2011-03-08 8:37 ` [PATCH v4 2/4] MAX8997/8966 PMIC Regulator Driver Initial Release MyungJoo Ham
2011-03-08 23:46 ` Mark Brown [this message]
2011-03-08 8:37 ` [PATCH v4 3/4] MAX8997/8966 MFD: Add IRQ control feature MyungJoo Ham
2011-03-08 8:37 ` [PATCH v4 4/4] MAX8997/8966 RTC Driver Initial Release MyungJoo Ham
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=20110308234629.GD2717@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=a.zummo@towertech.it \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@slimlogic.co.uk \
--cc=myungjoo.ham@gmail.com \
--cc=myungjoo.ham@samsung.com \
--cc=rtc-linux@googlegroups.com \
--cc=sameo@linux.intel.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;
as well as URLs for NNTP newsgroup(s).