Re: [PATCH 8/8] hwmon: (pmbus/core) Report content of CAPABILITY register in debugfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/9/25 21:34, Tzung-Bi Shih wrote:
On Sun, Feb 09, 2025 at 08:00:24PM -0800, Guenter Roeck wrote:
@@ -3585,6 +3585,15 @@ static void 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 (!(data->flags & PMBUS_NO_CAPABILITY) &&
+	    pmbus_check_byte_register(client, 0, PMBUS_CAPABILITY)) {
+		entries[idx].client = client;
+		entries[idx].page = 0;
+		entries[idx].reg = PMBUS_CAPABILITY;
+		debugfs_create_file("capability", 0444, debugfs,
+				    &entries[idx++],
+				    &pmbus_debugfs_ops);
+	}
  	if (pmbus_check_byte_register(client, 0, PMBUS_REVISION)) {
  		entries[idx].client = client;
  		entries[idx].page = 0;

New device-specific entry.  The allocation size [1] should also change
accordingly: s/7/8/.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/hwmon/pmbus/pmbus_core.c?id=a64dcfb451e254085a7daee5fe51bf22959d52d3#n3537


Good catch. Thanks!

Guenter





[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux