From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Lee Jones <lee.jones@linaro.org>
Cc: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>,
sameo@linux.intel.com, broonie@kernel.org, lgirdwood@gmail.com,
perex@perex.cz, tiwai@suse.de, alsa-devel@alsa-project.org,
patches@opensource.wolfsonmicro.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] mfd: arizona: Export function to control subsystem DVFS
Date: Mon, 16 Jun 2014 18:06:54 +0100 [thread overview]
Message-ID: <20140616170654.GB26741@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <20140616164242.GB14323@lee--X1>
On Mon, Jun 16, 2014 at 05:42:42PM +0100, Lee Jones wrote:
> On Mon, 09 Jun 2014, Richard Fitzgerald wrote:
>
> > Moving this control from being a side-effect of the LDO1
> > regulator driver to a specific exported function.
> >
> > Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
> > ---
> > drivers/mfd/arizona-core.c | 84 ++++++++++++++++++++++++++++++++++++++
> > include/linux/mfd/arizona/core.h | 12 +++++
> > 2 files changed, 96 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
> > index 58e1fe5..a1b4fe6 100644
> > --- a/drivers/mfd/arizona-core.c
> > +++ b/drivers/mfd/arizona-core.c
> > @@ -94,6 +94,89 @@ int arizona_clk32k_disable(struct arizona *arizona)
> > }
> > EXPORT_SYMBOL_GPL(arizona_clk32k_disable);
> >
> > +int arizona_dvfs_up(struct arizona *arizona, unsigned int mask)
> > +{
> > + unsigned int new_flags;
> > + int ret = 0;
> > +
> > + mutex_lock(&arizona->subsys_max_lock);
> > +
> > + new_flags = arizona->subsys_max_rq | mask;
>
> This doesn't look like a mask to me. It looks like you're setting
> flags rather than masking out bits?
Richard is on holiday so I will fill in for him. Yeah these are
flags I think mask is just a poorly chosen variable name.
>
> > + if (arizona->subsys_max_rq != new_flags) {
> > + switch (arizona->type) {
> > + case WM5102:
> > + case WM8997:
> > + ret = regulator_set_voltage(arizona->dcvdd,
> > + 1800000, 1800000);
> > + if (ret != 0) {
> > + dev_err(arizona->dev,
> > + "Failed to raise dcvdd (%u)\n", ret);
> > + goto err;
> > + }
> > +
> > + ret = regmap_update_bits(arizona->regmap,
> > + ARIZONA_DYNAMIC_FREQUENCY_SCALING_1,
> > + ARIZONA_SUBSYS_MAX_FREQ, 1);
> > + if (ret != 0) {
> > + dev_err(arizona->dev,
> > + "Failed to enable subsys max (%u)\n",
> > + ret);
> > + regulator_set_voltage(arizona->dcvdd,
> > + 1200000, 1800000);
> > + goto err;
> > + }
> > + break;
> > +
> > + default:
> > + break;
> > + }
>
> I don't really get this. What's the point in passing the mask
> parameter - I don't see it being used for anything in this routine? No
> matter what is passed in you always just turn on the same regulator.
>
> What am I missing?
As Mark said each bit represents something that can require the
higher clock rate. Any of the causes being active requires the
higher clock rate.
>
> > + arizona->subsys_max_rq = new_flags;
>
> This tabbing is incorrect.
Will get fixed with the other comments.
Thanks,
Charles
next prev parent reply other threads:[~2014-06-16 17:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-09 15:00 [PATCH 0/4] arizona: Improvements to codec DVFS control Richard Fitzgerald
2014-06-09 15:00 ` Richard Fitzgerald
2014-06-09 15:02 ` [PATCH 1/4] mfd: arizona: Export function to control subsystem DVFS Richard Fitzgerald
2014-06-16 16:42 ` Lee Jones
2014-06-16 16:48 ` Mark Brown
2014-06-16 17:09 ` Charles Keepax
2014-06-16 17:06 ` Charles Keepax [this message]
2014-06-09 15:03 ` [PATCH 2/4] ASoC: wm_adsp: Move DVFS control into codec driver Richard Fitzgerald
2014-06-11 10:54 ` Charles Keepax
2014-06-11 10:54 ` Charles Keepax
2014-06-09 15:03 ` [PATCH 3/4] ASoC: arizona: Add DVFS handling for sample rate control Richard Fitzgerald
2014-06-09 15:04 ` [PATCH 4/4] regulator: arizona-ldo1: Do not control clocking from regulator Richard Fitzgerald
2014-06-09 18:43 ` Mark Brown
2014-06-11 10:59 ` Charles Keepax
2014-06-11 10:59 ` Charles Keepax
2014-06-11 13: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=20140616170654.GB26741@opensource.wolfsonmicro.com \
--to=ckeepax@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lee.jones@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.wolfsonmicro.com \
--cc=perex@perex.cz \
--cc=rf@opensource.wolfsonmicro.com \
--cc=sameo@linux.intel.com \
--cc=tiwai@suse.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.