diff options
-rw-r--r-- | Documentation/hwmon/lm63 | 7 | ||||
-rw-r--r-- | drivers/hwmon/Kconfig | 11 | ||||
-rw-r--r-- | drivers/hwmon/lm63.c | 16 |
3 files changed, 25 insertions, 9 deletions
diff --git a/Documentation/hwmon/lm63 b/Documentation/hwmon/lm63 index 31660bf97979..b9843eab1afb 100644 --- a/Documentation/hwmon/lm63 +++ b/Documentation/hwmon/lm63 | |||
@@ -7,6 +7,11 @@ Supported chips: | |||
7 | Addresses scanned: I2C 0x4c | 7 | Addresses scanned: I2C 0x4c |
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/LM63.html | 9 | http://www.national.com/pf/LM/LM63.html |
10 | * National Semiconductor LM64 | ||
11 | Prefix: 'lm64' | ||
12 | Addresses scanned: I2C 0x18 and 0x4e | ||
13 | Datasheet: Publicly available at the National Semiconductor website | ||
14 | http://www.national.com/pf/LM/LM64.html | ||
10 | 15 | ||
11 | Author: Jean Delvare <khali@linux-fr.org> | 16 | Author: Jean Delvare <khali@linux-fr.org> |
12 | 17 | ||
@@ -55,3 +60,5 @@ The lm63 driver will not update its values more frequently than every | |||
55 | second; reading them more often will do no harm, but will return 'old' | 60 | second; reading them more often will do no harm, but will return 'old' |
56 | values. | 61 | values. |
57 | 62 | ||
63 | The LM64 is effectively an LM63 with GPIO lines. The driver does not | ||
64 | support these GPIO lines at present. | ||
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index 6a9ac754ca5d..fa609586c7c9 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig | |||
@@ -447,13 +447,14 @@ config SENSORS_IT87 | |||
447 | will be called it87. | 447 | will be called it87. |
448 | 448 | ||
449 | config SENSORS_LM63 | 449 | config SENSORS_LM63 |
450 | tristate "National Semiconductor LM63" | 450 | tristate "National Semiconductor LM63 and LM64" |
451 | depends on I2C | 451 | depends on I2C |
452 | help | 452 | help |
453 | If you say yes here you get support for the National Semiconductor | 453 | If you say yes here you get support for the National |
454 | LM63 remote diode digital temperature sensor with integrated fan | 454 | Semiconductor LM63 and LM64 remote diode digital temperature |
455 | control. Such chips are found on the Tyan S4882 (Thunder K8QS Pro) | 455 | sensors with integrated fan control. Such chips are found |
456 | motherboard, among others. | 456 | on the Tyan S4882 (Thunder K8QS Pro) motherboard, among |
457 | others. | ||
457 | 458 | ||
458 | This driver can also be built as a module. If so, the module | 459 | This driver can also be built as a module. If so, the module |
459 | will be called lm63. | 460 | will be called lm63. |
diff --git a/drivers/hwmon/lm63.c b/drivers/hwmon/lm63.c index bf81aff7051d..776aeb3019d2 100644 --- a/drivers/hwmon/lm63.c +++ b/drivers/hwmon/lm63.c | |||
@@ -53,7 +53,7 @@ | |||
53 | * Address is fully defined internally and cannot be changed. | 53 | * Address is fully defined internally and cannot be changed. |
54 | */ | 54 | */ |
55 | 55 | ||
56 | static const unsigned short normal_i2c[] = { 0x4c, I2C_CLIENT_END }; | 56 | static const unsigned short normal_i2c[] = { 0x18, 0x4c, 0x4e, I2C_CLIENT_END }; |
57 | 57 | ||
58 | /* | 58 | /* |
59 | * The LM63 registers | 59 | * The LM63 registers |
@@ -131,12 +131,15 @@ static struct lm63_data *lm63_update_device(struct device *dev); | |||
131 | static int lm63_detect(struct i2c_client *client, struct i2c_board_info *info); | 131 | static int lm63_detect(struct i2c_client *client, struct i2c_board_info *info); |
132 | static void lm63_init_client(struct i2c_client *client); | 132 | static void lm63_init_client(struct i2c_client *client); |
133 | 133 | ||
134 | enum chips { lm63, lm64 }; | ||
135 | |||
134 | /* | 136 | /* |
135 | * Driver data (common to all clients) | 137 | * Driver data (common to all clients) |
136 | */ | 138 | */ |
137 | 139 | ||
138 | static const struct i2c_device_id lm63_id[] = { | 140 | static const struct i2c_device_id lm63_id[] = { |
139 | { "lm63", 0 }, | 141 | { "lm63", lm63 }, |
142 | { "lm64", lm64 }, | ||
140 | { } | 143 | { } |
141 | }; | 144 | }; |
142 | MODULE_DEVICE_TABLE(i2c, lm63_id); | 145 | MODULE_DEVICE_TABLE(i2c, lm63_id); |
@@ -422,6 +425,7 @@ static int lm63_detect(struct i2c_client *new_client, | |||
422 | struct i2c_adapter *adapter = new_client->adapter; | 425 | struct i2c_adapter *adapter = new_client->adapter; |
423 | u8 man_id, chip_id, reg_config1, reg_config2; | 426 | u8 man_id, chip_id, reg_config1, reg_config2; |
424 | u8 reg_alert_status, reg_alert_mask; | 427 | u8 reg_alert_status, reg_alert_mask; |
428 | int address = new_client->addr; | ||
425 | 429 | ||
426 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 430 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
427 | return -ENODEV; | 431 | return -ENODEV; |
@@ -439,7 +443,6 @@ static int lm63_detect(struct i2c_client *new_client, | |||
439 | LM63_REG_ALERT_MASK); | 443 | LM63_REG_ALERT_MASK); |
440 | 444 | ||
441 | if (man_id != 0x01 /* National Semiconductor */ | 445 | if (man_id != 0x01 /* National Semiconductor */ |
442 | || chip_id != 0x41 /* LM63 */ | ||
443 | || (reg_config1 & 0x18) != 0x00 | 446 | || (reg_config1 & 0x18) != 0x00 |
444 | || (reg_config2 & 0xF8) != 0x00 | 447 | || (reg_config2 & 0xF8) != 0x00 |
445 | || (reg_alert_status & 0x20) != 0x00 | 448 | || (reg_alert_status & 0x20) != 0x00 |
@@ -450,7 +453,12 @@ static int lm63_detect(struct i2c_client *new_client, | |||
450 | return -ENODEV; | 453 | return -ENODEV; |
451 | } | 454 | } |
452 | 455 | ||
453 | strlcpy(info->type, "lm63", I2C_NAME_SIZE); | 456 | if (chip_id == 0x41 && address == 0x4c) |
457 | strlcpy(info->type, "lm63", I2C_NAME_SIZE); | ||
458 | else if (chip_id == 0x51 && (address == 0x18 || address == 0x4e)) | ||
459 | strlcpy(info->type, "lm64", I2C_NAME_SIZE); | ||
460 | else | ||
461 | return -ENODEV; | ||
454 | 462 | ||
455 | return 0; | 463 | return 0; |
456 | } | 464 | } |