From: Guenter Roeck <guenter.roeck@ericsson.com>
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] lm-sensors: Add detection of MAX6639
Date: Fri, 21 Jan 2011 16:58:22 +0000 [thread overview]
Message-ID: <20110121165822.GA13021@ericsson.com> (raw)
Index: prog/detect/sensors-detect
=================================--- prog/detect/sensors-detect (revision 5906)
+++ prog/detect/sensors-detect (working copy)
@@ -828,6 +828,11 @@
i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e],
i2c_detect => sub { max1668_detect(@_, 2); },
}, {
+ name => "Maxim MAX6639",
+ driver => "max6639",
+ i2c_addrs => [0x2c, 0x2e, 0x2f],
+ i2c_detect => sub { max6639_detect(@_); },
+ }, {
name => "Maxim MAX6650/MAX6651",
driver => "max6650",
i2c_addrs => [0x1b, 0x1f, 0x48, 0x4b],
@@ -5446,6 +5451,27 @@
return @res;
}
+# Chip to detect: MAX6639
+# Registers used:
+# 0x3d: Device ID
+# 0x3e: Manufacturer ID
+# 0x3f: Chip revision
+sub max6639_detect
+{
+ my ($file, $addr) = @_;
+ my ($man_id, $dev_id, $rev);
+
+ $dev_id = i2c_smbus_read_byte_data($file, 0x3d);
+ $man_id = i2c_smbus_read_byte_data($file, 0x3e);
+ $rev = i2c_smbus_read_byte_data($file, 0x3f);
+
+ return unless $man_id = 0x4d; # Maxim
+ return unless $dev_id = 0x58; # MAX6639
+ return unless $rev = 0x00;
+
+ return 6;
+}
+
# The max6650 has no device ID register. However, a few registers have
# spare bits, which are documented as being always zero on read. We read
# all of these registers check the spare bits. Any non-zero means this
Index: CHANGES
=================================--- CHANGES (revision 5906)
+++ CHANGES (working copy)
@@ -19,6 +19,7 @@
Add detection of the National Semiconductor LM94
Add detection of the ITE IT8728F
Implement universal detection for coretemp (#2381)
+ Add detection of Maxim MAX6639
3.2.0 (2010-10-10)
libsensors: Increase MAX_SENSORS_PER_TYPE to 24
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next reply other threads:[~2011-01-21 16:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-21 16:58 Guenter Roeck [this message]
2011-01-21 17:06 ` [lm-sensors] lm-sensors: Add detection of MAX6639 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=20110121165822.GA13021@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.