Messages in this thread | | | Date | Wed, 25 Jan 2012 11:15:12 +0100 | From | Karol Lewandowski <> | Subject | Re: [PATCH] regulator: Set apply_uV only when min and max voltages are defined |
| |
On 25.01.2012 10:31, Karol Lewandowski wrote: > apply_uV is errornously set when regulator is instantiated from device > tree, even when it doesn't contain any voltage constraints. ... > - if (constraints->min_uV == constraints->max_uV) > + if (min_uV&& max_uV&& constraints->min_uV == constraints->max_uV) > constraints->apply_uV = true;
While this fixes obvious error I doubt that apply_uV should be set based on min max equality. It have required fix to fixed regulator[1] as well for max8997[2]. It'll probably require fixes in other places too.
Wouldn't it be better to explicitly use property like "regulator-voltage-apply" in DT to set apply_uV?
if (min_uV && max_uV && constraints->min_uV == constraints->max_uV && of_find_property "regulator-voltage-apply") constraints->apply_uV = true;
This would be consistent with handling of this flag from platform data.
[1] http://permalink.gmane.org/gmane.linux.kernel/1234969 [2] http://permalink.gmane.org/gmane.linux.kernel/1243714
Regards, -- Karol Lewandowski | Samsung Poland R&D Center | Linux/Platform
| |