[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220519234346.440398-2-dev_public@wujek.eu>
Date: Thu, 19 May 2022 23:44:02 +0000
From: Adam Wujek <dev_public@...ek.eu>
To: unlisted-recipients:; (no To-header on input)
Cc: Adam Wujek <dev_public@...ek.eu>,
Guenter Roeck <linux@...ck-us.net>,
Jean Delvare <jdelvare@...e.com>, linux-hwmon@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/3] hwmon: (pmbus) use block presence checking for registers PMBUS_MFR_*
When PEC is enabled, using the function to check byte register presence
(pmbus_check_byte_register) for block register generates an error.
The second byte of a block is interpreted as PEC, which is usually wrong.
Signed-off-by: Adam Wujek <dev_public@...ek.eu>
---
Note:
- This commit requires commit which is accepted, but not yet in the kernel
tree:
hwmon: (pmbus) add MFR_* registers to debugfs
drivers/hwmon/pmbus/pmbus_core.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index 2634ac1fa3d5..597cbe85df07 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -2858,7 +2858,7 @@ static int pmbus_init_debugfs(struct i2c_client *client,
&pmbus_debugfs_ops);
}
- if (pmbus_check_byte_register(client, i, PMBUS_MFR_ID)) {
+ if (pmbus_check_block_register(client, i, PMBUS_MFR_ID)) {
entries[idx].client = client;
entries[idx].page = i;
entries[idx].reg = PMBUS_MFR_ID;
@@ -2868,7 +2868,7 @@ static int pmbus_init_debugfs(struct i2c_client *client,
&pmbus_debugfs_ops_mfr);
}
- if (pmbus_check_byte_register(client, i, PMBUS_MFR_MODEL)) {
+ if (pmbus_check_block_register(client, i, PMBUS_MFR_MODEL)) {
entries[idx].client = client;
entries[idx].page = i;
entries[idx].reg = PMBUS_MFR_MODEL;
@@ -2878,7 +2878,7 @@ static int pmbus_init_debugfs(struct i2c_client *client,
&pmbus_debugfs_ops_mfr);
}
- if (pmbus_check_byte_register(client, i, PMBUS_MFR_REVISION)) {
+ if (pmbus_check_block_register(client, i, PMBUS_MFR_REVISION)) {
entries[idx].client = client;
entries[idx].page = i;
entries[idx].reg = PMBUS_MFR_REVISION;
@@ -2888,7 +2888,7 @@ static int pmbus_init_debugfs(struct i2c_client *client,
&pmbus_debugfs_ops_mfr);
}
- if (pmbus_check_byte_register(client, i, PMBUS_MFR_LOCATION)) {
+ if (pmbus_check_block_register(client, i, PMBUS_MFR_LOCATION)) {
entries[idx].client = client;
entries[idx].page = i;
entries[idx].reg = PMBUS_MFR_LOCATION;
@@ -2898,7 +2898,7 @@ static int pmbus_init_debugfs(struct i2c_client *client,
&pmbus_debugfs_ops_mfr);
}
- if (pmbus_check_byte_register(client, i, PMBUS_MFR_DATE)) {
+ if (pmbus_check_block_register(client, i, PMBUS_MFR_DATE)) {
entries[idx].client = client;
entries[idx].page = i;
entries[idx].reg = PMBUS_MFR_DATE;
@@ -2908,7 +2908,7 @@ static int pmbus_init_debugfs(struct i2c_client *client,
&pmbus_debugfs_ops_mfr);
}
- if (pmbus_check_byte_register(client, i, PMBUS_MFR_SERIAL)) {
+ if (pmbus_check_block_register(client, i, PMBUS_MFR_SERIAL)) {
entries[idx].client = client;
entries[idx].page = i;
entries[idx].reg = PMBUS_MFR_SERIAL;
--
2.17.1
Powered by blists - more mailing lists