From: Mark Brown <broonie@kernel.org>
To: Martin Fuzzey <mfuzzey@parkeon.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Rob Herring <robh+dt@kernel.org>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/2] Regulator: add driver for Freescale MC34708
Date: Mon, 11 May 2015 15:09:38 +0100 [thread overview]
Message-ID: <20150511140938.GA3458@sirena.org.uk> (raw)
In-Reply-To: <555070A7.2060808@parkeon.com>
[-- Attachment #1: Type: text/plain, Size: 2219 bytes --]
On Mon, May 11, 2015 at 11:04:39AM +0200, Martin Fuzzey wrote:
Please leave blank lines between paragraphs and between old text and new
text, it makes things a lot easier to read - this is extremely difficult
to follow.
> On 30/04/15 21:45, Mark Brown wrote:
> >On Tue, Apr 28, 2015 at 04:17:40PM +0200, Martin Fuzzey wrote:
> >>Signed-off-by: Martin Fuzzey <mfuzzey@parkeon.com>
> >Please use subject lines reflecting the style for the subsystem.
> You mean
> regulator: mc34708: Add driver?
> I ommitted the mc34708 part because it's a new driver
That and the fact that you spelt regulator Regulator.
> >Ick, this looks confusing - it's wrapping something which should hopefully
> >be a regmap in multiple layer. The bitfield access helper does seem
> >reasonable though.
> The reason for this wrapping stuff is that this is not a standalone driver,
> rather a "subdriver" of the mc13xxx MFD driver.
> That already exists and supports the mc34708 (for the RTC for example) but
> not yet the regulator parts.
> It does not expose regmap (although it does use it internally).
Well, fix that then...
> Would you be happier if I rename this to mc34708_set_bitfield() for example?
I guess, it would probably be preferable to go with the more common
_update_bits() pattern though.
> Then the way I handle all this is just use mc34708_sw_find_hw_mode_sel() to
> recalculate the hardware mode by walking the tables every time something
> needs to change.
> The table is different depending on the regulator type.
>
> This turned out to be *much* simpler that the initial open code approach I
> first tried.
This all needs to be apparent to someone reading the code. Probably
having comments about what individual functions are supposed to be doing
would help a lot here.
> >I don't really understand what the above is supposed to do, some
> >comments would probably help.
> We need to store the desired modes (for normal and standby state) since
> .set_mode() and .set_suspend_mode() are not always called before enable() /
> disable().
The point is that this needs to be something someone reading the code
could reasonably be expected to understand.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2015-05-11 14:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-28 14:17 [PATCH 0/2] regulator: Add regulator driver for the MC34708 PMIC Martin Fuzzey
2015-04-28 14:17 ` [PATCH 1/2] Regulator: mc34708: Add DT binding documentation Martin Fuzzey
2015-04-30 18:56 ` Mark Brown
2015-05-01 10:34 ` Stefan Wahren
2015-05-01 11:01 ` Mark Brown
2015-05-01 12:33 ` Stefan Wahren
2015-05-01 14:03 ` Mark Brown
2015-05-11 9:36 ` Javier Martinez Canillas
2015-04-28 14:17 ` [PATCH 2/2] Regulator: add driver for Freescale MC34708 Martin Fuzzey
2015-04-29 8:42 ` Paul Bolle
2015-04-30 19:45 ` Mark Brown
2015-05-11 9:04 ` Martin Fuzzey
2015-05-11 14:09 ` Mark Brown [this message]
2015-05-01 10:38 ` Stefan Wahren
2015-05-01 10:26 ` [PATCH 0/2] regulator: Add regulator driver for the MC34708 PMIC Stefan Wahren
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=20150511140938.GA3458@sirena.org.uk \
--to=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mfuzzey@parkeon.com \
--cc=robh+dt@kernel.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®