| 643 | | i2c_detect => sub { lm93_detect(@_); }, |
| | 643 | i2c_detect => sub { lm93_detect(@_, 0); }, |
| | 644 | }, { |
| | 645 | name => "National Semiconductor LM94", |
| | 646 | driver => "to-be-written", # Most likely lm93 |
| | 647 | i2c_addrs => [0x2c..0x2e], |
| | 648 | i2c_detect => sub { lm93_detect(@_, 1); }, |
| 5234 | | my ($file, $addr) = @_; |
| 5235 | | return unless i2c_smbus_read_byte_data($file, 0x3E) == 0x01 |
| 5236 | | and i2c_smbus_read_byte_data($file, 0x3F) == 0x73; |
| | 5240 | my ($file, $addr, $chip) = @_; |
| | 5241 | my ($man_id, $dev_id); |
| | 5242 | |
| | 5243 | $man_id = i2c_smbus_read_byte_data($file, 0x3E); |
| | 5244 | $dev_id = i2c_smbus_read_byte_data($file, 0x3F); |
| | 5245 | |
| | 5246 | if ($chip == 0) { |
| | 5247 | return unless $man_id == 0x01 # National Semiconductor |
| | 5248 | and $dev_id == 0x73; # LM93 |
| | 5249 | } |
| | 5250 | if ($chip == 1) { |
| | 5251 | return unless $man_id == 0x01 # National Semiconductor |
| | 5252 | and $dev_id >= 0x79 |
| | 5253 | and $dev_id <= 0x7A; # LM94 |
| | 5254 | } |