All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] patch to sensor-detect script to support SMSC EMC1023
@ 2011-01-17 16:14 Anish Patel
  2011-01-17 18:09 ` [lm-sensors] patch to sensor-detect script to support SMSC Guenter Roeck
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Anish Patel @ 2011-01-17 16:14 UTC (permalink / raw)
  To: lm-sensors

[-- Attachment #1: Type: text/plain, Size: 17 bytes --]

patch attached.


[-- Attachment #2: sensors-detect.patch --]
[-- Type: text/plain, Size: 1295 bytes --]

*** sensors-detect	Fri Jan 14 11:11:56 2011
--- sensors-detect-new	Sat Jan 15 03:01:01 2011
***************
*** 1205,1210 ****
--- 1205,1215 ----
  		i2c_addrs => [0x18, 0x2a, 0x4c, 0x4d],
  		i2c_detect => sub { emc1403_detect(@_, 3); },
  	}, {
+ 		name => "SMSC_EMC1023",
+ 		driver => "emc1023",
+ 		i2c_addrs => [0x48,0x49,0x4c,0x4d],
+ 		i2c_detect => sub { emc1023_detect(@_); },
+ 	}, {
  		name => "ST STTS424",
  		driver => "jc42",
  		i2c_addrs => [0x18..0x1f],
***************
*** 5387,5392 ****
--- 5392,5418 ----
  	return 6;
  }
  
+ # Chip to detect:
+ # Registers used:
+ #   0xed: Device ID register
+ #   0xfe: Vendor ID register
+ #   0xff: Revision register
+ sub emc1023_detect
+ {
+ 	my ($file, $addr, $chip) = @_;
+ 	my $dev_id = i2c_smbus_read_byte_data($file, 0xed);
+ 	my $man_id = i2c_smbus_read_byte_data($file, 0xfe);
+ 	my $rev = i2c_smbus_read_byte_data($file, 0xff);
+ 
+ 	return unless $man_id == 0x5d;	# SMSC
+ 
+ 	return unless ($dev_id == 0x0c) || ($dev_id == 0x0d) || ($dev_id == 0x08) || ($dev_id == 0x09) ;
+ 	return unless $rev == 0x01;
+ 	
+ 	return 9;
+ }
+ 
+ 
  # This checks for non-FFFF values for temperature, voltage, and current.
  # The address (0x0b) is specified by the SMBus standard so it's likely
  # that this really is a smart battery.

[-- Attachment #3: Type: text/plain, Size: 153 bytes --]

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-01-19  4:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-17 16:14 [lm-sensors] patch to sensor-detect script to support SMSC EMC1023 Anish Patel
2011-01-17 18:09 ` [lm-sensors] patch to sensor-detect script to support SMSC Guenter Roeck
2011-01-17 19:04 ` Anish Patel
2011-01-17 19:36 ` Guenter Roeck
2011-01-17 20:29 ` Anish Patel
2011-01-17 21:04 ` Guenter Roeck
2011-01-18 22:02 ` Anish Patel
2011-01-18 22:15 ` Guenter Roeck
2011-01-18 22:25 ` Anish Patel
2011-01-18 22:34 ` Guenter Roeck
2011-01-19  4:04 ` Anish Patel

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.