summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2012-05-18 22:31:41 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2012-05-22 23:49:13 +0200
commitcb8d8654570c257d2ec5f7fa089e18b338314317 (patch)
tree39971c07b8b0111d924606079e07b3701ab2ff30
parentmfd: Add r_select to lm3533 platform data (diff)
downloadlinux-cb8d8654570c257d2ec5f7fa089e18b338314317.tar.xz
linux-cb8d8654570c257d2ec5f7fa089e18b338314317.zip
mfd: Save device node parsed platform data for tps65910 sub devices
Save the allocated memory to store the parsed device node information to the global device structure so that sub devices can directly use this pointer. In this way, the sub devices does not require to re-allocate the memory for storing the sub-devices specific device node information. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r--drivers/mfd/tps65910.c6
-rw-r--r--include/linux/mfd/tps65910.h3
2 files changed, 8 insertions, 1 deletions
diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index 18b30cf45e5b..05d449b33693 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -209,14 +209,17 @@ static __devinit int tps65910_i2c_probe(struct i2c_client *i2c,
{
struct tps65910 *tps65910;
struct tps65910_board *pmic_plat_data;
+ struct tps65910_board *of_pmic_plat_data = NULL;
struct tps65910_platform_data *init_data;
int ret = 0;
int chip_id = id->driver_data;
pmic_plat_data = dev_get_platdata(&i2c->dev);
- if (!pmic_plat_data && i2c->dev.of_node)
+ if (!pmic_plat_data && i2c->dev.of_node) {
pmic_plat_data = tps65910_parse_dt(i2c, &chip_id);
+ of_pmic_plat_data = pmic_plat_data;
+ }
if (!pmic_plat_data)
return -EINVAL;
@@ -229,6 +232,7 @@ static __devinit int tps65910_i2c_probe(struct i2c_client *i2c,
if (tps65910 == NULL)
return -ENOMEM;
+ tps65910->of_plat_data = of_pmic_plat_data;
i2c_set_clientdata(i2c, tps65910);
tps65910->dev = &i2c->dev;
tps65910->i2c_client = i2c;
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h
index ab04e901e57e..dd8dc0a6c462 100644
--- a/include/linux/mfd/tps65910.h
+++ b/include/linux/mfd/tps65910.h
@@ -830,6 +830,9 @@ struct tps65910 {
struct tps65910_rtc *rtc;
struct tps65910_power *power;
+ /* Device node parsed board data */
+ struct tps65910_board *of_plat_data;
+
/* IRQ Handling */
struct mutex irq_lock;
int chip_irq;