Re: [PATCH] regulator: Set apply_uV only when min and max voltages aredefined

From: Karol Lewandowski
Date: Wed Jan 25 2012 - 05:33:19 EST


Cc added, link to original posting: https://lkml.org/lkml/2012/1/25/62

On 25.01.2012 11:15, Karol Lewandowski wrote:
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
--
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/