| | 925 | } , |
| | 926 | { |
| | 927 | name => "Asus ASM58 Mozart-2", |
| | 928 | driver => "to-be-written", |
| | 929 | i2c_addrs => [0x77], |
| | 930 | i2c_detect => sub { mozart_detect 0, @_}, |
| | 931 | } , |
| | 932 | { |
| | 933 | name => "Asus AS2K129R Mozart-2", |
| | 934 | driver => "to-be-written", |
| | 935 | i2c_addrs => [0x77], |
| | 936 | i2c_detect => sub { mozart_detect 1, @_}, |
| | 937 | } , |
| | 938 | { |
| | 939 | name => "Asus Mozart-2", |
| | 940 | driver => "to-be-written", |
| | 941 | i2c_addrs => [0x77], |
| | 942 | i2c_detect => sub { mozart_detect 2, @_}, |
| | 2605 | } |
| | 2606 | |
| | 2607 | # $_[0]: Chip to detect (0 = ASM58, 1 = AS2K129R, 2 = ???) |
| | 2608 | # $_[1]: A reference to the file descriptor to access this chip |
| | 2609 | # $_[2]: Address (unused) |
| | 2610 | # Returns: undef if not detected, 5 if detected |
| | 2611 | # Registers used: |
| | 2612 | # 0x4e: Vendor ID high byte |
| | 2613 | # 0x4f: Vendor ID low byte |
| | 2614 | # 0x58: Device ID |
| | 2615 | # Note: The values were given by Alex van Kaam, we don't have datasheets |
| | 2616 | # to confirm. |
| | 2617 | sub mozart_detect |
| | 2618 | { |
| | 2619 | my ($vid,$dev); |
| | 2620 | my ($chip,$file,$addr) = @_; |
| | 2621 | |
| | 2622 | $vid = (i2c_smbus_read_byte_data($file,0x4e) << 8) |
| | 2623 | + i2c_smbus_read_byte_data($file,0x4f); |
| | 2624 | $dev = i2c_smbus_read_byte_data($file,0x58); |
| | 2625 | |
| | 2626 | return if ($chip == 0) and ($dev != 0x56 || $vid != 0x9436); |
| | 2627 | return if ($chip == 1) and ($dev != 0x56 || $vid != 0x9406); |
| | 2628 | return if ($chip == 2) and ($dev != 0x10 || $vid != 0x5ca3); |
| | 2629 | |
| | 2630 | return 5; |