regulator: Add REGULATOR_LINEAR_RANGE macro
[deliverable/linux.git] / include / linux / regulator / driver.h
index 67e13aa5a4781d2c8fdfa8fc902d2bbc90f2a3a0..edb11b716dd3bd1d1374fee7f86983b2b8de13c4 100644 (file)
@@ -40,23 +40,32 @@ enum regulator_status {
 };
 
 /**
+ * struct regulator_linear_range - specify linear voltage ranges
+ *
  * Specify a range of voltages for regulator_map_linar_range() and
  * regulator_list_linear_range().
  *
  * @min_uV:  Lowest voltage in range
- * @max_uV:  Highest voltage in range
  * @min_sel: Lowest selector for range
  * @max_sel: Highest selector for range
  * @uV_step: Step size
  */
 struct regulator_linear_range {
        unsigned int min_uV;
-       unsigned int max_uV;
        unsigned int min_sel;
        unsigned int max_sel;
        unsigned int uV_step;
 };
 
+/* Initialize struct regulator_linear_range */
+#define REGULATOR_LINEAR_RANGE(_min_uV, _min_sel, _max_sel, _step_uV)  \
+{                                                                      \
+       .min_uV         = _min_uV,                                      \
+       .min_sel        = _min_sel,                                     \
+       .max_sel        = _max_sel,                                     \
+       .uV_step        = _step_uV,                                     \
+}
+
 /**
  * struct regulator_ops - regulator operations.
  *
This page took 0.025235 seconds and 5 git commands to generate.