| | 1059 | name => "Analog Devices ADT7462", |
| | 1060 | driver => "to-be-written", |
| | 1061 | # The datasheet says addresses 0x5C and 0x58, but I guess these are |
| | 1062 | # left-aligned values |
| | 1063 | i2c_addrs => [0x2c, 0x2e], |
| | 1064 | i2c_detect => sub { adt7467_detect(2, @_); }, |
| | 1065 | }, |
| | 1066 | { |
| | 1067 | name => "Analog Devices ADT7466", |
| | 1068 | driver => "to-be-written", |
| | 1069 | i2c_addrs => [0x4c], |
| | 1070 | i2c_detect => sub { adt7467_detect(3, @_); }, |
| | 1071 | }, |
| | 1072 | { |
| | 1077 | }, |
| | 1078 | { |
| | 1079 | name => "Analog Devices ADT7470", |
| | 1080 | driver => "to-be-written", |
| | 1081 | i2c_addrs => [0x2c, 0x2e, 0x2f], |
| | 1082 | i2c_detect => sub { adt7467_detect(4, @_); }, |
| | 1083 | }, |
| | 1084 | { |
| | 1085 | name => "Analog Devices ADT7473", |
| | 1086 | driver => "to-be-written", |
| | 1087 | i2c_addrs => [0x2e], |
| | 1088 | i2c_detect => sub { adt7473_detect(0, @_); }, |
| | 1089 | }, |
| | 1090 | { |
| | 1091 | name => "Analog Devices ADT7475", |
| | 1092 | driver => "to-be-written", |
| | 1093 | i2c_addrs => [0x2e], |
| | 1094 | i2c_detect => sub { adt7473_detect(1, @_); }, |
| | 1464 | }, |
| | 1465 | { |
| | 1466 | name => "Analog Devices ADM1033", |
| | 1467 | driver => "to-be-written", |
| | 1468 | i2c_addrs => [0x50..0x53], |
| | 1469 | i2c_detect => sub { adm1034_detect(0, @_); }, |
| | 1470 | }, |
| | 1471 | { |
| | 1472 | name => "Analog Devices ADM1034", |
| | 1473 | driver => "to-be-written", |
| | 1474 | i2c_addrs => [0x50..0x53], |
| | 1475 | i2c_detect => sub { adm1034_detect(1, @_); }, |
| 3712 | | # (0 = ADT7467/ADT7468, 1 = ADT7674) |
| | 3756 | # (0 = ADM1033, 1 = ADM1034) |
| | 3757 | # $_[1]: A reference to the file descriptor to access this chip. |
| | 3758 | # $_[2]: Address (unused) |
| | 3759 | # Returns: undef if not detected, 4 or 6 if detected. |
| | 3760 | # Registers used: |
| | 3761 | # 0x3d: Chip ID |
| | 3762 | # 0x3e: Manufacturer ID |
| | 3763 | # 0x3f: Die revision |
| | 3764 | sub adm1034_detect |
| | 3765 | { |
| | 3766 | my ($chip, $file, $addr) = @_; |
| | 3767 | my $mid = i2c_smbus_read_byte_data($file, 0x3e); |
| | 3768 | my $cid = i2c_smbus_read_byte_data($file, 0x3d); |
| | 3769 | my $drev = i2c_smbus_read_byte_data($file, 0x3f); |
| | 3770 | |
| | 3771 | if ($chip == 0) { |
| | 3772 | return if $mid != 0x41; # Analog Devices |
| | 3773 | return if $cid != 0x33; # ADM1033 |
| | 3774 | return if ($drev & 0xf8) != 0x00; |
| | 3775 | return 6 if $drev == 0x02; |
| | 3776 | return 4; |
| | 3777 | } |
| | 3778 | if ($chip == 1) { |
| | 3779 | return if $mid != 0x41; # Analog Devices |
| | 3780 | return if $cid != 0x34; # ADM1034 |
| | 3781 | return if ($drev & 0xf8) != 0x00; |
| | 3782 | return 6 if $drev == 0x02; |
| | 3783 | return 4; |
| | 3784 | } |
| | 3785 | return |
| | 3786 | } |
| | 3787 | |
| | 3788 | # $_[0]: Chip to detect |
| | 3789 | # (0 = ADT7467/ADT7468, 1 = ADT7476, 2 = ADT7462, 3 = ADT7466, |
| | 3790 | # 4 = ADT7470) |
| | 3818 | return 5; |
| | 3819 | } |
| | 3820 | if ($chip == 2) { |
| | 3821 | return if $mid != 0x41; # Analog Devices |
| | 3822 | return if $cid != 0x62; # ADT7462 |
| | 3823 | return if ($drev & 0xf0) != 0x00; |
| | 3824 | return 7 if ($drev == 0x04); |
| | 3825 | return 5; |
| | 3826 | } |
| | 3827 | if ($chip == 3) { |
| | 3828 | return if $mid != 0x41; # Analog Devices |
| | 3829 | return if $cid != 0x66; # ADT7466 |
| | 3830 | return if ($drev & 0xf0) != 0x00; |
| | 3831 | return 7 if ($drev == 0x02); |
| | 3832 | return 5; |
| | 3833 | } |
| | 3834 | if ($chip == 4) { |
| | 3835 | return if $mid != 0x41; # Analog Devices |
| | 3836 | return if $cid != 0x70; # ADT7470 |
| | 3837 | return if ($drev & 0xf0) != 0x00; |
| | 3838 | return 7 if ($drev == 0x00); |
| | 3839 | return 5; |
| | 3840 | } |
| | 3841 | return |
| | 3842 | } |
| | 3843 | |
| | 3844 | # $_[0]: Chip to detect |
| | 3845 | # (0 = ADT7473, 1 = ADT7475) |
| | 3846 | # $_[1]: A reference to the file descriptor to access this chip. |
| | 3847 | # $_[2]: Address (unused) |
| | 3848 | # Returns: undef if not detected, 5 if detected. |
| | 3849 | # Registers used: |
| | 3850 | # 0x3d: Chip ID |
| | 3851 | # 0x3e: Manufacturer ID |
| | 3852 | sub adt7473_detect |
| | 3853 | { |
| | 3854 | my ($chip, $file, $addr) = @_; |
| | 3855 | my $mid = i2c_smbus_read_byte_data($file, 0x3e); |
| | 3856 | my $cid = i2c_smbus_read_byte_data($file, 0x3d); |
| | 3857 | |
| | 3858 | if ($chip == 0) { |
| | 3859 | return if $mid != 0x41; # Analog Devices |
| | 3860 | return if $cid != 0x73; # ADT7473 |
| | 3861 | return 5; |
| | 3862 | } |
| | 3863 | if ($chip == 1) { |
| | 3864 | return if $mid != 0x41; # Analog Devices |
| | 3865 | return if $cid != 0x75; # ADT7475 |