Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (pmbus/ltc2978) Add support for LTM4676

The chip's programming interface is quite similar to LTC3880
and supports the same set of sensors.

Reviewed-by: Robert Coulson <rob.coulson@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

+22 -15
+11 -6
Documentation/hwmon/ltc2978
··· 23 23 Prefix: 'ltc3883' 24 24 Addresses scanned: - 25 25 Datasheet: http://www.linear.com/product/ltc3883 26 + * Linear Technology LTM4676 27 + Prefix: 'ltm4676' 28 + Addresses scanned: - 29 + Datasheet: http://www.linear.com/product/ltm4676 26 30 27 31 Author: Guenter Roeck <linux@roeck-us.net> 28 32 ··· 37 33 LTC2974 is a quad digital power supply manager. LTC2978 is an octal power supply 38 34 monitor. LTC2977 is a pin compatible replacement for LTC2978. LTC3880 is a dual 39 35 output poly-phase step-down DC/DC controller. LTC3883 is a single phase 40 - step-down DC/DC controller. 36 + step-down DC/DC controller. LTM4676 is a dual 13A or single 26A uModule 37 + regulator. 41 38 42 39 43 40 Usage Notes ··· 80 75 LTC2974: N=2-5 81 76 LTC2977: N=2-9 82 77 LTC2978: N=2-9 83 - LTC3880: N=2-3 78 + LTC3880, LTM4676: N=2-3 84 79 LTC3883: N=2 85 80 in[N]_input Measured output voltage. 86 81 in[N]_min Minimum output voltage. ··· 100 95 and temp5 reports the chip temperature. 101 96 On LTC2977 and LTC2978, only one temperature measurement 102 97 is supported and reports the chip temperature. 103 - On LTC3880, temp1 and temp2 report external 98 + On LTC3880 and LTM4676, temp1 and temp2 report external 104 99 temperatures, and temp3 reports the chip temperature. 105 100 On LTC3883, temp1 reports an external temperature, 106 101 and temp2 reports the chip temperature. ··· 128 123 LTC2974: N=1-4 129 124 LTC2977: Not supported 130 125 LTC2978: Not supported 131 - LTC3880: N=1-2 126 + LTC3880, LTM4676: N=1-2 132 127 LTC3883: N=2 133 128 power[N]_input Measured output power. 134 129 135 - curr1_label "iin". LTC3880 and LTC3883 only. 130 + curr1_label "iin". LTC3880, LTC3883, and LTM4676 only. 136 131 curr1_input Measured input current. 137 132 curr1_max Maximum input current. 138 133 curr1_max_alarm Input current high alarm. ··· 143 138 LTC2974: N=1-4 144 139 LTC2977: not supported 145 140 LTC2978: not supported 146 - LTC3880: N=2-3 141 + LTC3880, LTM4676: N=2-3 147 142 LTC3883: N=2 148 143 curr[N]_input Measured output current. 149 144 curr[N]_max Maximum output current.
+11 -9
drivers/hwmon/pmbus/ltc2978.c
··· 1 1 /* 2 2 * Hardware monitoring driver for LTC2974, LTC2977, LTC2978, LTC3880, 3 - * and LTC3883 3 + * LTC3883, and LTM4676 4 4 * 5 5 * Copyright (c) 2011 Ericsson AB. 6 - * Copyright (c) 2013 Guenter Roeck 6 + * Copyright (c) 2013, 2014 Guenter Roeck 7 7 * 8 8 * This program is free software; you can redistribute it and/or modify 9 9 * it under the terms of the GNU General Public License as published by ··· 14 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 16 * GNU General Public License for more details. 17 - * 18 - * You should have received a copy of the GNU General Public License 19 - * along with this program; if not, write to the Free Software 20 - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 17 */ 22 18 23 19 #include <linux/kernel.h> ··· 24 28 #include <linux/i2c.h> 25 29 #include "pmbus.h" 26 30 27 - enum chips { ltc2974, ltc2977, ltc2978, ltc3880, ltc3883 }; 31 + enum chips { ltc2974, ltc2977, ltc2978, ltc3880, ltc3883, ltm4676 }; 28 32 29 33 /* Common for all chips */ 30 34 #define LTC2978_MFR_VOUT_PEAK 0xdd ··· 41 45 #define LTC2974_MFR_IOUT_PEAK 0xd7 42 46 #define LTC2974_MFR_IOUT_MIN 0xd8 43 47 44 - /* LTC3880 and LTC3883 */ 48 + /* LTC3880, LTC3883, and LTM4676 */ 45 49 #define LTC3880_MFR_IOUT_PEAK 0xd7 46 50 #define LTC3880_MFR_CLEAR_PEAKS 0xe3 47 51 #define LTC3880_MFR_TEMPERATURE2_PEAK 0xf4 ··· 59 63 #define LTC3880_ID_MASK 0xff00 60 64 #define LTC3883_ID 0x4300 61 65 #define LTC3883_ID_MASK 0xff00 66 + #define LTM4676_ID 0x4480 /* datasheet claims 0x440X */ 67 + #define LTM4676_ID_MASK 0xfff0 62 68 63 69 #define LTC2974_NUM_PAGES 4 64 70 #define LTC2978_NUM_PAGES 8 ··· 369 371 {"ltc2978", ltc2978}, 370 372 {"ltc3880", ltc3880}, 371 373 {"ltc3883", ltc3883}, 374 + {"ltm4676", ltm4676}, 372 375 {} 373 376 }; 374 377 MODULE_DEVICE_TABLE(i2c, ltc2978_id); ··· 405 406 data->id = ltc3880; 406 407 } else if ((chip_id & LTC3883_ID_MASK) == LTC3883_ID) { 407 408 data->id = ltc3883; 409 + } else if ((chip_id & LTM4676_ID_MASK) == LTM4676_ID) { 410 + data->id = ltm4676; 408 411 } else { 409 412 dev_err(&client->dev, "Unsupported chip ID 0x%x\n", chip_id); 410 413 return -ENODEV; ··· 460 459 } 461 460 break; 462 461 case ltc3880: 462 + case ltm4676: 463 463 info->read_word_data = ltc3880_read_word_data; 464 464 info->pages = LTC3880_NUM_PAGES; 465 465 info->func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN ··· 503 501 module_i2c_driver(ltc2978_driver); 504 502 505 503 MODULE_AUTHOR("Guenter Roeck"); 506 - MODULE_DESCRIPTION("PMBus driver for LTC2974, LTC2978, LTC3880, and LTC3883"); 504 + MODULE_DESCRIPTION("PMBus driver for LTC2974, LTC2978, LTC3880, LTC3883, and LTM4676"); 507 505 MODULE_LICENSE("GPL");