aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTushar Behera <tushar.behera@linaro.org>2012-04-12 13:59:24 +0530
committerTushar Behera <tushar.behera@linaro.org>2012-05-17 10:37:08 +0530
commitddd650ba4490a4da1cf49cd7f2b9f2a414637b3d (patch)
treeccf4cc51473d1f6caae5ea8d9972f23b28cb4345
parentf3dcdcfb66d8de33c465256b579477369de14145 (diff)
regulator: Add {get/set}_voltage ops for dummy regulatortracking-samslt-dummy_reg-3.4-2012.05-1tracking-samslt-dummy_reg-3.4-2012.05-0
Required ops and constraints are added to the dummy regulator. This also fixes following runtime messages. s3c-sdhci s3c-sdhci.2: could not set regulator OCR (-22) Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
-rw-r--r--drivers/regulator/dummy.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/drivers/regulator/dummy.c b/drivers/regulator/dummy.c
index 0ee00de4be72..fba6adf46886 100644
--- a/drivers/regulator/dummy.c
+++ b/drivers/regulator/dummy.c
@@ -25,9 +25,34 @@
struct regulator_dev *dummy_regulator_rdev;
-static struct regulator_init_data dummy_initdata;
+static struct regulator_init_data dummy_initdata = {
+ .constraints = {
+ .name = "dummy",
+ .min_uV = 0,
+ .max_uV = 5000000,
+ .apply_uV = 0,
+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
+ .state_mem = {
+ .disabled = 0,
+ },
+ },
+};
+
+static int dummy_get_voltage(struct regulator_dev *rdev)
+{
+ return 0;
+}
-static struct regulator_ops dummy_ops;
+static int dummy_set_voltage(struct regulator_dev *rdev,
+ int min_uV, int max_uV, unsigned *selector)
+{
+ return 0;
+}
+
+static struct regulator_ops dummy_ops = {
+ .get_voltage = dummy_get_voltage,
+ .set_voltage = dummy_set_voltage,
+};
static struct regulator_desc dummy_desc = {
.name = "dummy",