Re: [PATCH 2/4] regulator: add ab8500 per-regulator startup delay

From: Linus Walleij
Date: Thu Mar 10 2011 - 10:43:55 EST


On Thu, Mar 10, 2011 at 2:49 PM, Mark Brown
<broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> On Thu, Mar 10, 2011 at 02:43:41PM +0100, Linus Walleij wrote:
>> From: Bengt Jonsson <bengt.g.jonsson@xxxxxxxxxxxxxx>
>>
>> Since some regulators can take some time to come online, we
>> define a per-regulator millisecond delay value and assign
>> to the slow TV-out regulator.
>
> You should be implementing the enable_time() operation for the regulator
> for this.

I looked into it, but the core implicitly only does delays after
enable(), and our delays affect disable() and set_voltage()
as well. disable() may look superfluous but I bet there may be
cases where not having a voltage fully disabled before doing
something will cause immesurable harm.

I was thinking about extending the present mechanism in
core by refactoring the signature of the enable_time()
as such:

/* Operations that we want to enumerate to the enable_time() call */
enum regulator_op {
REGULATOR_ENABLE,
REGULATOR_DISABLE,
REGULATOR_SET_VOLTAGE,
REGULATOR_SET_MODE,
};

/* Time taken to enable the regulator */
int (*enable_time) (struct regulator_dev *, enum regulator_op op);

Then I'll have to break out the delay code and refactor a bit,
altering the few drivers using it I guess.

Sounds like a plan?

Yours,
Linus Walleij
--
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/