Changeset 2440
- Timestamp:
- 04/14/04 20:29:24 (5 years ago)
- Files:
-
- lm-sensors/trunk/doc/chips/SUMMARY (modified) (1 diff)
- lm-sensors/trunk/doc/chips/lm92 (modified) (2 diffs)
- lm-sensors/trunk/kernel/chips/lm92.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lm-sensors/trunk/doc/chips/SUMMARY
r2428 r2440 136 136 137 137 lm92 138 (all are reported as an "lm92") 138 139 lm92 1 - - - yes no 140 max6633 1 - - - yes no 141 max6634 1 - - - yes no 142 max6635 1 - - - yes no 143 (lm76 needs force parameter) 144 lm76 1 - - - yes no 139 145 140 146 maxilife lm-sensors/trunk/doc/chips/lm92
r1722 r2440 8 8 Prefix `lm92' 9 9 Addresses scanned: I2C 0x48 - 0x4b (inclusive) 10 * National Semiconductors LM76 11 Prefix `lm92' 12 Addresses scanned: none, force parameter needed 13 * Maxim MAX6633/MAX6634/MAX6635 14 Prefix `lm92' 15 Addresses scanned: I2C 0x48 - 0x4f (inclusive) 16 MAX6633 with address in 0x40 - 0x47 needs force parameter 10 17 11 18 Author: Abraham van der Merwe <abraham@2d3d.co.za> … … 47 54 interrupt pins (INT, T_CRIT_A) are ignored. 48 55 56 Support was added later for the LM76 and Maxim MAX6633/MAX6634/MAX6635, 57 which are mostly compatible. They have not all been tested, so you 58 may need to use the force parameter. 59 49 60 50 61 Hardware Configurations lm-sensors/trunk/kernel/chips/lm92.c
r2437 r2440 108 108 /* addresses to scan */ 109 109 static unsigned short normal_i2c[] = { SENSORS_I2C_END }; 110 static unsigned short normal_i2c_range[] = { 0x48, 0x4 b, SENSORS_I2C_END };110 static unsigned short normal_i2c_range[] = { 0x48, 0x4f, SENSORS_I2C_END }; 111 111 static unsigned int normal_isa[] = { SENSORS_ISA_END }; 112 112 static unsigned int normal_isa_range[] = { SENSORS_ISA_END }; … … 232 232 } 233 233 234 static int max6635_check(struct i2c_client *client) 235 { 236 int i; 237 u16 temp_low, temp_high, temp_hyst, temp_crit; 238 u8 conf; 239 240 temp_low = i2c_smbus_read_word_data(client, LM92_REG_TRIP_LOW); 241 temp_high = i2c_smbus_read_word_data(client, LM92_REG_TRIP_HIGH); 242 temp_hyst = i2c_smbus_read_word_data(client, LM92_REG_TRIP_HYSTERESIS); 243 temp_crit = i2c_smbus_read_word_data(client, LM92_REG_TRIP_CRITICAL); 244 245 if ((temp_low & 0x7f00) || (temp_high & 0x7f00) 246 || (temp_hyst & 0x7f00) || (temp_crit & 0x7f00)) 247 return 0; 248 249 conf = i2c_smbus_read_byte_data(client, LM92_REG_CONFIGURATION); 250 251 for (i=0; i<128; i+=16) { 252 if (temp_low != i2c_smbus_read_word_data(client, LM92_REG_TRIP_LOW + i) 253 || temp_high != i2c_smbus_read_word_data(client, LM92_REG_TRIP_HIGH + i) 254 || temp_hyst != i2c_smbus_read_word_data(client, LM92_REG_TRIP_HYSTERESIS + i) 255 || temp_crit != i2c_smbus_read_word_data(client, LM92_REG_TRIP_CRITICAL + i) 256 || conf != i2c_smbus_read_byte_data(client, LM92_REG_CONFIGURATION + i)) 257 return 0; 258 } 259 260 return 1; 261 } 262 234 263 static int lm92_init_client (struct i2c_client *client) 235 264 { … … 295 324 } 296 325 297 if ((kind < 0 && lm92_read16 (client,LM92_REG_MANUFACTURER,&manufacturer) < 0) || 298 manufacturer != LM92_MANUFACTURER_ID) { 299 kfree (client); 300 up (&mutex); 301 return (-ENODEV); 326 if (kind < 0) { 327 /* Is it an lm92? */ 328 if (address < 0x4c 329 && (lm92_read16(client,LM92_REG_MANUFACTURER,&manufacturer) < 0 330 || manufacturer != LM92_MANUFACTURER_ID)) { 331 /* Is it a MAX6635/MAX6635/MAX6635? */ 332 if (!max6635_check(client)) { 333 kfree (client); 334 up (&mutex); 335 return (-ENODEV); 336 } 337 } 302 338 } 303 339
