regulator: palmas: fix build warnings
[linux-2.6.git] / drivers / regulator / lp3972.c
index e07062f..49a15ee 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/bug.h>
 #include <linux/err.h>
 #include <linux/i2c.h>
+#include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/regulator/driver.h>
 #include <linux/regulator/lp3972.h>
@@ -292,7 +293,8 @@ static int lp3972_ldo_get_voltage(struct regulator_dev *dev)
 }
 
 static int lp3972_ldo_set_voltage(struct regulator_dev *dev,
-                                 int min_uV, int max_uV)
+                                 int min_uV, int max_uV,
+                                 unsigned int *selector)
 {
        struct lp3972 *lp3972 = rdev_get_drvdata(dev);
        int ldo = rdev_get_id(dev) - LP3972_LDO1;
@@ -313,6 +315,8 @@ static int lp3972_ldo_set_voltage(struct regulator_dev *dev,
        if (val > LP3972_LDO_VOL_MAX_IDX(ldo) || vol_map[val] > max_vol)
                return -EINVAL;
 
+       *selector = val;
+
        shift = LP3972_LDO_VOL_CONTR_SHIFT(ldo);
        ret = lp3972_set_bits(lp3972, LP3972_LDO_VOL_CONTR_REG(ldo),
                LP3972_LDO_VOL_MASK(ldo) << shift, val << shift);
@@ -416,7 +420,8 @@ static int lp3972_dcdc_get_voltage(struct regulator_dev *dev)
 }
 
 static int lp3972_dcdc_set_voltage(struct regulator_dev *dev,
-                                 int min_uV, int max_uV)
+                                  int min_uV, int max_uV,
+                                  unsigned int *selector)
 {
        struct lp3972 *lp3972 = rdev_get_drvdata(dev);
        int buck = rdev_get_id(dev) - LP3972_DCDC1;
@@ -438,6 +443,8 @@ static int lp3972_dcdc_set_voltage(struct regulator_dev *dev,
            vol_map[val] > max_vol)
                return -EINVAL;
 
+       *selector = val;
+
        ret = lp3972_set_bits(lp3972, LP3972_BUCK_VOL1_REG(buck),
                                LP3972_BUCK_VOL_MASK, val);
        if (ret)
@@ -548,7 +555,7 @@ static int __devinit setup_regulators(struct lp3972 *lp3972,
        for (i = 0; i < pdata->num_regulators; i++) {
                struct lp3972_regulator_subdev *reg = &pdata->regulators[i];
                lp3972->rdev[i] = regulator_register(&regulators[reg->id],
-                                       lp3972->dev, reg->initdata, lp3972);
+                               lp3972->dev, reg->initdata, lp3972, NULL);
 
                if (IS_ERR(lp3972->rdev[i])) {
                        err = PTR_ERR(lp3972->rdev[i]);