All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Wujek <dev_public@wujek.eu>
To: unlisted-recipients:; (no To-header on input)
Cc: Adam Wujek <dev_public@wujek.eu>,
	Guenter Roeck <linux@roeck-us.net>,
	Jean Delvare <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] hwmon: (pmbus) add missing definitions of pmbus registers
Date: Thu, 28 Apr 2022 13:46:59 +0000	[thread overview]
Message-ID: <20220428134634.1610241-1-dev_public@wujek.eu> (raw)

Definitions are taken from the table 31 of the PMBUS specification
revision 1.3.1, 13 March 2015.

Signed-off-by: Adam Wujek <dev_public@wujek.eu>
---
 drivers/hwmon/pmbus/pmbus.h | 145 ++++++++++++++++++++++++++++++++++++
 1 file changed, 145 insertions(+)

diff --git a/drivers/hwmon/pmbus/pmbus.h b/drivers/hwmon/pmbus/pmbus.h
index e74b6ef070f3..902bb9cce950 100644
--- a/drivers/hwmon/pmbus/pmbus.h
+++ b/drivers/hwmon/pmbus/pmbus.h
@@ -21,11 +21,29 @@ enum pmbus_regs {
 	PMBUS_ON_OFF_CONFIG		= 0x02,
 	PMBUS_CLEAR_FAULTS		= 0x03,
 	PMBUS_PHASE			= 0x04,
+	PMBUS_PAGE_PLUS_WRITE		= 0x05,
+	PMBUS_PAGE_PLUS_READ		= 0x06,
+	PMBUS_ZONE_CONFIG		= 0x07,
+	PMBUS_ZONE_ACTIVE		= 0x08,
+
+	/* 0x09 - 0x0F are reserved */

 	PMBUS_WRITE_PROTECT		= 0x10,
+	PMBUS_STORE_DEFAULT_ALL		= 0x11,
+	PMBUS_RESTORE_DEFAULT_ALL	= 0x12,
+	PMBUS_STORE_DEFAULT_CODE	= 0x13,
+	PMBUS_RESTORE_DEFAULT_CODE	= 0x14,
+	PMBUS_STORE_USER_ALL		= 0x15,
+	PMBUS_RESTORE_USER_ALL		= 0x16,
+	PMBUS_STORE_USER_CODE		= 0x17,
+	PMBUS_RESTORE_USER_CODE		= 0x18,

 	PMBUS_CAPABILITY		= 0x19,
+
 	PMBUS_QUERY			= 0x1A,
+	PMBUS_SMBALERT_MASK		= 0x1B,
+
+	/* 0x1C - 0x1F are reserved */

 	PMBUS_VOUT_MODE			= 0x20,
 	PMBUS_VOUT_COMMAND		= 0x21,
@@ -38,10 +56,22 @@ enum pmbus_regs {
 	PMBUS_VOUT_DROOP		= 0x28,
 	PMBUS_VOUT_SCALE_LOOP		= 0x29,
 	PMBUS_VOUT_SCALE_MONITOR	= 0x2A,
+	PMBUS_VOUT_MIN			= 0x2B,
+
+	/* 0x2C - 0x2F are reserved */

 	PMBUS_COEFFICIENTS		= 0x30,
 	PMBUS_POUT_MAX			= 0x31,

+	PMBUS_MAX_DUTY			= 0x32,
+	PMBUS_FREQUENCY_SWITCH		= 0x33,
+	PMBUS_POWER_MODE		= 0x34,
+	PMBUS_VIN_ON			= 0x35,
+	PMBUS_VIN_OFF			= 0x36,
+	PMBUS_INTERLEAVE		= 0x37,
+	PMBUS_IOUT_CAL_GAIN		= 0x38,
+	PMBUS_IOUT_CAL_OFFSET		= 0x39,
+
 	PMBUS_FAN_CONFIG_12		= 0x3A,
 	PMBUS_FAN_COMMAND_1		= 0x3B,
 	PMBUS_FAN_COMMAND_2		= 0x3C,
@@ -63,6 +93,9 @@ enum pmbus_regs {
 	PMBUS_IOUT_UC_FAULT_LIMIT	= 0x4B,
 	PMBUS_IOUT_UC_FAULT_RESPONSE	= 0x4C,

+	/* 0x4D is reserved */
+	/* 0x4E is reserved */
+
 	PMBUS_OT_FAULT_LIMIT		= 0x4F,
 	PMBUS_OT_FAULT_RESPONSE		= 0x50,
 	PMBUS_OT_WARN_LIMIT		= 0x51,
@@ -74,14 +107,28 @@ enum pmbus_regs {
 	PMBUS_VIN_OV_WARN_LIMIT		= 0x57,
 	PMBUS_VIN_UV_WARN_LIMIT		= 0x58,
 	PMBUS_VIN_UV_FAULT_LIMIT	= 0x59,
+	PMBUS_VIN_UV_FAULT_RESPONSE	= 0x5A,

 	PMBUS_IIN_OC_FAULT_LIMIT	= 0x5B,
 	PMBUS_IIN_OC_WARN_LIMIT		= 0x5D,

+	PMBUS_POWER_GOOD_ON		= 0x5E,
+	PMBUS_POWER_GOOD_OFF		= 0x5F,
+	PMBUS_TON_DELAY			= 0x60,
+	PMBUS_TON_RISE			= 0x61,
+	PMBUS_TON_MAX_FAULT_LIMIT	= 0x62,
+	PMBUS_TON_MAX_FAULT_RESPONSE	= 0x63,
+	PMBUS_TOFF_DELAY		= 0x64,
+	PMBUS_TOFF_FALL			= 0x65,
+	PMBUS_TOFF_MAX_WARN_LIMIT	= 0x66,
+	/* 0x67 is reserved (Was Used In PMBUS Revision 1.0) */
 	PMBUS_POUT_OP_FAULT_LIMIT	= 0x68,
+	PMBUS_POUT_OP_FAULT_RESPONSE	= 0x69,
 	PMBUS_POUT_OP_WARN_LIMIT	= 0x6A,
 	PMBUS_PIN_OP_WARN_LIMIT		= 0x6B,

+	/* 0x6C - 0x77 are reserved */
+
 	PMBUS_STATUS_BYTE		= 0x78,
 	PMBUS_STATUS_WORD		= 0x79,
 	PMBUS_STATUS_VOUT		= 0x7A,
@@ -94,6 +141,11 @@ enum pmbus_regs {
 	PMBUS_STATUS_FAN_12		= 0x81,
 	PMBUS_STATUS_FAN_34		= 0x82,

+	PMBUS_READ_KWH_IN		= 0x83,
+	PMBUS_READ_KWH_OUT		= 0x84,
+	PMBUS_READ_KWH_CONFIG		= 0x85,
+	PMBUS_READ_EIN			= 0x86,
+	PMBUS_READ_EOUT			= 0x87,
 	PMBUS_READ_VIN			= 0x88,
 	PMBUS_READ_IIN			= 0x89,
 	PMBUS_READ_VCAP			= 0x8A,
@@ -118,6 +170,7 @@ enum pmbus_regs {
 	PMBUS_MFR_LOCATION		= 0x9C,
 	PMBUS_MFR_DATE			= 0x9D,
 	PMBUS_MFR_SERIAL		= 0x9E,
+	PMBUS_APP_PROFILE_SUPPORT	= 0x9F,

 	PMBUS_MFR_VIN_MIN		= 0xA0,
 	PMBUS_MFR_VIN_MAX		= 0xA1,
@@ -128,13 +181,105 @@ enum pmbus_regs {
 	PMBUS_MFR_IOUT_MAX		= 0xA6,
 	PMBUS_MFR_POUT_MAX		= 0xA7,

+	PMBUS_MFR_TAMBIENT_MAX		= 0xA8,
+	PMBUS_MFR_TAMBIENT_MIN		= 0xA9,
+	PMBUS_MFR_EFFICIENCY_LL		= 0xAA,
+	PMBUS_MFR_EFFICIENCY_HL		= 0xAB,
+	PMBUS_MFR_PIN_ACCURACY		= 0xAC,
+
 	PMBUS_IC_DEVICE_ID		= 0xAD,
 	PMBUS_IC_DEVICE_REV		= 0xAE,

+	/* 0xAF is reserved */
+
+	PMBUS_USER_DATA_00		= 0xB0,
+	PMBUS_USER_DATA_01		= 0xB1,
+	PMBUS_USER_DATA_02		= 0xB2,
+	PMBUS_USER_DATA_03		= 0xB3,
+	PMBUS_USER_DATA_04		= 0xB4,
+	PMBUS_USER_DATA_05		= 0xB5,
+	PMBUS_USER_DATA_06		= 0xB6,
+	PMBUS_USER_DATA_07		= 0xB7,
+	PMBUS_USER_DATA_08		= 0xB8,
+	PMBUS_USER_DATA_09		= 0xB9,
+	PMBUS_USER_DATA_10		= 0xBA,
+	PMBUS_USER_DATA_11		= 0xBB,
+	PMBUS_USER_DATA_12		= 0xBC,
+	PMBUS_USER_DATA_13		= 0xBD,
+	PMBUS_USER_DATA_14		= 0xBE,
+	PMBUS_USER_DATA_15		= 0xBF,
+
 	PMBUS_MFR_MAX_TEMP_1		= 0xC0,
 	PMBUS_MFR_MAX_TEMP_2		= 0xC1,
 	PMBUS_MFR_MAX_TEMP_3		= 0xC2,

+	/* 0xC3 is reserved */
+
+	PMBUS_MFR_SPECIFIC_C4		= 0xC4,
+	PMBUS_MFR_SPECIFIC_C5		= 0xC5,
+	PMBUS_MFR_SPECIFIC_C6		= 0xC6,
+	PMBUS_MFR_SPECIFIC_C7		= 0xC7,
+	PMBUS_MFR_SPECIFIC_C8		= 0xC8,
+	PMBUS_MFR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MFR_SPECIFIC_EA		= 0xEA,
+	PMBUS_MFR_SPECIFIC_EB		= 0xEB,
+	PMBUS_MFR_SPECIFIC_EC		= 0xEC,
+	PMBUS_MFR_SPECIFIC_ED		= 0xED,
+	PMBUS_MFR_SPECIFIC_EE		= 0xEE,
+	PMBUS_MFR_SPECIFIC_EF		= 0xEF,
+
+	PMBUS_MFR_SPECIFIC_F0		= 0xF0,
+	PMBUS_MFR_SPECIFIC_F1		= 0xF1,
+	PMBUS_MFR_SPECIFIC_F2		= 0xF2,
+	PMBUS_MFR_SPECIFIC_F3		= 0xF3,
+	PMBUS_MFR_SPECIFIC_F4		= 0xF4,
+	PMBUS_MFR_SPECIFIC_F5		= 0xF5,
+	PMBUS_MFR_SPECIFIC_F6		= 0xF6,
+	PMBUS_MFR_SPECIFIC_F7		= 0xF7,
+	PMBUS_MFR_SPECIFIC_F8		= 0xF8,
+	PMBUS_MFR_SPECIFIC_F9		= 0xF9,
+	PMBUS_MFR_SPECIFIC_FA		= 0xFA,
+	PMBUS_MFR_SPECIFIC_FB		= 0xFB,
+	PMBUS_MFR_SPECIFIC_FC		= 0xFC,
+	PMBUS_MFR_SPECIFIC_FD		= 0xFD,
+
+	PMBUS_MFR_SPECIFIC_COMMAND_EXT	= 0xFE,
+	PMBUS_COMMAND_EXT		= 0xFF,
+
 /*
  * Virtual registers.
  * Useful to support attributes which are not supported by standard PMBus
--
2.25.1



             reply	other threads:[~2022-04-28 13:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-28 13:46 Adam Wujek [this message]
2022-04-28 15:21 ` [PATCH] hwmon: (pmbus) add missing definitions of pmbus registers Guenter Roeck
2022-04-29  1:04   ` wujek dev
2022-04-29  5:38     ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220428134634.1610241-1-dev_public@wujek.eu \
    --to=dev_public@wujek.eu \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.