aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2015-08-07 12:06:37 -0400
committerGuenter Roeck <linux@roeck-us.net>2015-08-12 15:29:36 -0400
commit15398566f0ea95c66d202b8705dba4f59b9ba01c (patch)
tree94d15f6856498cde8a80e1b9795faa7934be3e56
parente8047a2686d32854e4b82bd5d328da61025fb01a (diff)
hwmon: (ltc2978) Add support for LTC3887
LTC3887 is an enhanced version of LTC3880 and supports the same commands. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r--Documentation/devicetree/bindings/hwmon/ltc2978.txt1
-rw-r--r--Documentation/hwmon/ltc297819
-rw-r--r--drivers/hwmon/pmbus/Kconfig3
-rw-r--r--drivers/hwmon/pmbus/ltc2978.c19
4 files changed, 29 insertions, 13 deletions
diff --git a/Documentation/devicetree/bindings/hwmon/ltc2978.txt b/Documentation/devicetree/bindings/hwmon/ltc2978.txt
index 230389f6c984..c1d23c14ddd9 100644
--- a/Documentation/devicetree/bindings/hwmon/ltc2978.txt
+++ b/Documentation/devicetree/bindings/hwmon/ltc2978.txt
@@ -8,6 +8,7 @@ Required properties:
8 * "lltc,ltc3880" 8 * "lltc,ltc3880"
9 * "lltc,ltc3882" 9 * "lltc,ltc3882"
10 * "lltc,ltc3883" 10 * "lltc,ltc3883"
11 * "lltc,ltc3887"
11 * "lltc,ltm4676" 12 * "lltc,ltm4676"
12- reg: I2C slave address 13- reg: I2C slave address
13 14
diff --git a/Documentation/hwmon/ltc2978 b/Documentation/hwmon/ltc2978
index 521ee8a1135c..ff130997f22e 100644
--- a/Documentation/hwmon/ltc2978
+++ b/Documentation/hwmon/ltc2978
@@ -27,6 +27,10 @@ Supported chips:
27 Prefix: 'ltc3883' 27 Prefix: 'ltc3883'
28 Addresses scanned: - 28 Addresses scanned: -
29 Datasheet: http://www.linear.com/product/ltc3883 29 Datasheet: http://www.linear.com/product/ltc3883
30 * Linear Technology LTC3887
31 Prefix: 'ltc3887'
32 Addresses scanned: -
33 Datasheet: http://www.linear.com/product/ltc3887
30 * Linear Technology LTM4676 34 * Linear Technology LTM4676
31 Prefix: 'ltm4676' 35 Prefix: 'ltm4676'
32 Addresses scanned: - 36 Addresses scanned: -
@@ -41,7 +45,8 @@ Description
41LTC2974 is a quad digital power supply managers. 45LTC2974 is a quad digital power supply managers.
42LTC2978 is an octal power supply monitor. 46LTC2978 is an octal power supply monitor.
43LTC2977 is a pin compatible replacement for LTC2978. 47LTC2977 is a pin compatible replacement for LTC2978.
44LTC3880 and LTC3882 are dual output poly-phase step-down DC/DC controllers. 48LTC3880, LTC3882, and LTC3887 are dual output poly-phase step-down DC/DC
49controllers.
45LTC3883 is a single phase step-down DC/DC controller. 50LTC3883 is a single phase step-down DC/DC controller.
46LTM4676 is a dual 13A or single 26A uModule regulator. 51LTM4676 is a dual 13A or single 26A uModule regulator.
47 52
@@ -85,7 +90,7 @@ in[N]_label "vout[1-8]".
85 LTC2974: N=2-5 90 LTC2974: N=2-5
86 LTC2977: N=2-9 91 LTC2977: N=2-9
87 LTC2978: N=2-9 92 LTC2978: N=2-9
88 LTC3880, LTC3882, LTM4676: N=2-3 93 LTC3880, LTC3882, LTC3887, LTM4676: N=2-3
89 LTC3883: N=2 94 LTC3883: N=2
90in[N]_input Measured output voltage. 95in[N]_input Measured output voltage.
91in[N]_min Minimum output voltage. 96in[N]_min Minimum output voltage.
@@ -105,8 +110,8 @@ temp[N]_input Measured temperature.
105 and temp5 reports the chip temperature. 110 and temp5 reports the chip temperature.
106 On LTC2977 and LTC2978, only one temperature measurement 111 On LTC2977 and LTC2978, only one temperature measurement
107 is supported and reports the chip temperature. 112 is supported and reports the chip temperature.
108 On LTC3880, LTC3882, and LTM4676, temp1 and temp2 113 On LTC3880, LTC3882, LTC3887, and LTM4676, temp1 and
109 report external temperatures, and temp3 reports 114 temp2 report external temperatures, and temp3 reports
110 the chip temperature. 115 the chip temperature.
111 On LTC3883, temp1 reports an external temperature, 116 On LTC3883, temp1 reports an external temperature,
112 and temp2 reports the chip temperature. 117 and temp2 reports the chip temperature.
@@ -134,11 +139,11 @@ power[N]_label "pout[1-4]".
134 LTC2974: N=1-4 139 LTC2974: N=1-4
135 LTC2977: Not supported 140 LTC2977: Not supported
136 LTC2978: Not supported 141 LTC2978: Not supported
137 LTC3880, LTC3882, LTM4676: N=1-2 142 LTC3880, LTC3882, LTC3887, LTM4676: N=1-2
138 LTC3883: N=2 143 LTC3883: N=2
139power[N]_input Measured output power. 144power[N]_input Measured output power.
140 145
141curr1_label "iin". LTC3880, LTC3883, and LTM4676 only. 146curr1_label "iin". LTC3880, LTC3883, LTC3887, and LTM4676 only.
142curr1_input Measured input current. 147curr1_input Measured input current.
143curr1_max Maximum input current. 148curr1_max Maximum input current.
144curr1_max_alarm Input current high alarm. 149curr1_max_alarm Input current high alarm.
@@ -149,7 +154,7 @@ curr[N]_label "iout[1-4]".
149 LTC2974: N=1-4 154 LTC2974: N=1-4
150 LTC2977: not supported 155 LTC2977: not supported
151 LTC2978: not supported 156 LTC2978: not supported
152 LTC3880, LTC3882, LTM4676: N=2-3 157 LTC3880, LTC3882, LTC3887, LTM4676: N=2-3
153 LTC3883: N=2 158 LTC3883: N=2
154curr[N]_input Measured output current. 159curr[N]_input Measured output current.
155curr[N]_max Maximum output current. 160curr[N]_max Maximum output current.
diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
index 2b3242cc7779..43b6de900ce5 100644
--- a/drivers/hwmon/pmbus/Kconfig
+++ b/drivers/hwmon/pmbus/Kconfig
@@ -52,7 +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, LTC2977, LTC2978, LTC3880, LTC3883, and LTM4676. 55 Technology LTC2974, LTC2977, LTC2978, LTC3880, LTC3883, LTC3887,
56 and LTM4676.
56 57
57 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
58 be called ltc2978. 59 be called ltc2978.
diff --git a/drivers/hwmon/pmbus/ltc2978.c b/drivers/hwmon/pmbus/ltc2978.c
index acbfe3ec2ffd..0756d8ae9dad 100644
--- a/drivers/hwmon/pmbus/ltc2978.c
+++ b/drivers/hwmon/pmbus/ltc2978.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Hardware monitoring driver for LTC2974, LTC2977, LTC2978, LTC3880, 2 * Hardware monitoring driver for LTC2974, LTC2977, LTC2978, LTC3880,
3 * LTC3883, and LTM4676 3 * LTC3883, LTC3887. and LTM4676
4 * 4 *
5 * Copyright (c) 2011 Ericsson AB. 5 * Copyright (c) 2011 Ericsson AB.
6 * Copyright (c) 2013, 2014 Guenter Roeck 6 * Copyright (c) 2013, 2014 Guenter Roeck
@@ -25,7 +25,8 @@
25#include <linux/regulator/driver.h> 25#include <linux/regulator/driver.h>
26#include "pmbus.h" 26#include "pmbus.h"
27 27
28enum chips { ltc2974, ltc2977, ltc2978, ltc3880, ltc3882, ltc3883, ltm4676 }; 28enum chips { ltc2974, ltc2977, ltc2978, ltc3880, ltc3882, ltc3883, ltc3887,
29 ltm4676 };
29 30
30/* Common for all chips */ 31/* Common for all chips */
31#define LTC2978_MFR_VOUT_PEAK 0xdd 32#define LTC2978_MFR_VOUT_PEAK 0xdd
@@ -42,7 +43,7 @@ enum chips { ltc2974, ltc2977, ltc2978, ltc3880, ltc3882, ltc3883, ltm4676 };
42#define LTC2974_MFR_IOUT_PEAK 0xd7 43#define LTC2974_MFR_IOUT_PEAK 0xd7
43#define LTC2974_MFR_IOUT_MIN 0xd8 44#define LTC2974_MFR_IOUT_MIN 0xd8
44 45
45/* LTC3880, LTC3882, LTC3883, and LTM4676 */ 46/* LTC3880, LTC3882, LTC3883, LTC3887, and LTM4676 */
46#define LTC3880_MFR_IOUT_PEAK 0xd7 47#define LTC3880_MFR_IOUT_PEAK 0xd7
47#define LTC3880_MFR_CLEAR_PEAKS 0xe3 48#define LTC3880_MFR_CLEAR_PEAKS 0xe3
48#define LTC3880_MFR_TEMPERATURE2_PEAK 0xf4 49#define LTC3880_MFR_TEMPERATURE2_PEAK 0xf4
@@ -60,9 +61,11 @@ enum chips { ltc2974, ltc2977, ltc2978, ltc3880, ltc3882, ltc3883, ltm4676 };
60#define LTC3880_ID_MASK 0xff00 61#define LTC3880_ID_MASK 0xff00
61#define LTC3883_ID 0x4300 62#define LTC3883_ID 0x4300
62#define LTC3883_ID_MASK 0xff00 63#define LTC3883_ID_MASK 0xff00
64#define LTC3887_ID 0x4700
65#define LTC3887_ID_MASK 0xff00
63#define LTM4676_ID 0x4400 66#define LTM4676_ID 0x4400
64#define LTM4676_ID_2 0x4480 67#define LTM4676_ID_2 0x4480
65#define LTM4676A_ID 0x47E0 68#define LTM4676A_ID 0x47e0
66#define LTM4676_ID_MASK 0xfff0 69#define LTM4676_ID_MASK 0xfff0
67 70
68#define LTC2974_NUM_PAGES 4 71#define LTC2974_NUM_PAGES 4
@@ -315,7 +318,8 @@ static int ltc2978_clear_peaks(struct i2c_client *client, int page,
315{ 318{
316 int ret; 319 int ret;
317 320
318 if (id == ltc3880 || id == ltc3882 || id == ltc3883 || id == ltm4676) 321 if (id == ltc3880 || id == ltc3882 || id == ltc3883 || id == ltc3887 ||
322 id == ltm4676)
319 ret = pmbus_write_byte(client, 0, LTC3880_MFR_CLEAR_PEAKS); 323 ret = pmbus_write_byte(client, 0, LTC3880_MFR_CLEAR_PEAKS);
320 else 324 else
321 ret = pmbus_write_byte(client, page, PMBUS_CLEAR_FAULTS); 325 ret = pmbus_write_byte(client, page, PMBUS_CLEAR_FAULTS);
@@ -373,6 +377,7 @@ static const struct i2c_device_id ltc2978_id[] = {
373 {"ltc3880", ltc3880}, 377 {"ltc3880", ltc3880},
374 {"ltc3882", ltc3882}, 378 {"ltc3882", ltc3882},
375 {"ltc3883", ltc3883}, 379 {"ltc3883", ltc3883},
380 {"ltc3887", ltc3887},
376 {"ltm4676", ltm4676}, 381 {"ltm4676", ltm4676},
377 {} 382 {}
378}; 383};
@@ -432,6 +437,8 @@ static int ltc2978_get_id(struct i2c_client *client)
432 return ltc3880; 437 return ltc3880;
433 else if ((chip_id & LTC3883_ID_MASK) == LTC3883_ID) 438 else if ((chip_id & LTC3883_ID_MASK) == LTC3883_ID)
434 return ltc3883; 439 return ltc3883;
440 else if ((chip_id & LTC3887_ID_MASK) == LTC3887_ID)
441 return ltc3887;
435 else if ((chip_id & LTM4676_ID_MASK) == LTM4676_ID || 442 else if ((chip_id & LTM4676_ID_MASK) == LTM4676_ID ||
436 (chip_id & LTM4676_ID_MASK) == LTM4676_ID_2 || 443 (chip_id & LTM4676_ID_MASK) == LTM4676_ID_2 ||
437 (chip_id & LTM4676_ID_MASK) == LTM4676A_ID) 444 (chip_id & LTM4676_ID_MASK) == LTM4676A_ID)
@@ -511,6 +518,7 @@ static int ltc2978_probe(struct i2c_client *client,
511 } 518 }
512 break; 519 break;
513 case ltc3880: 520 case ltc3880:
521 case ltc3887:
514 case ltm4676: 522 case ltm4676:
515 info->read_word_data = ltc3880_read_word_data; 523 info->read_word_data = ltc3880_read_word_data;
516 info->pages = LTC3880_NUM_PAGES; 524 info->pages = LTC3880_NUM_PAGES;
@@ -573,6 +581,7 @@ static const struct of_device_id ltc2978_of_match[] = {
573 { .compatible = "lltc,ltc3880" }, 581 { .compatible = "lltc,ltc3880" },
574 { .compatible = "lltc,ltc3882" }, 582 { .compatible = "lltc,ltc3882" },
575 { .compatible = "lltc,ltc3883" }, 583 { .compatible = "lltc,ltc3883" },
584 { .compatible = "lltc,ltc3887" },
576 { .compatible = "lltc,ltm4676" }, 585 { .compatible = "lltc,ltm4676" },
577 { } 586 { }
578}; 587};