4
4
5
5
The pmbus_data data structure is pasted in the driver.
6
6
Cumulus patch is for kernel 3.2.x.
7
- Update this data structure to meet current kernel (3.16 .x) implementation.
7
+ Update this data structure to meet current kernel (4.19 .x) implementation.
8
8
---
9
- drivers/hwmon/pmbus/dni_dps460.c | 42 +++++++++++++++- ----------------------
10
- 1 file changed, 17 insertions(+), 25 deletions(-)
9
+ drivers/hwmon/pmbus/dni_dps460.c | 48 ++++++++++++++++++ ----------------------
10
+ 1 file changed, 22 insertions(+), 26 deletions(-)
11
11
12
12
diff --git a/drivers/hwmon/pmbus/dni_dps460.c b/drivers/hwmon/pmbus/dni_dps460.c
13
- index ad29134c4..7332480d4 100644
13
+ index 2c6741038..d314c1f21 100644
14
14
--- a/drivers/hwmon/pmbus/dni_dps460.c
15
15
+++ b/drivers/hwmon/pmbus/dni_dps460.c
16
- @@ -39,41 +39,32 @@ enum chips { dni_dps460 };
16
+ @@ -19,6 +19,7 @@
17
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
+ */
19
+
20
+ + #include <linux/debugfs.h>
21
+ #include <linux/kernel.h>
22
+ #include <linux/module.h>
23
+ #include <linux/init.h>
24
+ @@ -39,41 +40,33 @@ enum chips { dni_dps460 };
17
25
#define FAN_VALUE_MAX 0x64
18
26
19
27
/* Needed to access the mutex. Copied from pmbus_core.c */
@@ -44,6 +52,7 @@ index ad29134c4..7332480d4 100644
44
52
- struct attribute **attributes;
45
53
struct attribute_group group;
46
54
+ const struct attribute_group *groups[2];
55
+ + struct dentry *debugfs; /* debugfs device directory */
47
56
48
57
- /*
49
58
- * Sensors cover both sensor and limit registers.
@@ -68,15 +77,19 @@ index ad29134c4..7332480d4 100644
68
77
69
78
struct mutex update_lock;
70
79
bool valid;
71
- @@ -84,6 +75,7 @@ struct pmbus_data {
80
+ @@ -83,7 +76,10 @@ struct pmbus_data {
81
+ * A single status register covers multiple attributes,
72
82
* so we keep them all together.
73
83
*/
74
- u8 status[PB_NUM_STATUS_REG];
75
- + u8 status_register;
84
+ - u8 status[PB_NUM_STATUS_REG];
85
+ + u16 status[PB_NUM_STATUS_REG];
86
+ +
87
+ + bool has_status_word; /* device uses STATUS_WORD register */
88
+ + int (*read_status)(struct i2c_client *client, int page);
76
89
77
90
u8 currpage;
78
91
};
79
- @@ -123,14 +115 ,14 @@ static ssize_t set_target(struct device *dev, struct device_attribute *devattr,
92
+ @@ -123,14 +119 ,14 @@ static ssize_t set_target(struct device *dev, struct device_attribute *devattr,
80
93
struct i2c_client *client = to_i2c_client(dev);
81
94
struct pmbus_data *data = i2c_get_clientdata(client);
82
95
int err;
0 commit comments