Re: [PATCH] regulator: core: export function to check if regulator always on

From: Richard Fitzgerald
Date: Wed Nov 12 2014 - 11:59:09 EST


On Wed, Nov 12, 2014 at 02:58:02PM +0000, Mark Brown wrote:
> On Wed, Nov 12, 2014 at 01:07:35PM +0000, Richard Fitzgerald wrote:
> > On Wed, Nov 12, 2014 at 11:35:41AM +0000, Mark Brown wrote:
>
> > > I'd like to see a user here,
>
> > The user will be the Arizona codec drivers but I wanted to upstream
> > this patch first for discussion.
>
> My point is that the code using the API is useful input to the
> discussion.
>

Ok, I'll push up a patch showing what I'm intending to do with this
new function

> > > and I'd also like to understand why this is
> > > a better approach than using a callback to postpone these expensive
> > > operations until the regulator is actually powered off like we already
> > > do for some things like register cache resyncs. That is normally better
> > > since it also avoids the work in cases where the regulator isn't always
> > > on like reenabling during a delayed powerdown or shared regulators.
>
> > The runtime_suspend() for the Arizona drivers has to do a bunch of
> > preparation before disabling the DCVDD regulator (and there's more
> > preparation steps that need to be upstreamed). There's no point doing
> > any of this if at the end the regulator isn't going to switch off.
>
> I'm not sure that this addresses my concern about postponing the
> expensive work until the regulator is actually powered off at all?
>

The point is that the work we want to avoid has to happen while the
regulator is still powered up. We can't just rip power from the codec,
it has to be setup ready for the DCVDD to be turned off. So it's
pre-power down work we're avoiding by knowing that a power-down will
never actually happen, it's not post-power-down work.
But as you say the code that's going to use it will help explain.


> > > You're also missing a !CONFIG_REGULATOR stub.
>
> > It's there at the end of the patch, returning 1.
>
> Bah, so it is.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/