regulator: max77663: Changed SD0 & SD1 regulator data
Sumit Sharma [Wed, 6 Feb 2013 10:51:14 +0000 (15:51 +0530)]
Added support for changing SD0 & SD1 regulator data for
MAX77663D PMU version

Bug 1220546

Change-Id: I2b0f396a2f2d171f5657c2d3cd845d3b1ffa16d3
Signed-off-by: Sumit Sharma <sumsharma@nvidia.com>
Reviewed-on: http://git-master/r/197932
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

drivers/regulator/max77663-regulator.c

index cb845d5..60d7736 100644 (file)
@@ -99,6 +99,7 @@
 
 /* Voltage */
 #define SDX_VOLT_MASK                  0xFF
+#define SD0_VOLT_MASK                  0x3F
 #define SD1_VOLT_MASK                  0x3F
 #define LDO_VOLT_MASK                  0x3F
 
@@ -839,6 +840,7 @@ static int max77663_regulator_probe(struct platform_device *pdev)
        int id;
        int reg_id;
        int reg_count;
+       u8 val;
 
        if (!pdata) {
                dev_err(&pdev->dev, "No Platform data\n");
@@ -853,6 +855,18 @@ static int max77663_regulator_probe(struct platform_device *pdev)
                return -ENOMEM;
        }
 
+       ret = max77663_read_chip_version(pdev->dev.parent, &val);
+       if (ret == MAX77663_DRV_24) {
+               max77663_regs_info[MAX77663_REGULATOR_ID_SD0].volt_mask =
+                                                               SD0_VOLT_MASK;
+               max77663_regs_info[MAX77663_REGULATOR_ID_SD0].min_uV = 800000;
+               max77663_regs_info[MAX77663_REGULATOR_ID_SD0].max_uV = 1587500;
+               max77663_regs_info[MAX77663_REGULATOR_ID_SD1].volt_mask =
+                                                               SDX_VOLT_MASK;
+               max77663_regs_info[MAX77663_REGULATOR_ID_SD1].min_uV = 600000;
+               max77663_regs_info[MAX77663_REGULATOR_ID_SD1].max_uV = 3387500;
+       }
+
        for (id = 0; id < reg_count; ++id) {
                reg_pdata = pdata->regulator_pdata[id];
                if (!reg_pdata) {