diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/hwmon/lm93.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'drivers/hwmon/lm93.c')
-rw-r--r-- | drivers/hwmon/lm93.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/drivers/hwmon/lm93.c b/drivers/hwmon/lm93.c index 6669255aadcf..3b43df418613 100644 --- a/drivers/hwmon/lm93.c +++ b/drivers/hwmon/lm93.c | |||
@@ -20,7 +20,7 @@ | |||
20 | Adapted to 2.6.20 by Carsten Emde <cbe@osadl.org> | 20 | Adapted to 2.6.20 by Carsten Emde <cbe@osadl.org> |
21 | Copyright (c) 2006 Carsten Emde, Open Source Automation Development Lab | 21 | Copyright (c) 2006 Carsten Emde, Open Source Automation Development Lab |
22 | 22 | ||
23 | Modified for mainline integration by Hans J. Koch <hjk@linutronix.de> | 23 | Modified for mainline integration by Hans J. Koch <hjk@hansjkoch.de> |
24 | Copyright (c) 2007 Hans J. Koch, Linutronix GmbH | 24 | Copyright (c) 2007 Hans J. Koch, Linutronix GmbH |
25 | 25 | ||
26 | This program is free software; you can redistribute it and/or modify | 26 | This program is free software; you can redistribute it and/or modify |
@@ -135,6 +135,11 @@ | |||
135 | #define LM93_MFR_ID 0x73 | 135 | #define LM93_MFR_ID 0x73 |
136 | #define LM93_MFR_ID_PROTOTYPE 0x72 | 136 | #define LM93_MFR_ID_PROTOTYPE 0x72 |
137 | 137 | ||
138 | /* LM94 REGISTER VALUES */ | ||
139 | #define LM94_MFR_ID_2 0x7a | ||
140 | #define LM94_MFR_ID 0x79 | ||
141 | #define LM94_MFR_ID_PROTOTYPE 0x78 | ||
142 | |||
138 | /* SMBus capabilities */ | 143 | /* SMBus capabilities */ |
139 | #define LM93_SMBUS_FUNC_FULL (I2C_FUNC_SMBUS_BYTE_DATA | \ | 144 | #define LM93_SMBUS_FUNC_FULL (I2C_FUNC_SMBUS_BYTE_DATA | \ |
140 | I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BLOCK_DATA) | 145 | I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BLOCK_DATA) |
@@ -2504,6 +2509,7 @@ static int lm93_detect(struct i2c_client *client, struct i2c_board_info *info) | |||
2504 | { | 2509 | { |
2505 | struct i2c_adapter *adapter = client->adapter; | 2510 | struct i2c_adapter *adapter = client->adapter; |
2506 | int mfr, ver; | 2511 | int mfr, ver; |
2512 | const char *name; | ||
2507 | 2513 | ||
2508 | if (!i2c_check_functionality(adapter, LM93_SMBUS_FUNC_MIN)) | 2514 | if (!i2c_check_functionality(adapter, LM93_SMBUS_FUNC_MIN)) |
2509 | return -ENODEV; | 2515 | return -ENODEV; |
@@ -2517,13 +2523,23 @@ static int lm93_detect(struct i2c_client *client, struct i2c_board_info *info) | |||
2517 | } | 2523 | } |
2518 | 2524 | ||
2519 | ver = lm93_read_byte(client, LM93_REG_VER); | 2525 | ver = lm93_read_byte(client, LM93_REG_VER); |
2520 | if (ver != LM93_MFR_ID && ver != LM93_MFR_ID_PROTOTYPE) { | 2526 | switch (ver) { |
2527 | case LM93_MFR_ID: | ||
2528 | case LM93_MFR_ID_PROTOTYPE: | ||
2529 | name = "lm93"; | ||
2530 | break; | ||
2531 | case LM94_MFR_ID_2: | ||
2532 | case LM94_MFR_ID: | ||
2533 | case LM94_MFR_ID_PROTOTYPE: | ||
2534 | name = "lm94"; | ||
2535 | break; | ||
2536 | default: | ||
2521 | dev_dbg(&adapter->dev, | 2537 | dev_dbg(&adapter->dev, |
2522 | "detect failed, bad version id 0x%02x!\n", ver); | 2538 | "detect failed, bad version id 0x%02x!\n", ver); |
2523 | return -ENODEV; | 2539 | return -ENODEV; |
2524 | } | 2540 | } |
2525 | 2541 | ||
2526 | strlcpy(info->type, "lm93", I2C_NAME_SIZE); | 2542 | strlcpy(info->type, name, I2C_NAME_SIZE); |
2527 | dev_dbg(&adapter->dev,"loading %s at %d,0x%02x\n", | 2543 | dev_dbg(&adapter->dev,"loading %s at %d,0x%02x\n", |
2528 | client->name, i2c_adapter_id(client->adapter), | 2544 | client->name, i2c_adapter_id(client->adapter), |
2529 | client->addr); | 2545 | client->addr); |
@@ -2602,6 +2618,7 @@ static int lm93_remove(struct i2c_client *client) | |||
2602 | 2618 | ||
2603 | static const struct i2c_device_id lm93_id[] = { | 2619 | static const struct i2c_device_id lm93_id[] = { |
2604 | { "lm93", 0 }, | 2620 | { "lm93", 0 }, |
2621 | { "lm94", 0 }, | ||
2605 | { } | 2622 | { } |
2606 | }; | 2623 | }; |
2607 | MODULE_DEVICE_TABLE(i2c, lm93_id); | 2624 | MODULE_DEVICE_TABLE(i2c, lm93_id); |
@@ -2629,7 +2646,7 @@ static void __exit lm93_exit(void) | |||
2629 | } | 2646 | } |
2630 | 2647 | ||
2631 | MODULE_AUTHOR("Mark M. Hoffman <mhoffman@lightlink.com>, " | 2648 | MODULE_AUTHOR("Mark M. Hoffman <mhoffman@lightlink.com>, " |
2632 | "Hans J. Koch <hjk@linutronix.de"); | 2649 | "Hans J. Koch <hjk@hansjkoch.de>"); |
2633 | MODULE_DESCRIPTION("LM93 driver"); | 2650 | MODULE_DESCRIPTION("LM93 driver"); |
2634 | MODULE_LICENSE("GPL"); | 2651 | MODULE_LICENSE("GPL"); |
2635 | 2652 | ||