summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/pmbus
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2015-08-17 09:38:01 -0400
committerGuenter Roeck <linux@roeck-us.net>2015-08-17 19:35:59 -0400
commit52aae6af71e0e78e25c64e13266917bb323984d5 (patch)
treeb70c2d44f6e107da40f58b1f2352658ad9261079 /drivers/hwmon/pmbus
parentacb092cdf9a285fd4706bc6ffd5f99840d53bba5 (diff)
hwmon: (ltc2978) Add support for LTC2980 and LTM2987
LTC2980 and LTM2987 are command compatible to LTC2977. They consist of two LTC2977 on a single die, and are instantiated as two separate chips, each supporting eight channels. Suggested-by: Michael Jones <mike@proclivis.com> Tested-by: Michael Jones <mike@proclivis.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/pmbus')
-rw-r--r--drivers/hwmon/pmbus/Kconfig4
-rw-r--r--drivers/hwmon/pmbus/ltc2978.c20
2 files changed, 19 insertions, 5 deletions
diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
index 8279727987cb..af778aed4033 100644
--- a/drivers/hwmon/pmbus/Kconfig
+++ b/drivers/hwmon/pmbus/Kconfig
@@ -52,8 +52,8 @@ config SENSORS_LTC2978
52 default n 52 default n
53 help 53 help
54 If you say yes here you get hardware monitoring support for Linear 54 If you say yes here you get hardware monitoring support for Linear
55 Technology LTC2974, LTC2975, LTC2977, LTC2978, LTC3880, LTC3883, 55 Technology LTC2974, LTC2975, LTC2977, LTC2978, LTC2980, LTC3880,
56 LTC3887, and LTM4676. 56 LTC3883, LTC3887, LTCM2987, and LTM4676.
57 57
58 This driver can also be built as a module. If so, the module will 58 This driver can also be built as a module. If so, the module will
59 be called ltc2978. 59 be called ltc2978.
diff --git a/drivers/hwmon/pmbus/ltc2978.c b/drivers/hwmon/pmbus/ltc2978.c
index e9d3f828fe46..48dcde0bc740 100644
--- a/drivers/hwmon/pmbus/ltc2978.c
+++ b/drivers/hwmon/pmbus/ltc2978.c
@@ -24,8 +24,8 @@
24#include <linux/regulator/driver.h> 24#include <linux/regulator/driver.h>
25#include "pmbus.h" 25#include "pmbus.h"
26 26
27enum chips { ltc2974, ltc2975, ltc2977, ltc2978, ltc3880, ltc3882, ltc3883, 27enum chips { ltc2974, ltc2975, ltc2977, ltc2978, ltc2980, ltc3880, ltc3882,
28 ltc3887, ltm4676 }; 28 ltc3883, ltc3887, ltm2987, ltm4676 };
29 29
30/* Common for all chips */ 30/* Common for all chips */
31#define LTC2978_MFR_VOUT_PEAK 0xdd 31#define LTC2978_MFR_VOUT_PEAK 0xdd
@@ -33,7 +33,7 @@ enum chips { ltc2974, ltc2975, ltc2977, ltc2978, ltc3880, ltc3882, ltc3883,
33#define LTC2978_MFR_TEMPERATURE_PEAK 0xdf 33#define LTC2978_MFR_TEMPERATURE_PEAK 0xdf
34#define LTC2978_MFR_SPECIAL_ID 0xe7 /* Undocumented on LTC3882 */ 34#define LTC2978_MFR_SPECIAL_ID 0xe7 /* Undocumented on LTC3882 */
35 35
36/* LTC2974, LTC2975, LCT2977, and LTC2978 */ 36/* LTC2974, LTC2975, LCT2977, LTC2980, LTC2978, and LTM2987 */
37#define LTC2978_MFR_VOUT_MIN 0xfb 37#define LTC2978_MFR_VOUT_MIN 0xfb
38#define LTC2978_MFR_VIN_MIN 0xfc 38#define LTC2978_MFR_VIN_MIN 0xfc
39#define LTC2978_MFR_TEMPERATURE_MIN 0xfd 39#define LTC2978_MFR_TEMPERATURE_MIN 0xfd
@@ -63,11 +63,15 @@ enum chips { ltc2974, ltc2975, ltc2977, ltc2978, ltc3880, ltc3882, ltc3883,
63#define LTC2977_ID 0x0130 63#define LTC2977_ID 0x0130
64#define LTC2978_ID_REV1 0x0110 /* Early revision */ 64#define LTC2978_ID_REV1 0x0110 /* Early revision */
65#define LTC2978_ID_REV2 0x0120 65#define LTC2978_ID_REV2 0x0120
66#define LTC2980_ID_A 0x8030 /* A/B for two die IDs */
67#define LTC2980_ID_B 0x8040
66#define LTC3880_ID 0x4020 68#define LTC3880_ID 0x4020
67#define LTC3882_ID 0x4200 69#define LTC3882_ID 0x4200
68#define LTC3882_ID_D1 0x4240 /* Dash 1 */ 70#define LTC3882_ID_D1 0x4240 /* Dash 1 */
69#define LTC3883_ID 0x4300 71#define LTC3883_ID 0x4300
70#define LTC3887_ID 0x4700 72#define LTC3887_ID 0x4700
73#define LTM2987_ID_A 0x8010 /* A/B for two die IDs */
74#define LTM2987_ID_B 0x8020
71#define LTM4676_ID_REV1 0x4400 75#define LTM4676_ID_REV1 0x4400
72#define LTM4676_ID_REV2 0x4480 76#define LTM4676_ID_REV2 0x4480
73#define LTM4676A_ID 0x47e0 77#define LTM4676A_ID 0x47e0
@@ -409,10 +413,12 @@ static const struct i2c_device_id ltc2978_id[] = {
409 {"ltc2975", ltc2975}, 413 {"ltc2975", ltc2975},
410 {"ltc2977", ltc2977}, 414 {"ltc2977", ltc2977},
411 {"ltc2978", ltc2978}, 415 {"ltc2978", ltc2978},
416 {"ltc2980", ltc2980},
412 {"ltc3880", ltc3880}, 417 {"ltc3880", ltc3880},
413 {"ltc3882", ltc3882}, 418 {"ltc3882", ltc3882},
414 {"ltc3883", ltc3883}, 419 {"ltc3883", ltc3883},
415 {"ltc3887", ltc3887}, 420 {"ltc3887", ltc3887},
421 {"ltm2987", ltm2987},
416 {"ltm4676", ltm4676}, 422 {"ltm4676", ltm4676},
417 {} 423 {}
418}; 424};
@@ -471,6 +477,8 @@ static int ltc2978_get_id(struct i2c_client *client)
471 return ltc2977; 477 return ltc2977;
472 else if (chip_id == LTC2978_ID_REV1 || chip_id == LTC2978_ID_REV2) 478 else if (chip_id == LTC2978_ID_REV1 || chip_id == LTC2978_ID_REV2)
473 return ltc2978; 479 return ltc2978;
480 else if (chip_id == LTC2980_ID_A || chip_id == LTC2980_ID_B)
481 return ltc2980;
474 else if (chip_id == LTC3880_ID) 482 else if (chip_id == LTC3880_ID)
475 return ltc3880; 483 return ltc3880;
476 else if (chip_id == LTC3882_ID || chip_id == LTC3882_ID_D1) 484 else if (chip_id == LTC3882_ID || chip_id == LTC3882_ID_D1)
@@ -479,6 +487,8 @@ static int ltc2978_get_id(struct i2c_client *client)
479 return ltc3883; 487 return ltc3883;
480 else if (chip_id == LTC3887_ID) 488 else if (chip_id == LTC3887_ID)
481 return ltc3887; 489 return ltc3887;
490 else if (chip_id == LTM2987_ID_A || chip_id == LTM2987_ID_B)
491 return ltm2987;
482 else if (chip_id == LTM4676_ID_REV1 || chip_id == LTM4676_ID_REV2 || 492 else if (chip_id == LTM4676_ID_REV1 || chip_id == LTM4676_ID_REV2 ||
483 chip_id == LTM4676A_ID) 493 chip_id == LTM4676A_ID)
484 return ltm4676; 494 return ltm4676;
@@ -559,6 +569,8 @@ static int ltc2978_probe(struct i2c_client *client,
559 break; 569 break;
560 case ltc2977: 570 case ltc2977:
561 case ltc2978: 571 case ltc2978:
572 case ltc2980:
573 case ltm2987:
562 info->read_word_data = ltc2978_read_word_data; 574 info->read_word_data = ltc2978_read_word_data;
563 info->pages = LTC2978_NUM_PAGES; 575 info->pages = LTC2978_NUM_PAGES;
564 info->func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT 576 info->func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT
@@ -634,10 +646,12 @@ static const struct of_device_id ltc2978_of_match[] = {
634 { .compatible = "lltc,ltc2975" }, 646 { .compatible = "lltc,ltc2975" },
635 { .compatible = "lltc,ltc2977" }, 647 { .compatible = "lltc,ltc2977" },
636 { .compatible = "lltc,ltc2978" }, 648 { .compatible = "lltc,ltc2978" },
649 { .compatible = "lltc,ltc2980" },
637 { .compatible = "lltc,ltc3880" }, 650 { .compatible = "lltc,ltc3880" },
638 { .compatible = "lltc,ltc3882" }, 651 { .compatible = "lltc,ltc3882" },
639 { .compatible = "lltc,ltc3883" }, 652 { .compatible = "lltc,ltc3883" },
640 { .compatible = "lltc,ltc3887" }, 653 { .compatible = "lltc,ltc3887" },
654 { .compatible = "lltc,ltm2987" },
641 { .compatible = "lltc,ltm4676" }, 655 { .compatible = "lltc,ltm4676" },
642 { } 656 { }
643}; 657};