1
- Update pmbus_data data structure to meet kernel implementation
2
-
3
- From: Shuotian Cheng <shuche@microsoft.com>
1
+ From 9cfc597034ffe58527ea5ce1799dfcbad770ea30 Mon Sep 17 00:00:00 2001
2
+ From: Arun Saravanan Balachandran <Arun_Saravanan_Balac@dell.com>
3
+ Date: Mon, 18 Jan 2021 09:00:44 +0000
4
+ Subject: [PATCH] Update pmbus_data data structure to meet kernel
5
+ implementation
4
6
5
7
The pmbus_data data structure is pasted in the driver.
6
8
Cumulus patch is for kernel 3.2.x.
7
- Update this data structure to meet current kernel (3.16.x) implementation.
9
+ Update this data structure to meet current kernel (4.19.x) implementation.
10
+
11
+ Signed-off-by: Arun Saravanan Balachandran <Arun_Saravanan_Balac@dell.com>
8
12
---
9
- drivers/hwmon/pmbus/dni_dps460.c | 42 +++++++++++++++- ----------------------
10
- 1 file changed, 17 insertions(+), 25 deletions(-)
13
+ drivers/hwmon/pmbus/dni_dps460.c | 48 ++++++++++++++++++ ----------------------
14
+ 1 file changed, 22 insertions(+), 26 deletions(-)
11
15
12
16
diff --git a/drivers/hwmon/pmbus/dni_dps460.c b/drivers/hwmon/pmbus/dni_dps460.c
13
- index ad29134c4..7332480d4 100644
17
+ index 2c67410..d314c1f 100644
14
18
--- a/drivers/hwmon/pmbus/dni_dps460.c
15
19
+++ b/drivers/hwmon/pmbus/dni_dps460.c
16
- @@ -39,41 +39,32 @@ enum chips { dni_dps460 };
20
+ @@ -19,6 +19,7 @@
21
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
+ */
23
+
24
+ + #include <linux/debugfs.h>
25
+ #include <linux/kernel.h>
26
+ #include <linux/module.h>
27
+ #include <linux/init.h>
28
+ @@ -39,41 +40,33 @@ enum chips { dni_dps460 };
17
29
#define FAN_VALUE_MAX 0x64
18
30
19
31
/* Needed to access the mutex. Copied from pmbus_core.c */
@@ -44,6 +56,7 @@ index ad29134c4..7332480d4 100644
44
56
- struct attribute **attributes;
45
57
struct attribute_group group;
46
58
+ const struct attribute_group *groups[2];
59
+ + struct dentry *debugfs; /* debugfs device directory */
47
60
48
61
- /*
49
62
- * Sensors cover both sensor and limit registers.
@@ -68,15 +81,19 @@ index ad29134c4..7332480d4 100644
68
81
69
82
struct mutex update_lock;
70
83
bool valid;
71
- @@ -84,6 +75,7 @@ struct pmbus_data {
84
+ @@ -83,7 +76,10 @@ struct pmbus_data {
85
+ * A single status register covers multiple attributes,
72
86
* so we keep them all together.
73
87
*/
74
- u8 status[PB_NUM_STATUS_REG];
75
- + u8 status_register;
88
+ - u8 status[PB_NUM_STATUS_REG];
89
+ + u16 status[PB_NUM_STATUS_REG];
90
+ +
91
+ + bool has_status_word; /* device uses STATUS_WORD register */
92
+ + int (*read_status)(struct i2c_client *client, int page);
76
93
77
94
u8 currpage;
78
95
};
79
- @@ -123,14 +115 ,14 @@ static ssize_t set_target(struct device *dev, struct device_attribute *devattr,
96
+ @@ -123,14 +119 ,14 @@ static ssize_t set_target(struct device *dev, struct device_attribute *devattr,
80
97
struct i2c_client *client = to_i2c_client(dev);
81
98
struct pmbus_data *data = i2c_get_clientdata(client);
82
99
int err;
@@ -94,3 +111,6 @@ index ad29134c4..7332480d4 100644
94
111
95
112
mutex_lock(&data->update_lock);
96
113
114
+ - -
115
+ 2.7.4
116
+
0 commit comments