2023-10-27 10:34:36

by Naresh Solanki

[permalink] [raw]
Subject: [PATCH] hwmon: (pmbus/mp2975) Move PGOOD fix

The PGOOD fix was intended for MP2973 & MP2971 & not for MP2975.

Signed-off-by: Naresh Solanki <[email protected]>
---
drivers/hwmon/pmbus/mp2975.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/hwmon/pmbus/mp2975.c b/drivers/hwmon/pmbus/mp2975.c
index 26ba50633100..b9bb469e2d8f 100644
--- a/drivers/hwmon/pmbus/mp2975.c
+++ b/drivers/hwmon/pmbus/mp2975.c
@@ -297,6 +297,11 @@ static int mp2973_read_word_data(struct i2c_client *client, int page,
int ret;

switch (reg) {
+ case PMBUS_STATUS_WORD:
+ /* MP2973 & MP2971 return PGOOD instead of PB_STATUS_POWER_GOOD_N. */
+ ret = pmbus_read_word_data(client, page, phase, reg);
+ ret ^= PB_STATUS_POWER_GOOD_N;
+ break;
case PMBUS_OT_FAULT_LIMIT:
ret = mp2975_read_word_helper(client, page, phase, reg,
GENMASK(7, 0));
@@ -380,11 +385,6 @@ static int mp2975_read_word_data(struct i2c_client *client, int page,
int ret;

switch (reg) {
- case PMBUS_STATUS_WORD:
- /* MP2973 & MP2971 return PGOOD instead of PB_STATUS_POWER_GOOD_N. */
- ret = pmbus_read_word_data(client, page, phase, reg);
- ret ^= PB_STATUS_POWER_GOOD_N;
- break;
case PMBUS_OT_FAULT_LIMIT:
ret = mp2975_read_word_helper(client, page, phase, reg,
GENMASK(7, 0));

base-commit: 5421af83a43bdcb646564fec238253d11009ad3f
--
2.41.0


2023-10-27 14:27:33

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH] hwmon: (pmbus/mp2975) Move PGOOD fix

On Fri, Oct 27, 2023 at 10:33:52AM +0000, Naresh Solanki wrote:
> The PGOOD fix was intended for MP2973 & MP2971 & not for MP2975.
>
> Signed-off-by: Naresh Solanki <[email protected]>

Good catch. Applied.

Thanks,
Guenter

> ---
> drivers/hwmon/pmbus/mp2975.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
>
> base-commit: 5421af83a43bdcb646564fec238253d11009ad3f
>
> diff --git a/drivers/hwmon/pmbus/mp2975.c b/drivers/hwmon/pmbus/mp2975.c
> index 26ba50633100..b9bb469e2d8f 100644
> --- a/drivers/hwmon/pmbus/mp2975.c
> +++ b/drivers/hwmon/pmbus/mp2975.c
> @@ -297,6 +297,11 @@ static int mp2973_read_word_data(struct i2c_client *client, int page,
> int ret;
>
> switch (reg) {
> + case PMBUS_STATUS_WORD:
> + /* MP2973 & MP2971 return PGOOD instead of PB_STATUS_POWER_GOOD_N. */
> + ret = pmbus_read_word_data(client, page, phase, reg);
> + ret ^= PB_STATUS_POWER_GOOD_N;
> + break;
> case PMBUS_OT_FAULT_LIMIT:
> ret = mp2975_read_word_helper(client, page, phase, reg,
> GENMASK(7, 0));
> @@ -380,11 +385,6 @@ static int mp2975_read_word_data(struct i2c_client *client, int page,
> int ret;
>
> switch (reg) {
> - case PMBUS_STATUS_WORD:
> - /* MP2973 & MP2971 return PGOOD instead of PB_STATUS_POWER_GOOD_N. */
> - ret = pmbus_read_word_data(client, page, phase, reg);
> - ret ^= PB_STATUS_POWER_GOOD_N;
> - break;
> case PMBUS_OT_FAULT_LIMIT:
> ret = mp2975_read_word_helper(client, page, phase, reg,
> GENMASK(7, 0));