Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Adam Wujek <dev_public@wujek.eu>
Cc: Jean Delvare <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: (pmbus) allow to use a custom read_byte_data function for PMBUS_CAPABILITY
Date: Tue, 19 Apr 2022 15:08:19 -0700	[thread overview]
Message-ID: <23a10930-e78b-d795-056e-879e52e2b45f@roeck-us.net> (raw)
In-Reply-To: <20220419215149.309760-1-dev_public@wujek.eu>

On 4/19/22 14:52, Adam Wujek wrote:
> Some devices returns a wrong value in PMBUS_CAPABILITY register.
> Allow the use of read_byte_data function defined in a driver for
> a specific device.

Those devices should set PMBUS_NO_CAPABILITY.

Guenter

> 
> Signed-off-by: Adam Wujek <dev_public@wujek.eu>
> ---
>   drivers/hwmon/pmbus/pmbus_core.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
> index f8ca36759b0a..ef9989be8f89 100644
> --- a/drivers/hwmon/pmbus/pmbus_core.c
> +++ b/drivers/hwmon/pmbus/pmbus_core.c
> @@ -2011,7 +2011,7 @@ static int pmbus_init_common(struct i2c_client *client, struct pmbus_data *data,
>   	}
> 
>   	/* Enable PEC if the controller supports it */
> -	ret = i2c_smbus_read_byte_data(client, PMBUS_CAPABILITY);
> +	ret = _pmbus_read_byte_data(client, -1, PMBUS_CAPABILITY);
>   	if (ret >= 0 && (ret & PB_CAPABILITY_ERROR_CHECK))
>   		client->flags |= I2C_CLIENT_PEC;
>   	else
> --
> 2.17.1
> 
> 


  reply	other threads:[~2022-04-19 22:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19 21:52 [PATCH] hwmon: (pmbus) allow to use a custom read_byte_data function for PMBUS_CAPABILITY Adam Wujek
2022-04-19 22:08 ` Guenter Roeck [this message]
2022-04-19 22:18   ` wujek dev

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=23a10930-e78b-d795-056e-879e52e2b45f@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=dev_public@wujek.eu \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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