From: Erik Rosen <erik.rosen@metormote.com>
To: Jean Delvare <jdelvare@suse.com>,
Guenter Roeck <linux@roeck-us.net>,
Jonathan Corbet <corbet@lwn.net>,
linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Erik Rosen <erik.rosen@metormote.com>
Subject: [PATCH 2/3] hwmon: (pmbus) Add documentation for new flags
Date: Wed, 5 May 2021 20:32:47 +0200 [thread overview]
Message-ID: <20210505183248.57082-3-erik.rosen@metormote.com> (raw)
In-Reply-To: <20210505183248.57082-1-erik.rosen@metormote.com>
Add documentation for the new pmbus flags PMBUS_WRITE_PROTECTED and
PMBUS_READ_STATUS_AFTER_FAILED_CHECK
Signed-off-by: Erik Rosen <erik.rosen@metormote.com>
---
Documentation/hwmon/pmbus-core.rst | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/Documentation/hwmon/pmbus-core.rst b/Documentation/hwmon/pmbus-core.rst
index 73e23ab42cc3..001c64f0f8c0 100644
--- a/Documentation/hwmon/pmbus-core.rst
+++ b/Documentation/hwmon/pmbus-core.rst
@@ -289,9 +289,13 @@ PMBus driver platform data
==========================
PMBus platform data is defined in include/linux/pmbus.h. Platform data
-currently only provides a flag field with a single bit used::
+currently only provides a flag field with three bits used::
- #define PMBUS_SKIP_STATUS_CHECK (1 << 0)
+ #define PMBUS_SKIP_STATUS_CHECK BIT(0)
+
+ #define PMBUS_WRITE_PROTECTED BIT(1)
+
+ #define PMBUS_READ_STATUS_AFTER_FAILED_CHECK BIT(2)
struct pmbus_platform_data {
u32 flags; /* Device specific flags */
@@ -315,3 +319,19 @@ status register must be disabled.
Some i2c controllers do not support single-byte commands (write commands with
no data, i2c_smbus_write_byte()). With such controllers, clearing the status
register is impossible, and the PMBUS_SKIP_STATUS_CHECK flag must be set.
+
+PMBUS_WRITE_PROTECTED
+
+Set if the chip is write protected and write protection is not determined
+by the standard WRITE_PROTECT command.
+
+PMBUS_READ_STATUS_AFTER_FAILED_CHECK
+ Read the STATUS register after each failed register check.
+
+Some PMBus chips end up in an undefined state when trying to read an
+unsupported register. For such chips, it is necessary to reset the
+chip pmbus controller to a known state after a failed register check.
+This can be done by reading a known register. By setting this flag the
+driver will try to read the STATUS register after each failed
+register check. This read may fail, but it will put the chip into a
+known state.
\ No newline at end of file
--
2.20.1
next prev parent reply other threads:[~2021-05-05 18:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-05 18:32 [PATCH 0/3] hwmon: (pmbus) Add support for additional Flex BMR converters to the pmbus driver Erik Rosen
2021-05-05 18:32 ` [PATCH 1/3] hwmon: (pmbus) Add new flag PMBUS_READ_STATUS_AFTER_FAILED_CHECK Erik Rosen
2021-05-06 4:06 ` Guenter Roeck
2021-05-05 18:32 ` Erik Rosen [this message]
2021-05-06 4:04 ` [PATCH 2/3] hwmon: (pmbus) Add documentation for new flags Guenter Roeck
2021-05-05 18:32 ` [PATCH 3/3] hwmon: (pmbus) Add support for additional Flex BMR converters to pmbus Erik Rosen
2021-05-06 4:02 ` 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=20210505183248.57082-3-erik.rosen@metormote.com \
--to=erik.rosen@metormote.com \
--cc=corbet@lwn.net \
--cc=jdelvare@suse.com \
--cc=linux-doc@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).