From: khali@linux-fr.org (Jean Delvare)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] #2195: Fails to detect ITE family chip with ID
Date: Thu, 22 Mar 2007 17:49:03 +0000 [thread overview]
Message-ID: <20070322184903.a58402f4.khali@linux-fr.org> (raw)
In-Reply-To: <191fb4ca0703220924o604d104iaf34922f53c7cf83@mail.gmail.com>
Hi Juerg,
On Thu, 22 Mar 2007 09:38:55 -0700, Juerg Haefliger wrote:
> looking at sensors-detect:
>
> > # $_[0]: A reference to the file descriptor to access this chip.
> > # $_[1]: Address
> > # Returns: undef if not detected, 5 or 6 if detected.
> > # Registers used:
> > # 0x3E: Manufacturer ID
> > # 0x3F: Version/Stepping
> > # 0x40: Configuration (2 reserved bits)
> > # 0x42: Interrupt Status 2 (1 reserved bit)
> > # 0x43: VID (2 reserved bits)
> > sub dme1737_detect
> > {
> > my ($file, $addr) = @_;
> > return unless i2c_smbus_read_byte_data($file, 0x3E) = 0x55
>
> this should be 0x5c not 0x55.
Correct, I came up to the same conclusion.
> > and (i2c_smbus_read_byte_data($file, 0x3F) & 0xF8) = 0x88
> > and (i2c_smbus_read_byte_data($file, 0x40) & 0xC4) = 0x04
> > and (i2c_smbus_read_byte_data($file, 0x42) & 0x02) = 0x00
> > and (i2c_smbus_read_byte_data($file, 0x43) & 0xC0) = 0x00;
>
> Are the checks of addresses 0x40, 0x42 & 0x43 really necessary?
>
> > return ($addr = 0x2e ? 6 : 5);
> }
There are no standard registers and no standard values to identify I2C
manufacturers and devices. So adding a few tests where possible cannot
hurt and is considered a good practice. So unless you have a reason to
believe that these tests could fail for an otherwise valid chip, I'd
leave them in. Especially the test of register 0x40 is valuable - the
test of register 0x42 certainly less.
We don't need to do this for Super-I/O or PCI devices because they have
standard identification registers.
Can you please provide a patch fixing sensors-detect for the DME1737?
Thanks,
--
Jean Delvare
next prev parent reply other threads:[~2007-03-22 17:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-22 16:24 [lm-sensors] #2195: Fails to detect ITE family chip with ID Juerg Haefliger
2007-03-22 16:38 ` Juerg Haefliger
2007-03-22 17:49 ` Jean Delvare [this message]
2007-03-22 17:50 ` Jean Delvare
2007-03-22 18:16 ` Juerg Haefliger
2007-03-22 18:39 ` Jean Delvare
2007-03-22 19:45 ` Juerg Haefliger
2007-03-22 19:56 ` Jean Delvare
2007-03-23 4:12 ` Juerg Haefliger
2007-03-23 8:25 ` Jean Delvare
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=20070322184903.a58402f4.khali@linux-fr.org \
--to=khali@linux-fr.org \
--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.