diff mbox

[RFC,1/2] regulator: core: Add regulator_set_voltage_min()

Message ID 1366372554-20866-2-git-send-email-taras@ti.com (mailing list archive)
State RFC, archived
Headers show

Commit Message

Taras Kondratiuk April 19, 2013, 11:55 a.m. UTC
Sometimes it is a need to constrain only a minimum voltage
and let system constraints to limit maximum.
Add a new function regulator_set_voltage_min() for this.

Signed-off-by: Taras Kondratiuk <taras@ti.com>
---
 include/linux/regulator/consumer.h |    6 ++++++
 1 file changed, 6 insertions(+)

Comments

Mark Brown April 22, 2013, 1:19 p.m. UTC | #1
On Fri, Apr 19, 2013 at 02:55:53PM +0300, Taras Kondratiuk wrote:
> Sometimes it is a need to constrain only a minimum voltage
> and let system constraints to limit maximum.
> Add a new function regulator_set_voltage_min() for this.

I don't believe you on this one.  It is going to be a very unusual
system which has a maximum supply voltage specified at over 4kV (or
more) which is what INT_MAX will come out as - there will be some
electrical specs for what voltages can be tolerated sustainably.
diff mbox

Patch

diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index 7bc732c..d40d909 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -380,4 +380,10 @@  static inline int regulator_is_supported_voltage_tol(struct regulator *regulator
 					      target_uV + tol_uV);
 }
 
+static inline int regulator_set_voltage_min(struct regulator *regulator,
+					    int new_uV)
+{
+	return regulator_set_voltage(regulator, new_uV, INT_MAX);
+}
+
 #endif