From 8828bae464b129abed95b748263f1ab53bdc5755 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Fri, 11 Oct 2013 09:32:18 +0800 Subject: regulator: Add REGULATOR_LINEAR_RANGE macro Add REGULATOR_LINEAR_RANGE macro and convert regulator drivers to use it. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- include/linux/regulator/driver.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 997ff5c4d880..edb11b716dd3 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h @@ -57,6 +57,15 @@ struct regulator_linear_range { 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. * -- cgit v1.2.3