Messages in this thread | | | Date | Fri, 11 Mar 2011 12:25:37 +0000 | From | Mark Brown <> | Subject | Re: [PATCH 1/4] regulator: add set_voltage_time[_sel] infrastructure |
| |
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.
| |