public inbox for linux-hwmon@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] hwmon: (pmbus) Some questions about PMBUS_STATUS
@ 2021-06-24  2:23 ainux.wang
  2021-06-24 12:32 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: ainux.wang @ 2021-06-24  2:23 UTC (permalink / raw)
  To: jdelvare, linux, corbet, ainux.wang
  Cc: linux-hwmon, linux-doc, sterlingteng, chenhuacai, chenhuacai

From: "Ainux.Wang" <ainux.wang@gmail.com>

There are some questions about PMBUS_STATUS in core.

Signed-off-by: Ainux.Wang <ainux.wang@gmail.com>
---
 drivers/hwmon/pmbus/pmbus_core.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index bbd745178147..e16c85997148 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -2200,6 +2200,19 @@ static int pmbus_init_common(struct i2c_client *client, struct pmbus_data *data,
 	 * Some PMBus chips don't support PMBUS_STATUS_WORD, so try
 	 * to use PMBUS_STATUS_BYTE instead if that is the case.
 	 * Bail out if both registers are not supported.
+	 *
+	 * Question 1:
+	 *  Why bail out if both registers are not supported?
+	 *  MP2949A both registers are not supported.
+	 *
+	 * Question 2:
+	 *  Use i2c_smbus_read_word_data() or i2c_smbus_read_byte_data
+	 *  to read, the MP2949A will return undetermined value, although
+	 *  we already known this chip do not support both registers.
+	 *  What should we do?
+	 *  Can we use pmbus_read_status_byte() or pmbus_read_status_word()?
+	 *  and in MP2949A driver's .read_byte_data and .read_word_data to
+	 *  filter out both registers?
 	 */
 	data->read_status = pmbus_read_status_word;
 	ret = i2c_smbus_read_word_data(client, PMBUS_STATUS_WORD);
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-24 12:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-24  2:23 [RFC] hwmon: (pmbus) Some questions about PMBUS_STATUS ainux.wang
2021-06-24 12:32 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox