regulator: tps80031: make regualtor_init_data as pointer type
Laxman Dewangan [Wed, 1 Aug 2012 08:51:19 +0000 (13:51 +0530)]
The platform data of tps80031 have the regualtor_init_data as
non-pointer type. Converting this as pointer type for aligning
to regulator driver policy and easy support for DT.

Change-Id: I07f574953b09e0ed9ec3735d0ee7999ca35bee61
Reviewed-on: http://git-master/r/119974
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

arch/arm/mach-tegra/board-enterprise-power.c
drivers/regulator/tps80031-regulator.c
include/linux/regulator/tps80031-regulator.h

index 1c836d6..b457cda 100644 (file)
@@ -236,26 +236,26 @@ static struct regulator_consumer_supply tps80031_battery_charge_supply[] = {
 #define TPS_PDATA_INIT(_id, _sname, _minmv, _maxmv, _supply_reg, _always_on,           \
        _boot_on, _apply_uv, _init_uV, _init_enable, _init_apply,                       \
        _flags, _ectrl, _delay)                                                         \
-       static struct tps80031_regulator_platform_data pdata_##_id##_##_sname = {       \
-               .regulator = {                                                          \
-                       .constraints = {                                                \
-                               .name = tps80031_rails(_id),                            \
-                               .min_uV = (_minmv)*1000,                                \
-                               .max_uV = (_maxmv)*1000,                                \
-                               .valid_modes_mask = (REGULATOR_MODE_NORMAL |            \
-                                               REGULATOR_MODE_STANDBY),                \
-                               .valid_ops_mask = (REGULATOR_CHANGE_MODE |              \
-                                               REGULATOR_CHANGE_STATUS |               \
-                                               REGULATOR_CHANGE_VOLTAGE),              \
-                               .always_on = _always_on,                                \
-                               .boot_on = _boot_on,                                    \
-                               .apply_uV = _apply_uv,                                  \
-                       },                                                              \
-                       .num_consumer_supplies =                                        \
-                               ARRAY_SIZE(tps80031_##_id##_supply_##_sname),           \
-                       .consumer_supplies = tps80031_##_id##_supply_##_sname,          \
-                       .supply_regulator = _supply_reg,                                \
+       static struct regulator_init_data reg_idata_##_id##_##_sname = {                \
+               .constraints = {                                                        \
+                       .name = tps80031_rails(_id),                                    \
+                       .min_uV = (_minmv)*1000,                                        \
+                       .max_uV = (_maxmv)*1000,                                        \
+                       .valid_modes_mask = (REGULATOR_MODE_NORMAL |                    \
+                                       REGULATOR_MODE_STANDBY),                        \
+                       .valid_ops_mask = (REGULATOR_CHANGE_MODE |                      \
+                                       REGULATOR_CHANGE_STATUS |                       \
+                                       REGULATOR_CHANGE_VOLTAGE),                      \
+                       .always_on = _always_on,                                        \
+                       .boot_on = _boot_on,                                            \
+                       .apply_uV = _apply_uv,                                          \
                },                                                                      \
+               .num_consumer_supplies =                                                \
+                       ARRAY_SIZE(tps80031_##_id##_supply_##_sname),                   \
+               .consumer_supplies = tps80031_##_id##_supply_##_sname,                  \
+       };                                                                              \
+       static struct tps80031_regulator_platform_data pdata_##_id##_##_sname = {       \
+               .reg_init_data = &reg_idata_##_id##_##_sname,                           \
                .init_uV =  _init_uV * 1000,                                            \
                .init_enable = _init_enable,                                            \
                .init_apply = _init_apply,                                              \
index b2391c9..cb063ae 100644 (file)
@@ -1055,7 +1055,7 @@ static int __devinit tps80031_regulator_probe(struct platform_device *pdev)
                return err;
 
        rdev = regulator_register(&ri->desc, &pdev->dev,
-                               &tps_pdata->regulator, ri);
+                               tps_pdata->reg_init_data, ri);
        if (IS_ERR_OR_NULL(rdev)) {
                dev_err(&pdev->dev, "failed to register regulator %s\n",
                                ri->desc.name);
index 1609eee..4058f7c 100644 (file)
@@ -66,7 +66,7 @@ enum {
 /*
  * struct tps80031_regulator_platform_data - tps80031 regulator platform data.
  *
- * @regulator: The regulator init data.
+ * @reg_init_data: The regulator init data.
  * @init_uV: initial micro volts which need to be set.
  * @init_enable: Enable or do not enable the rails during initialization.
  * @init_apply: Init parameter applied or not.
@@ -80,7 +80,7 @@ enum {
  */
 
 struct tps80031_regulator_platform_data {
-       struct regulator_init_data regulator;
+       struct regulator_init_data *reg_init_data;
        int init_uV;
        unsigned init_enable:1;
        unsigned init_apply:1;