mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-08-31 14:25:39 +00:00
Add detection for Texas Instruments AMC6821.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5811 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
@@ -937,6 +937,11 @@ use vars qw(@i2c_adapter_names);
|
||||
driver => "tmp421",
|
||||
i2c_addrs => [0x4c, 0x4d],
|
||||
i2c_detect => sub { tmp42x_detect(@_, 2); },
|
||||
}, {
|
||||
name => "Texas Instruments AMC6821",
|
||||
driver => "amc6821",
|
||||
i2c_addrs => [0x18..0x1a, 0x2c..0x2e, 0x4c..0x4e],
|
||||
i2c_detect => sub { amc6821_detect(@_); },
|
||||
}, {
|
||||
name => "National Semiconductor LM95231",
|
||||
driver => "to-be-written",
|
||||
@@ -4047,6 +4052,22 @@ sub tmp42x_detect()
|
||||
return;
|
||||
}
|
||||
|
||||
# Registers used:
|
||||
# 0x3d: Device ID
|
||||
# 0x3e: Company ID
|
||||
sub amc6821_detect()
|
||||
{
|
||||
my ($file, $addr) = @_;
|
||||
|
||||
my $dev_id = i2c_smbus_read_byte_data($file, 0x3d);
|
||||
my $comp_id = i2c_smbus_read_byte_data($file, 0x3e);
|
||||
|
||||
return if ($comp_id != 0x49); # Texas Instruments
|
||||
return 5 if ($dev_id == 0x21); # AMC6821
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
# Registers used:
|
||||
# 0x03: Configuration (no low nibble, returns the previous low nibble)
|
||||
# 0x04: Conversion rate
|
||||
|
Reference in New Issue
Block a user