2020-12-22 15:29:42

by Eddie James

[permalink] [raw]
Subject: [PATCH v2 0/2] hwmon: (pmbus) Add the PMBUS_NO_CAPABILITY flag

Some PMBus chips, like some power supplies supported by the cffps driver,
don't respond with valid data when reading the CAPABILITY register. Add a
platform data flag that device drivers can set to tell the PMBus core
driver that it shouldn't use the CAPABILITY register. The second patch
sets this flag for the cffps driver.

Changes since v1:
- Rename the flag to PMBUS_NO_CAPABILITY and adjust the associated
comment accordingly.

Eddie James (2):
hwmon: (pmbus) Add a PMBUS_NO_CAPABILITY platform data flag
hwmon: (pmbus/ibm-cffps) Set the PMBUS_NO_CAPABILITY flag

drivers/hwmon/pmbus/ibm-cffps.c | 2 +-
drivers/hwmon/pmbus/pmbus_core.c | 8 +++++---
include/linux/pmbus.h | 9 +++++++++
3 files changed, 15 insertions(+), 4 deletions(-)

--
2.27.0


2020-12-22 15:29:53

by Eddie James

[permalink] [raw]
Subject: [PATCH v2 2/2] hwmon: (pmbus/ibm-cffps) Set the PMBUS_NO_CAPABILITY flag

Several power supplies supported by the IBM CFFPS driver don't
report valid data in the CAPABILITY register. This results in PEC
being enabled when it's not supported by the device, and since
the automatic version detection might fail, disable use of the
CAPABILITY register across the board for this driver.

Signed-off-by: Eddie James <[email protected]>
---
drivers/hwmon/pmbus/ibm-cffps.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/pmbus/ibm-cffps.c b/drivers/hwmon/pmbus/ibm-cffps.c
index d6bbbb223871..ffde5aaa5036 100644
--- a/drivers/hwmon/pmbus/ibm-cffps.c
+++ b/drivers/hwmon/pmbus/ibm-cffps.c
@@ -472,7 +472,7 @@ static struct pmbus_driver_info ibm_cffps_info[] = {
};

static struct pmbus_platform_data ibm_cffps_pdata = {
- .flags = PMBUS_SKIP_STATUS_CHECK,
+ .flags = PMBUS_SKIP_STATUS_CHECK | PMBUS_NO_CAPABILITY,
};

static int ibm_cffps_probe(struct i2c_client *client)
--
2.27.0

2020-12-23 15:42:25

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] hwmon: (pmbus/ibm-cffps) Set the PMBUS_NO_CAPABILITY flag

On Tue, Dec 22, 2020 at 09:26:40AM -0600, Eddie James wrote:
> Several power supplies supported by the IBM CFFPS driver don't
> report valid data in the CAPABILITY register. This results in PEC
> being enabled when it's not supported by the device, and since
> the automatic version detection might fail, disable use of the
> CAPABILITY register across the board for this driver.
>
> Signed-off-by: Eddie James <[email protected]>

Applied.

Thanks,
Guenter