[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241217022046.113830-2-ninad@linux.ibm.com>
Date: Mon, 16 Dec 2024 20:20:39 -0600
From: Ninad Palsule <ninad@...ux.ibm.com>
To: robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
eajames@...ux.ibm.com, jdelvare@...e.com, linux@...ck-us.net,
corbet@....net, joel@....id.au, andrew@...econstruct.com.au,
Delphine_CC_Chiu@...ynn.com, broonie@...nel.org,
peteryin.openbmc@...il.com, noahwang.wang@...look.com,
naresh.solanki@...ements.com, lukas@...ner.de, jbrunet@...libre.com,
patrick.rudolph@...ements.com, gregkh@...uxfoundation.org,
peterz@...radead.org, pbiel7@...il.com, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-hwmon@...r.kernel.org,
linux-doc@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-aspeed@...ts.ozlabs.org, linux-i2c@...r.kernel.org
Cc: Ninad Palsule <ninad@...ux.ibm.com>
Subject: [PATCH v3 1/4] hwmon: (pmbus/core) Add PMBUS_REVISION in debugfs
Add debugfs file for the PMBUS_REVISION command. This command provides
information about PMBus protocol revision number.
Signed-off-by: Ninad Palsule <ninad@...ux.ibm.com>
---
drivers/hwmon/pmbus/pmbus_core.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index a7000314e5ad..787683e83db6 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -3534,11 +3534,11 @@ static int pmbus_init_debugfs(struct i2c_client *client,
/*
* Allocate the max possible entries we need.
- * 6 entries device-specific
+ * 7 entries device-specific
* 10 entries page-specific
*/
entries = devm_kcalloc(data->dev,
- 6 + data->info->pages * 10, sizeof(*entries),
+ 7 + data->info->pages * 10, sizeof(*entries),
GFP_KERNEL);
if (!entries)
return -ENOMEM;
@@ -3551,6 +3551,15 @@ static int pmbus_init_debugfs(struct i2c_client *client,
* assume that values of the following registers are the same for all
* pages and report values only for page 0.
*/
+ if (pmbus_check_byte_register(client, 0, PMBUS_REVISION)) {
+ entries[idx].client = client;
+ entries[idx].page = 0;
+ entries[idx].reg = PMBUS_REVISION;
+ debugfs_create_file("revision", 0444, data->debugfs,
+ &entries[idx++],
+ &pmbus_debugfs_ops);
+ }
+
if (pmbus_check_block_register(client, 0, PMBUS_MFR_ID)) {
entries[idx].client = client;
entries[idx].page = 0;
--
2.43.0
Powered by blists - more mailing lists