Skip to content

Commit 5c861a2

Browse files
dni_dps460: Update pmbus_data structure to match newer kernel
1 parent 6f53047 commit 5c861a2

File tree

3 files changed

+22
-41
lines changed

3 files changed

+22
-41
lines changed

patch/driver-hwmon-pmbus-dni_dps460-update-pmbus-core.patch

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,24 @@ From: Shuotian Cheng <[email protected]>
44

55
The pmbus_data data structure is pasted in the driver.
66
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.
88
---
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(-)
1111

1212
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
1414
--- a/drivers/hwmon/pmbus/dni_dps460.c
1515
+++ 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 };
1725
#define FAN_VALUE_MAX 0x64
1826

1927
/* Needed to access the mutex. Copied from pmbus_core.c */
@@ -44,6 +52,7 @@ index ad29134c4..7332480d4 100644
4452
- struct attribute **attributes;
4553
struct attribute_group group;
4654
+ const struct attribute_group *groups[2];
55+
+ struct dentry *debugfs; /* debugfs device directory */
4756

4857
- /*
4958
- * Sensors cover both sensor and limit registers.
@@ -68,15 +77,19 @@ index ad29134c4..7332480d4 100644
6877

6978
struct mutex update_lock;
7079
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,
7282
* so we keep them all together.
7383
*/
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);
7689

7790
u8 currpage;
7891
};
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,
8093
struct i2c_client *client = to_i2c_client(dev);
8194
struct pmbus_data *data = i2c_get_clientdata(client);
8295
int err;

patch/driver-hwmon-pmbus-dni_dps460-use-kstrtol-from-user.patch

Lines changed: 0 additions & 31 deletions
This file was deleted.

patch/series

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ driver-hwmon-max6620-update.patch
2020
driver-hwmon-max6658-fix-write-convrate.patch
2121
driver-hwmon-pmbus-dni_dps460.patch
2222
driver-hwmon-pmbus-dni_dps460-update-pmbus-core.patch
23-
driver-hwmon-pmbus-dni_dps460-use-kstrtol-from-user.patch
2423
driver-hwmon-pmbus-dps1900.patch
2524
driver-support-tun-config-carrier-enable.patch
2625
driver-support-optoe.patch

0 commit comments

Comments
 (0)