summaryrefslogtreecommitdiff
path: root/drivers/hwmon/pmbus/ltc2978.c
AgeCommit message (Collapse)Author
2015-08-19hwmon: (ltc2978) Add support for LTM4675Guenter Roeck
LTM2975 is a dual 9A or single 18A μModule regulator. It is register compatible with LTM4676. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-08-19hwmon: (ltc2978) Add polling for chips requiring itMichael Jones
Some of the LTC chips supported by this driver have to be polled to ensure that they are ready to accept commands. Signed-off-by: Michael Jones <mike@proclivis.com> [Guenter Roeck: simplifications and formatting changes] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-08-17hwmon: (ltc2978) Add support for LTC3886Guenter Roeck
LTC3886 is a is a dual PolyPhase DC/DC synchronous step-down switching regulator controller. It is mostly command compatible to LTC3883, but supports two phases instead of one. Suggested-by: Michael Jones <mike@proclivis.com> Tested-by: Michael Jones <mike@proclivis.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-08-17hwmon: (ltc2978) Add support for LTC2980 and LTM2987Guenter Roeck
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>
2015-08-17hwmon: (ltc2978) Add missing chip IDs for LTC2978 and LTC3882Guenter Roeck
Add additional chip ID for an older revision of LTC2978, as well as two chip IDs for LTC3882. Turns out the LTC3882 does support the LTC2978_MFR_SPECIAL_ID register, and reading it returns its chip ID, but the register is undocumented. Suggested-by: Michael Jones <mike@proclivis.com> Tested-by: Michael Jones <mike@proclivis.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-08-17hwmon: (ltc2978) Use correct ID mask to detect all chipsGuenter Roeck
Per information from Linear Technologies, the ID mask is 12 bit for all chips of this series. Use this mask to detect chips to ensure that all chip revisions are detected. Suggested-by: Michael Jones <mike@proclivis.com> Tested-by: Michael Jones <mike@proclivis.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-08-17hwmon: (ltc2978) Introduce helper functions for min and max valuesGuenter Roeck
The code used to determine historic low and high peaks is repeated several times. Introduce helper functions to simplify it. Tested-by: Michael Jones <mike@proclivis.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-08-17hwmon: (ltc2978) Introduce feature flagsGuenter Roeck
It is becoming cumbersom to track per-chip feature support. Introduce feature flag to simplify the code. Tested-by: Michael Jones <mike@proclivis.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-08-17hwmon: (ltc2978) Add support for LTC2975Guenter Roeck
LTC2975 is mostly compatible to LTC2974, but supports input current and power measurement. Tested-by: Michael Jones <mike@proclivis.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-08-12hwmon: (ltc2978) Add support for LTC3887Guenter Roeck
LTC3887 is an enhanced version of LTC3880 and supports the same commands. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-08-12hwmon: (ltc2978) Add additional chip IDs for LTM4676 and LTM4676AGuenter Roeck
Per datasheet, the chip ID for LTM4676 is 0x448x. This was observed in real systems. In addition to that, chip ID 0x4401 was observed as well. Research shows that the chip ID has been changed from 0x440x to 0x448x in datasheet revision C. Add support for the additional chip ID. Also add the chip ID for LTM4676A, which is functionally identical to LTM4676. Reported-by: Ananda Babu Nettam <anandab@juniper.net> Cc: Ananda Babu Nettam <anandab@juniper.net> Cc: Amit U Jain <amjain@juniper.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-08-12hwmon: (ltc2978) Add support for LTC3882Guenter Roeck
LTC3882 is mostly compatible with LTC3880. Major differences are that it does not measure the input current, and it no longer supports LTC's legacy mechanism to identify the chip. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-08-12hwmon: (ltc2978) Move code to read chip ID into separate functionGuenter Roeck
Verifying the chip type is getting more complicated with new chips, since not all chips support the same mechanism to read the chip type. Move the code into a separate function to simplify adding support for those chips. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-08-09hwmon: (ltc2978) LTM4676 supports CLEAR_PEAKSGuenter Roeck
Use the CLEAR_PEAKS command on LTM4676. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-12-01hwmon: (ltc2978) Add regulator supportAlan Tull
Add simple on/off regulator support for ltc2978 and other pmbus parts supported by the ltc2978 driver. Signed-off-by: Alan Tull <atull@opensource.altera.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Mark Brown <broonie@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-20hwmon: (pmbus/ltc2978) Add support for LTM4676Guenter Roeck
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>
2014-03-06hwmon: (pmbus/ltc2978) Add new chip ID for LTC2974Guenter Roeck
LTC2974 datasheet revision C lists the chip ID for LTC2974 as 0x0213. Reviewed-by: Robert Coulson <rob.coulson@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18hwmon: (pmbus/ltc2978): Add support for LTC2978AGuenter Roeck
Detect LTC2978A chip ID. Treat it as LC2978. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18hwmon: (pmbus/ltc2978): Add support for LTC2977Guenter Roeck
LTC2977 is a pin compatible replacement for LTC2978. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-08hwmon: (pmbus/ltc2978) Add support for LTC2974 and LTC3883Guenter Roeck
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-08hwmon: (pmbus/ltc2978) Code cleanupGuenter Roeck
Use u16 instead of int to store cached limit attributes. This reduces allocated data size per driver instance by 48 bytes. Use defines for the number of pages supported by individual chips. Use ARRAY_SIZE for loops to initialize array variables, and initialize all variables in the same code block. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-03-14hwmon: (pmbus/ltc2978) Fix temperature reportingGuenter Roeck
On LTC2978, only READ_TEMPERATURE is supported. It reports the internal junction temperature. This register is unpaged. On LTC3880, READ_TEMPERATURE and READ_TEMPERATURE2 are supported. READ_TEMPERATURE is paged and reports external temperatures. READ_TEMPERATURE2 is unpaged and reports the internal junction temperature. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Cc: stable@vger.kernel.org # 3.2+ Acked-by: Jean Delvare <khali@linux-fr.org>
2013-03-04hwmon: (pmbus/ltc2978) Use detected chip ID to select supported functionalityGuenter Roeck
We read the chip ID from the chip, use it to determine if the chip ID provided to the driver is correct, and report it if wrong. We should also use the correct chip ID to select supported functionality. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Cc: stable@vger.kernel.org # 3.2+ Acked-by: Jean Delvare <khali@linux-fr.org>
2013-03-04hwmon: (pmbus/ltc2978) Fix peak attribute handlingGuenter Roeck
Peak attributes were not initialized and cleared correctly. Also, temp2_max is only supported on page 0 and thus does not need to be an array. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Cc: stable@vger.kernel.org # 3.2+ Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-19hwmon: (pmbus) Simplify remove functionsGuenter Roeck
Since devm_kzalloc() is now used to allocate driver memory, the client driver remove function has no purpose other than to call pmbus_do_remove(). This means we can get rid of it by redefining pmbus_do_remove() to use the same prototype, and pointing to it directly. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-19hwmon: (pmbus) Convert pmbus drivers to use devm_kzallocGuenter Roeck
Marginally less code and eliminate the possibility of memory leaks. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-19hwmon: convert drivers/hwmon/* to use module_i2c_driver()Axel Lin
This patch converts the drivers in drivers/hwmon/* to use the module_i2c_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Corentin Labbe <corentin.labbe@geomatys.fr> Cc: Dirk Eibach <eibach@gdsys.de> Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> Cc: Steve Glendinning <steve.glendinning@smsc.com> Cc: Riku Voipio <riku.voipio@iki.fi> Cc: Guillaume Ligneul <guillaume.ligneul@gmail.com> Cc: David George <david.george@ska.ac.za> Cc: "Hans J. Koch" <hjk@hansjkoch.de> Cc: Marc Hulsman <m.hulsman@tudelft.nl> Cc: Rudolf Marek <r.marek@assembler.cz> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24hwmon: (pmbus/ltc2978) Add support for LTC3880 to LTC2978 driverGuenter Roeck
The LTC3880 PMBus command set is comparable to LTC2978. Add support for it to the LTC2978 driver. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-10-24hwmon: (pmbus/ltc2978) Explicit driver for LTC2978Guenter Roeck
Provide explicit driver for LTC2978 to enable support for minimum and peak attributes. Remove ltc2978 chip id from generic pmbus driver. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>