[PATCH] Add detection of SMSC EMC2103 to sensors-detect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch allows the sensors-detect script to detect the SMSC
EMC2103 family of temperature sensors and fan controllers.

Signed-off-by: Steve Glendinning <steve.glendinning@xxxxxxxx>
---
 prog/detect/sensors-detect |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect
index 43b1095..7d59cee 100755
--- a/prog/detect/sensors-detect
+++ b/prog/detect/sensors-detect
@@ -1130,6 +1130,11 @@ use vars qw(@i2c_adapter_names);
 		i2c_addrs => [0x2c..0x2e],
 		i2c_detect => sub { dme1737_detect(@_, 2); },
 	}, {
+		name => "SMSC EMC2103",
+		driver => "smscemc",
+		i2c_addrs => [0x2e],
+		i2c_detect => sub { smsc_emc2103_detect(@_); },
+	}, {
 		name => "Fintek F75121R/F75122R/RG (VID+GPIO)",
 		driver => "to-be-written",
 		i2c_addrs => [0x4e], # 0x37 not probed
@@ -5079,6 +5084,21 @@ sub smsc47m192_detect
 	return ($addr == 0x2d ? 6 : 5);
 }
 
+# Registers used:
+#   0xFD: Product ID
+#   0xFE: Manufacturer ID
+#   0xFF: Revision
+sub smsc_emc2103_detect
+{
+	my ($file, $addr) = @_;
+	return unless i2c_smbus_read_byte_data($file, 0xFE) == 0x5D;
+
+	my $product = i2c_smbus_read_byte_data($file, 0xFD);
+	return unless (($product == 0x24) || ($product == 0x26));
+
+	return 8;
+}
+
 # Chip to detect: 1 = DME1737, 2 = SCH5027
 # Registers used:
 #   0x3E: Manufacturer ID
-- 
1.6.6.1


_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux