diff options
| author | Jordan Crouse <jordan.crouse@amd.com> | 2006-03-23 10:19:49 -0500 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-22 14:10:31 -0400 |
| commit | 43cb7ebee2f478d3f987ad773d4e6b07fc23c631 (patch) | |
| tree | f862838ccb28af35ba9e1951a26ba9fb4b99b0e3 | |
| parent | 52ab3f3dc711eeccbfbcc5d4f5c5d9b9ff59650f (diff) | |
[PATCH] lm83: Add LM82 support
Add LM82 temperature sensor support (similar to the LM83,
but less featureful).
Signed-off-by: Jordan Crouse <jordan.crouse@amd.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| -rw-r--r-- | Documentation/hwmon/lm83 | 16 | ||||
| -rw-r--r-- | drivers/hwmon/Kconfig | 4 | ||||
| -rw-r--r-- | drivers/hwmon/lm83.c | 50 |
3 files changed, 51 insertions, 19 deletions
diff --git a/Documentation/hwmon/lm83 b/Documentation/hwmon/lm83 index 061d9ed8ff43..74aa7ee1a359 100644 --- a/Documentation/hwmon/lm83 +++ b/Documentation/hwmon/lm83 | |||
| @@ -7,6 +7,10 @@ Supported chips: | |||
| 7 | Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e | 7 | Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e |
| 8 | Datasheet: Publicly available at the National Semiconductor website | 8 | Datasheet: Publicly available at the National Semiconductor website |
| 9 | http://www.national.com/pf/LM/LM83.html | 9 | http://www.national.com/pf/LM/LM83.html |
| 10 | * National Semiconductor LM82 | ||
| 11 | Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e | ||
| 12 | Datasheet: Publicly available at the National Semiconductor website | ||
| 13 | http://www.national.com/pf/LM/LM82.html | ||
| 10 | 14 | ||
| 11 | 15 | ||
| 12 | Author: Jean Delvare <khali@linux-fr.org> | 16 | Author: Jean Delvare <khali@linux-fr.org> |
| @@ -15,10 +19,11 @@ Description | |||
| 15 | ----------- | 19 | ----------- |
| 16 | 20 | ||
| 17 | The LM83 is a digital temperature sensor. It senses its own temperature as | 21 | The LM83 is a digital temperature sensor. It senses its own temperature as |
| 18 | well as the temperature of up to three external diodes. It is compatible | 22 | well as the temperature of up to three external diodes. The LM82 is |
| 19 | with many other devices such as the LM84 and all other ADM1021 clones. | 23 | a stripped down version of the LM83 that only supports one external diode. |
| 20 | The main difference between the LM83 and the LM84 in that the later can | 24 | Both are compatible with many other devices such as the LM84 and all |
| 21 | only sense the temperature of one external diode. | 25 | other ADM1021 clones. The main difference between the LM83 and the LM84 |
| 26 | in that the later can only sense the temperature of one external diode. | ||
| 22 | 27 | ||
| 23 | Using the adm1021 driver for a LM83 should work, but only two temperatures | 28 | Using the adm1021 driver for a LM83 should work, but only two temperatures |
| 24 | will be reported instead of four. | 29 | will be reported instead of four. |
| @@ -36,6 +41,9 @@ Unconfirmed motherboards: | |||
| 36 | Iwill MPX2 | 41 | Iwill MPX2 |
| 37 | Soltek SL-75DRV5 | 42 | Soltek SL-75DRV5 |
| 38 | 43 | ||
| 44 | The LM82 is confirmed to have been found on most AMD Geode reference | ||
| 45 | designs and test platforms. | ||
| 46 | |||
| 39 | The driver has been successfully tested by Magnus Forsström, who I'd | 47 | The driver has been successfully tested by Magnus Forsström, who I'd |
| 40 | like to thank here. More testers will be of course welcome. | 48 | like to thank here. More testers will be of course welcome. |
| 41 | 49 | ||
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index 99cdc612d2c6..a6a8d66129b3 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig | |||
| @@ -236,11 +236,11 @@ config SENSORS_LM80 | |||
| 236 | will be called lm80. | 236 | will be called lm80. |
| 237 | 237 | ||
| 238 | config SENSORS_LM83 | 238 | config SENSORS_LM83 |
| 239 | tristate "National Semiconductor LM83" | 239 | tristate "National Semiconductor LM83 and compatibles" |
| 240 | depends on HWMON && I2C | 240 | depends on HWMON && I2C |
| 241 | help | 241 | help |
| 242 | If you say yes here you get support for National Semiconductor | 242 | If you say yes here you get support for National Semiconductor |
| 243 | LM83 sensor chips. | 243 | LM82 and LM83 sensor chips. |
| 244 | 244 | ||
| 245 | This driver can also be built as a module. If so, the module | 245 | This driver can also be built as a module. If so, the module |
| 246 | will be called lm83. | 246 | will be called lm83. |
diff --git a/drivers/hwmon/lm83.c b/drivers/hwmon/lm83.c index aac4ec2bf694..2137d7879df6 100644 --- a/drivers/hwmon/lm83.c +++ b/drivers/hwmon/lm83.c | |||
| @@ -12,6 +12,10 @@ | |||
| 12 | * Since the datasheet omits to give the chip stepping code, I give it | 12 | * Since the datasheet omits to give the chip stepping code, I give it |
| 13 | * here: 0x03 (at register 0xff). | 13 | * here: 0x03 (at register 0xff). |
| 14 | * | 14 | * |
| 15 | * Also supports the LM82 temp sensor, which is basically a stripped down | ||
| 16 | * model of the LM83. Datasheet is here: | ||
| 17 | * http://www.national.com/pf/LM/LM82.html | ||
| 18 | * | ||
| 15 | * This program is free software; you can redistribute it and/or modify | 19 | * This program is free software; you can redistribute it and/or modify |
| 16 | * it under the terms of the GNU General Public License as published by | 20 | * it under the terms of the GNU General Public License as published by |
| 17 | * the Free Software Foundation; either version 2 of the License, or | 21 | * the Free Software Foundation; either version 2 of the License, or |
| @@ -52,7 +56,7 @@ static unsigned short normal_i2c[] = { 0x18, 0x19, 0x1a, | |||
| 52 | * Insmod parameters | 56 | * Insmod parameters |
| 53 | */ | 57 | */ |
| 54 | 58 | ||
| 55 | I2C_CLIENT_INSMOD_1(lm83); | 59 | I2C_CLIENT_INSMOD_2(lm83, lm82); |
| 56 | 60 | ||
| 57 | /* | 61 | /* |
| 58 | * The LM83 registers | 62 | * The LM83 registers |
| @@ -283,6 +287,9 @@ static int lm83_detect(struct i2c_adapter *adapter, int address, int kind) | |||
| 283 | if (man_id == 0x01) { /* National Semiconductor */ | 287 | if (man_id == 0x01) { /* National Semiconductor */ |
| 284 | if (chip_id == 0x03) { | 288 | if (chip_id == 0x03) { |
| 285 | kind = lm83; | 289 | kind = lm83; |
| 290 | } else | ||
| 291 | if (chip_id == 0x01) { | ||
| 292 | kind = lm82; | ||
| 286 | } | 293 | } |
| 287 | } | 294 | } |
| 288 | 295 | ||
| @@ -296,6 +303,9 @@ static int lm83_detect(struct i2c_adapter *adapter, int address, int kind) | |||
| 296 | 303 | ||
| 297 | if (kind == lm83) { | 304 | if (kind == lm83) { |
| 298 | name = "lm83"; | 305 | name = "lm83"; |
| 306 | } else | ||
| 307 | if (kind == lm82) { | ||
| 308 | name = "lm82"; | ||
| 299 | } | 309 | } |
| 300 | 310 | ||
| 301 | /* We can fill in the remaining client fields */ | 311 | /* We can fill in the remaining client fields */ |
| @@ -319,32 +329,46 @@ static int lm83_detect(struct i2c_adapter *adapter, int address, int kind) | |||
| 319 | goto exit_detach; | 329 | goto exit_detach; |
| 320 | } | 330 | } |
| 321 | 331 | ||
| 332 | /* | ||
| 333 | * The LM82 can only monitor one external diode which is | ||
| 334 | * at the same register as the LM83 temp3 entry - so we | ||
| 335 | * declare 1 and 3 common, and then 2 and 4 only for the LM83. | ||
| 336 | */ | ||
| 337 | |||
| 322 | device_create_file(&new_client->dev, | 338 | device_create_file(&new_client->dev, |
| 323 | &sensor_dev_attr_temp1_input.dev_attr); | 339 | &sensor_dev_attr_temp1_input.dev_attr); |
| 324 | device_create_file(&new_client->dev, | 340 | device_create_file(&new_client->dev, |
| 325 | &sensor_dev_attr_temp2_input.dev_attr); | ||
| 326 | device_create_file(&new_client->dev, | ||
| 327 | &sensor_dev_attr_temp3_input.dev_attr); | 341 | &sensor_dev_attr_temp3_input.dev_attr); |
| 328 | device_create_file(&new_client->dev, | 342 | |
| 329 | &sensor_dev_attr_temp4_input.dev_attr); | ||
| 330 | device_create_file(&new_client->dev, | 343 | device_create_file(&new_client->dev, |
| 331 | &sensor_dev_attr_temp1_max.dev_attr); | 344 | &sensor_dev_attr_temp1_max.dev_attr); |
| 332 | device_create_file(&new_client->dev, | 345 | device_create_file(&new_client->dev, |
| 333 | &sensor_dev_attr_temp2_max.dev_attr); | ||
| 334 | device_create_file(&new_client->dev, | ||
| 335 | &sensor_dev_attr_temp3_max.dev_attr); | 346 | &sensor_dev_attr_temp3_max.dev_attr); |
| 336 | device_create_file(&new_client->dev, | 347 | |
| 337 | &sensor_dev_attr_temp4_max.dev_attr); | ||
| 338 | device_create_file(&new_client->dev, | 348 | device_create_file(&new_client->dev, |
| 339 | &sensor_dev_attr_temp1_crit.dev_attr); | 349 | &sensor_dev_attr_temp1_crit.dev_attr); |
| 340 | device_create_file(&new_client->dev, | 350 | device_create_file(&new_client->dev, |
| 341 | &sensor_dev_attr_temp2_crit.dev_attr); | ||
| 342 | device_create_file(&new_client->dev, | ||
| 343 | &sensor_dev_attr_temp3_crit.dev_attr); | 351 | &sensor_dev_attr_temp3_crit.dev_attr); |
| 344 | device_create_file(&new_client->dev, | 352 | |
| 345 | &sensor_dev_attr_temp4_crit.dev_attr); | ||
| 346 | device_create_file(&new_client->dev, &dev_attr_alarms); | 353 | device_create_file(&new_client->dev, &dev_attr_alarms); |
| 347 | 354 | ||
| 355 | if (kind == lm83) { | ||
| 356 | device_create_file(&new_client->dev, | ||
| 357 | &sensor_dev_attr_temp2_input.dev_attr); | ||
| 358 | device_create_file(&new_client->dev, | ||
| 359 | &sensor_dev_attr_temp4_input.dev_attr); | ||
| 360 | |||
| 361 | device_create_file(&new_client->dev, | ||
| 362 | &sensor_dev_attr_temp2_max.dev_attr); | ||
| 363 | device_create_file(&new_client->dev, | ||
| 364 | &sensor_dev_attr_temp4_max.dev_attr); | ||
| 365 | |||
| 366 | device_create_file(&new_client->dev, | ||
| 367 | &sensor_dev_attr_temp2_crit.dev_attr); | ||
| 368 | device_create_file(&new_client->dev, | ||
| 369 | &sensor_dev_attr_temp4_crit.dev_attr); | ||
| 370 | } | ||
| 371 | |||
| 348 | return 0; | 372 | return 0; |
| 349 | 373 | ||
| 350 | exit_detach: | 374 | exit_detach: |
