From: Guenter Roeck <guenter.roeck@ericsson.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH 4/4] hwmon: (pmbus) Auto-detect temp2 and
Date: Sun, 03 Jul 2011 16:31:49 +0000 [thread overview]
Message-ID: <20110703163149.GD15945@ericsson.com> (raw)
In-Reply-To: <1309454993-8641-5-git-send-email-guenter.roeck@ericsson.com>
Hi Jean,
On Sun, Jul 03, 2011 at 07:14:28AM -0400, Jean Delvare wrote:
> Hi Guenter,
>
> On Thu, 30 Jun 2011 10:29:53 -0700, Guenter Roeck wrote:
> > Additional temperature attribute support is easy to detect, so do it.
> >
> > Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
> > ---
> > drivers/hwmon/pmbus.c | 4 ++++
> > 1 files changed, 4 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/hwmon/pmbus.c b/drivers/hwmon/pmbus.c
> > index b0ea00b..931d940 100644
> > --- a/drivers/hwmon/pmbus.c
> > +++ b/drivers/hwmon/pmbus.c
> > @@ -65,6 +65,10 @@ static void pmbus_find_sensor_groups(struct i2c_client *client,
> > PMBUS_STATUS_TEMPERATURE))
> > info->func[0] |= PMBUS_HAVE_STATUS_TEMP;
> > }
> > + if (pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_2))
> > + info->func[0] |= PMBUS_HAVE_TEMP2;
> > + if (pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_3))
> > + info->func[0] |= PMBUS_HAVE_TEMP3;
>
> Looks good, but is it not possible for a device to have temp2 (or
> temp3) but not temp1? If it is, then the test for
> PMBUS_STATUS_TEMPERATURE should be moved after the test for
> PMBUS_READ_TEMPERATURE_3, and should depend on any of PMBUS_HAVE_TEMP*
> being set. If it is not possible, then the code is fine as it is and:
>
Yes, you are right, that condition can happen. I'll update the code and submit
another patch for it. Not that urgent, since I am not (yet) aware of a PMBus
device actually doing it, but given the inventiveness of PMBus device developers
I am sure we will hit that condition at some point.
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
prev parent reply other threads:[~2011-07-03 16:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-30 17:29 [lm-sensors] [PATCH 4/4] hwmon: (pmbus) Auto-detect temp2 and temp3 Guenter Roeck
2011-07-03 11:14 ` [lm-sensors] [PATCH 4/4] hwmon: (pmbus) Auto-detect temp2 and Jean Delvare
2011-07-03 16:31 ` Guenter Roeck [this message]
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=20110703163149.GD15945@ericsson.com \
--to=guenter.roeck@ericsson.com \
--cc=lm-sensors@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.