| 1008 | | /** EEPROM **/ |
| 1009 | | |
| 1010 | | static const char * |
| 1011 | | fmtType_EEPROM |
| 1012 | | (const double values[], int alarm, int beep) { |
| 1013 | | if ((int) values[0] == 4) |
| 1014 | | sprintf (buff, "SDRAM DIMM SPD"); |
| 1015 | | else if ((int) values[0] == 7) |
| 1016 | | sprintf (buff, "DDR SDRAM DIMM SPD"); |
| 1017 | | else |
| 1018 | | sprintf (buff, "Invalid"); /* N.B: sensors just returns, aborting further tests; I don't.. */ |
| 1019 | | return fmtExtra (alarm, beep); |
| 1020 | | } |
| 1021 | | |
| 1022 | | static const char * |
| 1023 | | fmtRowCol_EEPROM |
| 1024 | | (const double values[], int alarm, int beep) { |
| 1025 | | int row = (int) values[0]; |
| 1026 | | int col = (int) values[1]; |
| 1027 | | int num = (int) values[2]; |
| 1028 | | int banks = (int) values[3]; |
| 1029 | | int foo = (row & 0xf) + (col & 0xf) + 17; |
| 1030 | | if ((foo > 0) && (foo <= 12) && (num <= 8) && (banks <= 8)) { |
| 1031 | | sprintf (buff, "%d", (1 << foo) * num * banks); |
| 1032 | | } else { |
| 1033 | | sprintf (buff, "Invalid %d %d %d %d", row, col, num, banks); |
| 1034 | | } |
| 1035 | | return buff; |
| 1036 | | } |
| 1037 | | |
| 1038 | | static const char *eeprom_names[] = { |
| 1039 | | SENSORS_EEPROM_PREFIX, NULL |
| 1040 | | }; |
| 1041 | | |
| 1042 | | static const FeatureDescriptor eeprom_features[] = { |
| 1043 | | { fmtType_EEPROM, NULL, DataType_other, 0, 0, |
| 1044 | | { SENSORS_EEPROM_TYPE, -1 } }, |
| 1045 | | { fmtRowCol_EEPROM, NULL, DataType_other, 0, 0, |
| 1046 | | { SENSORS_EEPROM_ROWADDR, SENSORS_EEPROM_COLADDR, SENSORS_EEPROM_NUMROWS, SENSORS_EEPROM_BANKS, -1 } }, |
| 1047 | | { NULL } |
| 1048 | | }; |
| 1049 | | |
| 1050 | | static const ChipDescriptor eeprom_chip = { |
| 1051 | | eeprom_names, eeprom_features, 0, 0 |
| 1052 | | }; |
| 1053 | | |