1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
Index: git/arch/arm/mach-davinci/board-da850-evm.c
===================================================================
--- git.orig/arch/arm/mach-davinci/board-da850-evm.c 2010-01-06 16:23:17.000000000 -0600
+++ git/arch/arm/mach-davinci/board-da850-evm.c 2010-01-12 08:54:24.921995195 -0600
@@ -17,6 +17,7 @@
#include <linux/i2c.h>
#include <linux/i2c/at24.h>
#include <linux/i2c/pca953x.h>
+#include <linux/mfd/tps6507x.h>
#include <linux/gpio.h>
#include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
@@ -643,10 +644,14 @@
},
};
+static struct tps6507x_board tps_board = {
+ .tps6507x_pmic_init_data = &tps65070_regulator_data[0],
+};
+
static struct i2c_board_info __initdata da850evm_tps65070_info[] = {
{
I2C_BOARD_INFO("tps6507x", 0x48),
- .platform_data = &tps65070_regulator_data[0],
+ .platform_data = &tps_board,
},
};
Index: git/drivers/regulator/tps6507x-regulator.c
===================================================================
--- git.orig/drivers/regulator/tps6507x-regulator.c 2010-01-12 08:43:00.561370246 -0600
+++ git/drivers/regulator/tps6507x-regulator.c 2010-01-12 08:53:30.261440110 -0600
@@ -502,6 +502,7 @@
struct regulator_init_data *init_data;
struct regulator_dev *rdev;
struct tps_pmic *tps;
+ struct tps6507x_board *tps_board;
int i;
if (!i2c_check_functionality(client->adapter,
@@ -509,10 +510,21 @@
return -EIO;
/**
+ * tps_board points to tps6507x related constants
+ * coming from the board-evm file.
+ */
+
+ tps_board = (struct tps6507x_board *)client->dev.platform_data;
+
+ if (!tps_board)
+ return -EIO;
+
+ /**
* 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;
Index: git/include/linux/mfd/tps6507x.h
===================================================================
--- git.orig/include/linux/mfd/tps6507x.h 2010-01-12 08:43:00.561370246 -0600
+++ git/include/linux/mfd/tps6507x.h 2010-01-12 08:53:59.849433723 -0600
@@ -131,4 +131,15 @@
/* VDCDC MASK */
#define TPS6507X_DEFDCDCX_DCDC_MASK 0X3F
+/**
+ * struct tps6507x_board - packages regulator and touchscreen init data
+ * @tps6507x_regulator_data: regulator initialization values
+ *
+ * Board data may be used to initialize regulator and touchscreen.
+ */
+
+struct tps6507x_board {
+ struct regulator_init_data *tps6507x_pmic_init_data;
+};
+
#endif /* __LINUX_MFD_TPS6507X_H */
|