1- Update pmbus_data data structure to meet kernel implementation
2-
3- From: Shuotian Cheng <
[email protected] >
1+ From 9cfc597034ffe58527ea5ce1799dfcbad770ea30 Mon Sep 17 00:00:00 2001
2+ From: Arun Saravanan Balachandran <
[email protected] >
3+ Date: Mon, 18 Jan 2021 09:00:44 +0000
4+ Subject: [PATCH] Update pmbus_data data structure to meet kernel
5+ implementation
46
57The pmbus_data data structure is pasted in the driver.
68Cumulus 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 <
[email protected] >
812---
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(-)
1115
1216diff --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
1418--- a/drivers/hwmon/pmbus/dni_dps460.c
1519+++ 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 };
1729 #define FAN_VALUE_MAX 0x64
1830
1931 /* Needed to access the mutex. Copied from pmbus_core.c */
@@ -44,6 +56,7 @@ index ad29134c4..7332480d4 100644
4456- struct attribute **attributes;
4557 struct attribute_group group;
4658+ const struct attribute_group *groups[2];
59+ + struct dentry *debugfs; /* debugfs device directory */
4760
4861- /*
4962- * Sensors cover both sensor and limit registers.
@@ -68,15 +81,19 @@ index ad29134c4..7332480d4 100644
6881
6982 struct mutex update_lock;
7083 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,
7286 * so we keep them all together.
7387 */
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);
7693
7794 u8 currpage;
7895 };
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,
8097 struct i2c_client *client = to_i2c_client(dev);
8198 struct pmbus_data *data = i2c_get_clientdata(client);
8299 int err;
@@ -94,3 +111,6 @@ index ad29134c4..7332480d4 100644
94111
95112 mutex_lock(&data->update_lock);
96113
114+ - -
115+ 2.7.4
116+
0 commit comments