aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAnilKumar Ch <anilkumar@ti.com>2012-08-13 11:06:05 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-08-22 04:55:25 -0400
commit1922b0f2758badc0b971d1ebbd300bc6635a6aef (patch)
treefa725f8e1a7b3a3f7eac166a1de8cea29adf46ae /include
parentd9875690d9b89a866022ff49e3fcea892345ad92 (diff)
mfd: Move tps65217 regulator plat data handling to regulator
Regulator platform data handling was mistakenly added to MFD driver. So we will see build errors if we compile MFD drivers without CONFIG_REGULATOR. This patch moves regulator platform data handling from TPS65217 MFD driver to regulator driver. This makes MFD driver independent of REGULATOR framework so build error is fixed if CONFIG_REGULATOR is not set. drivers/built-in.o: In function `tps65217_probe': tps65217.c:(.devinit.text+0x13e37): undefined reference to `of_regulator_match' This patch also fix allocation size of tps65217 platform data. Current implementation allocates a struct tps65217_board for each regulator specified in the device tree. But the structure itself provides array of regulators so one instance of it is sufficient. Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mfd/tps65217.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/linux/mfd/tps65217.h b/include/linux/mfd/tps65217.h
index 12c06870829..7cd83d826ed 100644
--- a/include/linux/mfd/tps65217.h
+++ b/include/linux/mfd/tps65217.h
@@ -22,6 +22,9 @@
22#include <linux/regulator/driver.h> 22#include <linux/regulator/driver.h>
23#include <linux/regulator/machine.h> 23#include <linux/regulator/machine.h>
24 24
25/* TPS chip id list */
26#define TPS65217 0xF0
27
25/* I2C ID for TPS65217 part */ 28/* I2C ID for TPS65217 part */
26#define TPS65217_I2C_ID 0x24 29#define TPS65217_I2C_ID 0x24
27 30
@@ -248,13 +251,11 @@ struct tps_info {
248struct tps65217 { 251struct tps65217 {
249 struct device *dev; 252 struct device *dev;
250 struct tps65217_board *pdata; 253 struct tps65217_board *pdata;
254 unsigned int id;
251 struct regulator_desc desc[TPS65217_NUM_REGULATOR]; 255 struct regulator_desc desc[TPS65217_NUM_REGULATOR];
252 struct regulator_dev *rdev[TPS65217_NUM_REGULATOR]; 256 struct regulator_dev *rdev[TPS65217_NUM_REGULATOR];
253 struct tps_info *info[TPS65217_NUM_REGULATOR]; 257 struct tps_info *info[TPS65217_NUM_REGULATOR];
254 struct regmap *regmap; 258 struct regmap *regmap;
255
256 /* Client devices */
257 struct platform_device *regulator_pdev[TPS65217_NUM_REGULATOR];
258}; 259};
259 260
260static inline struct tps65217 *dev_to_tps65217(struct device *dev) 261static inline struct tps65217 *dev_to_tps65217(struct device *dev)
@@ -262,6 +263,11 @@ static inline struct tps65217 *dev_to_tps65217(struct device *dev)
262 return dev_get_drvdata(dev); 263 return dev_get_drvdata(dev);
263} 264}
264 265
266static inline int tps65217_chip_id(struct tps65217 *tps65217)
267{
268 return tps65217->id;
269}
270
265int tps65217_reg_read(struct tps65217 *tps, unsigned int reg, 271int tps65217_reg_read(struct tps65217 *tps, unsigned int reg,
266 unsigned int *val); 272 unsigned int *val);
267int tps65217_reg_write(struct tps65217 *tps, unsigned int reg, 273int tps65217_reg_write(struct tps65217 *tps, unsigned int reg,