aboutsummaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorTodd Fischer <todd.fischer@ridgerun.com>2010-04-05 20:23:57 -0600
committerSamuel Ortiz <sameo@linux.intel.com>2010-05-28 01:37:37 +0200
commit0bc20bba357f18a0e52f45afc452d0b69cf06f76 (patch)
tree38a1c5edfd04aa04a37afc404d4779244b740c09 /drivers/regulator
parentd183fcc975cbbc9c427deb2d7948ab03673995c9 (diff)
mfd: Add tps6507x board data structure
Add mfd structure which refrences sub-driver initialization data. For example, for a giving hardware implementation, the voltage regulator sub-driver initialization data provides the mapping betten a voltage regulator and what the output voltage is being used for. Signed-off-by: Todd Fischer <todd.fischer@ridgerun.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/tps6507x-regulator.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/regulator/tps6507x-regulator.c b/drivers/regulator/tps6507x-regulator.c
index 23c0597ab1f..c3f1bf822fd 100644
--- a/drivers/regulator/tps6507x-regulator.c
+++ b/drivers/regulator/tps6507x-regulator.c
@@ -489,6 +489,7 @@ static int __devinit tps_6507x_probe(struct i2c_client *client,
struct regulator_init_data *init_data;
struct regulator_dev *rdev;
struct tps_pmic *tps;
+ struct tps6507x_board *tps_board;
int i;
int error;
@@ -497,12 +498,21 @@ static int __devinit tps_6507x_probe(struct i2c_client *client,
return -EIO;
/**
+ * tps_board points to pmic related constants
+ * coming from the board-evm file.
+ */
+
+ tps_board = dev_get_platdata(&client->dev);
+ if (!tps_board)
+ return -EINVAL;
+
+ /**
* init_data points to array of regulator_init structures
* coming from the board-evm file.
*/
- init_data = client->dev.platform_data;
+ init_data = tps_board->tps6507x_pmic_init_data;
if (!init_data)
- return -EIO;
+ return -EINVAL;
tps = kzalloc(sizeof(*tps), GFP_KERNEL);
if (!tps)