Re: [PATCH] regulator: core: Make regulator object reflect configured voltage

2014-02-05 Thread Mark Brown
On Wed, Feb 05, 2014 at 10:00:15AM -0800, Bjorn Andersson wrote: > On Tue, Feb 4, 2014 at 12:00 PM, Mark Brown wrote: > > So we should be changing the code to allow a set_voltage() that sets the > > voltage to the existing voltage regardless of constraints allowing a > > change then - that's

Re: [PATCH] regulator: core: Make regulator object reflect configured voltage

2014-02-05 Thread Bjorn Andersson
On Tue, Feb 4, 2014 at 12:00 PM, Mark Brown wrote: > On Tue, Feb 04, 2014 at 11:09:03AM -0800, Bjorn Andersson wrote: > >> I have a regulator that's being configured from DT as: >> regulator-min-microvolt = <295>; >> regulator-max-microvolt = <295>; > >> In the consumer I do

Re: [PATCH] regulator: core: Make regulator object reflect configured voltage

2014-02-05 Thread Bjorn Andersson
On Tue, Feb 4, 2014 at 12:00 PM, Mark Brown broo...@kernel.org wrote: On Tue, Feb 04, 2014 at 11:09:03AM -0800, Bjorn Andersson wrote: I have a regulator that's being configured from DT as: regulator-min-microvolt = 295; regulator-max-microvolt = 295; In the consumer I do

Re: [PATCH] regulator: core: Make regulator object reflect configured voltage

2014-02-05 Thread Mark Brown
On Wed, Feb 05, 2014 at 10:00:15AM -0800, Bjorn Andersson wrote: On Tue, Feb 4, 2014 at 12:00 PM, Mark Brown broo...@kernel.org wrote: So we should be changing the code to allow a set_voltage() that sets the voltage to the existing voltage regardless of constraints allowing a change then -

Re: [PATCH] regulator: core: Make regulator object reflect configured voltage

2014-02-04 Thread Mark Brown
On Tue, Feb 04, 2014 at 11:09:03AM -0800, Bjorn Andersson wrote: > I have a regulator that's being configured from DT as: > regulator-min-microvolt = <295>; > regulator-max-microvolt = <295>; > In the consumer I do regulator_set_voltage(2.95V). > As min == max the voltage is applied by

Re: [PATCH] regulator: core: Make regulator object reflect configured voltage

2014-02-04 Thread Bjorn Andersson
On Tue, Feb 4, 2014 at 10:18 AM, Mark Brown wrote: > On Tue, Feb 04, 2014 at 10:02:14AM -0800, Bjorn Andersson wrote: >> On Tue, Feb 4, 2014 at 3:05 AM, Mark Brown wrote: > >> > Why not do this at the time we apply the voltage? That would seem to be >> > more robust, doing it in a separate

Re: [PATCH] regulator: core: Make regulator object reflect configured voltage

2014-02-04 Thread Mark Brown
On Tue, Feb 04, 2014 at 10:02:14AM -0800, Bjorn Andersson wrote: > On Tue, Feb 4, 2014 at 3:05 AM, Mark Brown wrote: > > Why not do this at the time we apply the voltage? That would seem to be > > more robust, doing it in a separate place means that we might update one > > bit of code and not

Re: [PATCH] regulator: core: Make regulator object reflect configured voltage

2014-02-04 Thread Bjorn Andersson
On Tue, Feb 4, 2014 at 3:05 AM, Mark Brown wrote: > On Mon, Feb 03, 2014 at 09:54:28PM -0800, Bjorn Andersson wrote: > >> + /* >> + * Make the regulator reflect the configured voltage selected in >> + * machine_constraints_voltage() >> + */ >> + if

Re: [PATCH] regulator: core: Make regulator object reflect configured voltage

2014-02-04 Thread Mark Brown
On Mon, Feb 03, 2014 at 09:54:28PM -0800, Bjorn Andersson wrote: > + /* > + * Make the regulator reflect the configured voltage selected in > + * machine_constraints_voltage() > + */ > + if (rdev->constraints->apply_uV && > + rdev->constraints->min_uV ==

Re: [PATCH] regulator: core: Make regulator object reflect configured voltage

2014-02-04 Thread Mark Brown
On Mon, Feb 03, 2014 at 09:54:28PM -0800, Bjorn Andersson wrote: + /* + * Make the regulator reflect the configured voltage selected in + * machine_constraints_voltage() + */ + if (rdev-constraints-apply_uV + rdev-constraints-min_uV ==

Re: [PATCH] regulator: core: Make regulator object reflect configured voltage

2014-02-04 Thread Bjorn Andersson
On Tue, Feb 4, 2014 at 3:05 AM, Mark Brown broo...@kernel.org wrote: On Mon, Feb 03, 2014 at 09:54:28PM -0800, Bjorn Andersson wrote: + /* + * Make the regulator reflect the configured voltage selected in + * machine_constraints_voltage() + */ + if

Re: [PATCH] regulator: core: Make regulator object reflect configured voltage

2014-02-04 Thread Mark Brown
On Tue, Feb 04, 2014 at 10:02:14AM -0800, Bjorn Andersson wrote: On Tue, Feb 4, 2014 at 3:05 AM, Mark Brown broo...@kernel.org wrote: Why not do this at the time we apply the voltage? That would seem to be more robust, doing it in a separate place means that we might update one bit of

Re: [PATCH] regulator: core: Make regulator object reflect configured voltage

2014-02-04 Thread Bjorn Andersson
On Tue, Feb 4, 2014 at 10:18 AM, Mark Brown broo...@kernel.org wrote: On Tue, Feb 04, 2014 at 10:02:14AM -0800, Bjorn Andersson wrote: On Tue, Feb 4, 2014 at 3:05 AM, Mark Brown broo...@kernel.org wrote: Why not do this at the time we apply the voltage? That would seem to be more robust,

Re: [PATCH] regulator: core: Make regulator object reflect configured voltage

2014-02-04 Thread Mark Brown
On Tue, Feb 04, 2014 at 11:09:03AM -0800, Bjorn Andersson wrote: I have a regulator that's being configured from DT as: regulator-min-microvolt = 295; regulator-max-microvolt = 295; In the consumer I do regulator_set_voltage(2.95V). As min == max the voltage is applied by the

[PATCH] regulator: core: Make regulator object reflect configured voltage

2014-02-03 Thread Bjorn Andersson
In the case when a regulator is initialized from DT with equal min and max voltages the voltage is applied on initialization and future calls to regulator_set_voltage fails. This behavious is different than if the regulator is configured to be a span and therefor requires logic to handle this

[PATCH] regulator: core: Make regulator object reflect configured voltage

2014-02-03 Thread Bjorn Andersson
In the case when a regulator is initialized from DT with equal min and max voltages the voltage is applied on initialization and future calls to regulator_set_voltage fails. This behavious is different than if the regulator is configured to be a span and therefor requires logic to handle this