Skip to content

Commit

Permalink
hwmon: (pmbus) Add documentation for new flags
Browse files Browse the repository at this point in the history
Add documentation for the new pmbus flags PMBUS_WRITE_PROTECTED,
PMBUS_NO_CAPABILITY and PMBUS_READ_STATUS_AFTER_FAILED_CHECK

Signed-off-by: Erik Rosen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[groeck: Added newline at end of file]
Signed-off-by: Guenter Roeck <[email protected]>
  • Loading branch information
metormote authored and groeck committed Jun 17, 2021
1 parent 86c908d commit b976760
Showing 1 changed file with 38 additions and 4 deletions.
42 changes: 38 additions & 4 deletions Documentation/hwmon/pmbus-core.rst
Original file line number Diff line number Diff line change
Expand Up @@ -289,21 +289,32 @@ 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 provides a flags field with four bits used::

#define PMBUS_SKIP_STATUS_CHECK (1 << 0)
#define PMBUS_SKIP_STATUS_CHECK BIT(0)

#define PMBUS_WRITE_PROTECTED BIT(1)

#define PMBUS_NO_CAPABILITY BIT(2)

#define PMBUS_READ_STATUS_AFTER_FAILED_CHECK BIT(3)

struct pmbus_platform_data {
u32 flags; /* Device specific flags */

/* regulator support */
int num_regulators;
struct regulator_init_data *reg_init_data;
};


Flags
-----

PMBUS_SKIP_STATUS_CHECK
During register detection, skip checking the status register for
communication or command errors.

During register detection, skip checking the status register for
communication or command errors.

Some PMBus chips respond with valid data when trying to read an unsupported
register. For such chips, checking the status register is mandatory when
Expand All @@ -315,3 +326,26 @@ 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_NO_CAPABILITY

Some PMBus chips don't respond with valid data when reading the CAPABILITY
register. For such chips, this flag should be set so that the PMBus core
driver doesn't use CAPABILITY to determine it's behavior.

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.

0 comments on commit b976760

Please sign in to comment.