Re: [PATCH 1/4] regulator: add set_voltage_time[_sel]infrastructure

From: Mark Brown
Date: Fri Mar 11 2011 - 07:25:45 EST


On Fri, Mar 11, 2011 at 11:54:28AM +0100, Linus Walleij wrote:

> + /* Don't obtain this if it's not going to be used */
> + if (rdev->desc->ops->set_voltage_time) {
> + int old_voltage = -1;
> +
> + ret = _regulator_get_voltage(rdev);
> + if (ret < 0)
> + return ret;
> + old_voltage = ret;
> + /* Here we can figure out desired delay immediately */
> + ret = rdev->desc->ops->set_voltage_time(rdev, old_voltage,
> + min_uV, max_uV);

I think this should be taking to as the argument rather than min and
max. We're going to figure out an actual concrete voltage or selector
during the set voltage process so there's no point in having to go
through and pick a specific voltage twice. Actually, given that
list_voltage() pretty much mandates selectors we can probably just only
have a selector based version of this API then use the selector that got
returned when we set the voltage.

I also think we should be exporting this to consumers as things like
cpufreq are interested in the latency for voltage changes.
--
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/