From: k.kozlowski@samsung.com (Krzysztof Kozlowski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 4/7] regulator: Use ena_gpio supplied with generic regulator bindings
Date: Fri, 28 Nov 2014 15:14:04 +0100 [thread overview]
Message-ID: <1417184044.18249.39.camel@AMDC1943> (raw)
In-Reply-To: <20141128113859.GH7712@sirena.org.uk>
On pi?, 2014-11-28 at 11:38 +0000, Mark Brown wrote:
> On Fri, Nov 28, 2014 at 11:30:55AM +0100, Krzysztof Kozlowski wrote:
> > On czw, 2014-11-27 at 18:43 +0000, Mark Brown wrote:
>
> > > Why do we need some special magic operation for GPIO based enables
> > > that's separate to any other enable operation? This seems really
> > > confusing, if the constraint setting doesn't work somehow for GPIO based
> > > enables we should fix that. Though since this operation takes no
> > > parameters it's hard to see how it's supposed to apply constraints
> > > unless it reparses them which doesn't seem like a good idea...
>
> > The regulator driver no longer parses GPIO control from DTS. So somehow
> > it should be notified that regulator core parsed this and GPIO should be
> > enabled.
>
> > That is the purpose of ops->set_ena_gpio() call.
>
> This sort of thing is a sign that we're not saving much by moving the
> parsing to the core and perhaps there's more flexiblity here...
The driver receive callbacks (or exposes other kind of interface) for
other core-generalized code. Recent example is parsing regulator mode
(added by Javier) and .of_map_mode() callback.
I thought how to do this without this additional set_ena_gpio() call.
One way would be to extend the regulator modes (FAST/IDLE/STANDBY/ and
GPIO) but this would look somehow unnatural.
> It's
> also not something that should be in the constraints handling, it's not
> something that constrains the regulator.
Got it.
> > > > +static int regulator_ena_gpio_setup(struct regulator_dev *rdev,
> > > > + const struct regulator_config *config,
> > > > + const struct regulator_init_data *init_data)
>
> > > Why is setting up the GPIO different to requesting it, especially given
> > > that we have an existing function called _request() which still exists?
>
> > Maybe the name was not a best choice. The setup calls request.
>
> > My patchset here tried to retain the compatibility with
> > "config.ena_gpio" way so the core would accept GPIOs passed in one of
> > two ways:
> > 1. old: config.ena_gpio,
> > 2. new: parsed by core from DTS.
>
> > The request function previously worked only on "config.ena_gpio" and I
> > changed it here to accept any GPIO. The setup uses one of GPIO methods
> > (old or new) and calls request with appropriate GPIO.
>
> We need to support both methods since not all the world is DT. What I
> can't tell is how this code achieves these objectives - it seems to be
> an awfully big patch if that's all it's supposed to be doing, I'd expect
> just a conditional where we try the two methods in turn. It may be that
> there's a good reason for all this but that needs to be made clear.
OK, I'll try to better describe the reason behind and to split the
patches (if possible).
Best regards,
Krzysztof
next prev parent reply other threads:[~2014-11-28 14:14 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-27 11:20 [PATCH v4 0/7] regulator: Parse ena_gpio in core, add GPIO to max77686 Krzysztof Kozlowski
2014-11-27 11:20 ` [PATCH v4 1/7] mfd: max77686/802: Remove support for board files Krzysztof Kozlowski
2014-11-27 13:03 ` Mark Brown
2014-11-27 13:08 ` Krzysztof Kozlowski
2014-11-27 11:20 ` [PATCH v4 2/7] regulator: dt-bindings: Document the ena-gpios property Krzysztof Kozlowski
2014-11-27 18:30 ` Mark Brown
2014-11-28 9:09 ` Krzysztof Kozlowski
2014-11-28 11:21 ` Mark Brown
2014-11-28 11:54 ` Krzysztof Kozlowski
2014-11-28 14:29 ` Mark Brown
2014-11-27 11:20 ` [PATCH v4 3/7] regulator: of: Parse ena-gpios property from DTS Krzysztof Kozlowski
2014-11-27 18:45 ` Mark Brown
2014-11-28 9:19 ` Krzysztof Kozlowski
2014-11-27 11:20 ` [PATCH v4 4/7] regulator: Use ena_gpio supplied with generic regulator bindings Krzysztof Kozlowski
2014-11-27 18:43 ` Mark Brown
2014-11-28 10:30 ` Krzysztof Kozlowski
2014-11-28 11:38 ` Mark Brown
2014-11-28 14:14 ` Krzysztof Kozlowski [this message]
2014-11-28 15:07 ` Mark Brown
2014-11-27 11:20 ` [PATCH v4 5/7] regulator: max77686: Add GPIO control Krzysztof Kozlowski
2014-11-27 11:20 ` [PATCH v4 6/7] mfd/regulator: dt-bindings: max77686: Document gpio properties Krzysztof Kozlowski
2014-11-27 11:20 ` [PATCH v4 7/7] ARM: dts: exynos4412-trats: Switch max77686 regulators to GPIO control Krzysztof Kozlowski
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=1417184044.18249.39.camel@AMDC1943 \
--to=k.kozlowski@samsung.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