summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/pmbus
Commit message (Collapse)AuthorAgeFilesLines
* hwmon: (ltc2978) Add support for LTM4675Guenter Roeck2015-08-192-3/+9
| | | | | | | 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>
* hwmon: (ltc2978) Add polling for chips requiring itMichael Jones2015-08-191-10/+101
| | | | | | | | | 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>
* hwmon: (pmbus) Enable PEC if the controller supports itGuenter Roeck2015-08-191-0/+5
| | | | | | | | PMBus controllers optionally support PEC. Configure the driver to use it if available to improve operational security. Suggested-by: Michael Jones <mike@proclivis.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Use BIT macroGuenter Roeck2015-08-195-102/+107
| | | | | | Using the BIT macro makes the code a little easier to read. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ltc2978) Add support for LTC3886Guenter Roeck2015-08-182-3/+23
| | | | | | | | | | 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>
* hwmon: (ltc2978) Add support for LTC2980 and LTM2987Guenter Roeck2015-08-182-5/+19
| | | | | | | | | | 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>
* hwmon: (ltc2978) Add missing chip IDs for LTC2978 and LTC3882Guenter Roeck2015-08-181-3/+8
| | | | | | | | | | | 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>
* hwmon: (ltc2978) Use correct ID mask to detect all chipsGuenter Roeck2015-08-181-22/+17Star
| | | | | | | | | | 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>
* hwmon: (ltc2978) Introduce helper functions for min and max valuesGuenter Roeck2015-08-171-91/+57Star
| | | | | | | | 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>
* hwmon: (ltc2978) Introduce feature flagsGuenter Roeck2015-08-171-12/+18
| | | | | | | | 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>
* hwmon: (pmbus) Convert command register definitions to enumGuenter Roeck2015-08-171-140/+142
| | | | | | | This will simplify adding new virtual commands. Tested-by: Michael Jones <mike@proclivis.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ltc2978) Add support for LTC2975Guenter Roeck2015-08-172-12/+96
| | | | | | | | 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>
* hwmon: (ltc2978) Add support for LTC3887Guenter Roeck2015-08-122-6/+16
| | | | | | LTC3887 is an enhanced version of LTC3880 and supports the same commands. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ltc2978) Add additional chip IDs for LTM4676 and LTM4676AGuenter Roeck2015-08-121-2/+6
| | | | | | | | | | | | | | | 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>
* hwmon: (ltc2978) Add support for LTC3882Guenter Roeck2015-08-121-6/+44
| | | | | | | | 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>
* hwmon: (ltc2978) Move code to read chip ID into separate functionGuenter Roeck2015-08-121-19/+29
| | | | | | | | | 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>
* hwmon: (pmbus) Add device IDs for TPS544{B,C}2{0,5}Guenter Roeck2015-08-112-1/+6
| | | | | | | | Add device IDs and references for Texas Instruments TPS544B20, TPS544B25, TPS544C20, and TPS544C25 to the generic PMBus driver. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Add support for MAX20751Guenter Roeck2015-08-093-0/+75
| | | | | | | | | | | MAX20751 is a multiphase power controller with internal buck converter. It uses VR12.0 to report the output voltage. This requires an explicit driver, since the VR version can not be auto-detected. The chip supports a manufacturer specific command to fine-tune the output voltage. This command is not currently supported. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Add support for VR12Guenter Roeck2015-08-093-4/+15
| | | | | | Newer chips such as MAX20751 support VR12. Add support for it. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ltc2978) LTM4676 supports CLEAR_PEAKSGuenter Roeck2015-08-091-1/+1
| | | | | | | Use the CLEAR_PEAKS command on LTM4676. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (adm1275) Add support for ADM1293 and ADM1294Guenter Roeck2015-08-092-10/+135
| | | | | | | | ADM1293 and ADM1294 are mostly compatible with other chips of the same series, but have more configuration options. There are also some differences in register details. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Add support for lowest power value attributesGuenter Roeck2015-08-092-24/+34
| | | | | | Add support for powerX_input_lowest for both input and output power. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (adm1275) Introduce new feature flagsGuenter Roeck2015-08-091-43/+54
| | | | | | | | | | Introduce have_vout, have_vaux_status, have_pin_max, and have_uc_fault to simplify adding support for new chips. Also simplify error returns where appropriate to return immediately on error. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (adm1275) Introduce configuration data structure for coeffcientsGuenter Roeck2015-08-091-45/+68
| | | | | | | | Each new chip supported by the driver has a new set of coefficients, making hard-coding coefficients more and more cumbersome. Introduce a datastructure and table to simplify configuration. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (adm1275) Use BIT macroGuenter Roeck2015-08-091-9/+10
| | | | | | Use BIT macro to simplify adding new bit masks. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus_core) Constify pmbus_regulator_opsAxel Lin2015-08-092-2/+2
| | | | | | | pmbus_regulator_ops is not modified after initialized, so make it const. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Explicitly set regulator type for pmbus_regulator_opsAxel Lin2015-08-091-0/+1
| | | | | | | | The pmbus_regulator_ops is for voltage regulators, so explicitly set regulator type for better readability. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* kconfig: use bool instead of boolean for type definition attributesChristoph Jaeger2015-01-071-1/+1
| | | | | | | | | | Support for keyword 'boolean' will be dropped later on. No functional change. Reference: http://lkml.kernel.org/r/cover.1418003065.git.cj@linux.com Signed-off-by: Christoph Jaeger <cj@linux.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
* hwmon: (ltc2978) Add regulator supportAlan Tull2014-12-012-3/+47
| | | | | | | | | | 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>
* hwmon: (pmbus) Add regulator supportAlan Tull2014-12-012-0/+113
| | | | | | | | | | | | | | | | | | Add support for simple on/off control of each channel. To add regulator support, the pmbus part driver needs to add regulator_desc information and number of regulators to its pmbus_driver_info struct. regulator_desc can be declared using default macro for a regulator (PMBUS_REGULATOR) that is in pmbus.h The regulator_init_data can be initialized from either platform data or the device tree. Signed-off-by: Alan Tull <atull@opensource.altera.com> Reviewed-by: Mark Brown <broonie@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) add helpers for byte write and read modify writeAlan Tull2014-12-012-0/+35
| | | | | | | | | | Add two helper functions: * pmbus_write_byte_data = paged byte write * pmbus_update_byte_data = paged byte read/modify/write Signed-off-by: Alan Tull <atull@opensource.altera.com> Cc: Mark Brown <broonie@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Add tps40422 front-end driverZhu, Richard \(NSN - CN/Beijing\)2014-08-044-3/+76
| | | | | | | | | | | | For TI power management chip TPS40422, READ_TEMPERATURE_2 command is supported on page 1 of the chip, but the original driver(pmbus.c) only tried to detect this command on page 0, this will lead to a result that the temperature sensor in page 1 couldn't be detected. This change is to isolate the tps40422 driver from pmbus.c into a solo front-end driver. Signed-off-by: Zhu Laiwen <richard.zhu@nsn.com> [Guenter Roeck: Dropped unnecessary license text (fixes checkpatch warning)] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/ltc2978) Add support for LTM4676Guenter Roeck2014-03-201-9/+11
| | | | | | | | 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>
* hwmon: (pmbus/ltc2978) Add new chip ID for LTC2974Guenter Roeck2014-03-061-2/+3
| | | | | | | 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>
* hwmon: (pmbus) Support per-page exponent in linear modeGuenter Roeck2014-02-031-32/+36
| | | | | | | | | | | Some chips use different exponents for sensors on different pages or rails. Detect and store exponent per page to support this situation. This fixes a problem with wrong voltages seen on UCD90120. Reported-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Tested-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/ltc2978): Add support for LTC2978AGuenter Roeck2013-10-181-1/+3
| | | | | | Detect LTC2978A chip ID. Treat it as LC2978. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/ltc2978): Add support for LTC2977Guenter Roeck2013-10-181-3/+9
| | | | | | LTC2977 is a pin compatible replacement for LTC2978. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/lm25066) Add support for LM25063Guenter Roeck2013-10-181-9/+82
| | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: Correct some typosLABBE Corentin2013-10-181-1/+1
| | | | | Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Convert to use hwmon_device_register_with_groupsGuenter Roeck2013-10-141-13/+7Star
| | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Don't unnecessarily crash the kernelGuenter Roeck2013-10-141-1/+1
| | | | | | | | | pmbus code currently crashes the kernel if it detects an internal implementation error. While the detected condition suggests that there is a bug in the code, it is hardly fatal. Therefore, it should not trigger a crash. Replace BUG() with WARN(). Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: use dev_get_platdata()Jingoo Han2013-08-121-1/+1
| | | | | | | | Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/lm25066) Add support for LM25056Guenter Roeck2013-04-082-10/+124
| | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/lm25066) Refactor device specific coefficientsGuenter Roeck2013-04-081-78/+118
| | | | | | | Initialize device specific coefficients from table instead of hard-coding it to simplify adding additional chips. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/lm25066) Clamp limit attributesGuenter Roeck2013-04-081-0/+13
| | | | | | | | | | Limits on all supported sensors and chips have to be within 0..0x0fff, and limits are always positive. Clamp written values in chip driver. Also clear value cache to ensure that the actually written value is read back and reported correctly. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/lm25066) Report VAUX as vmonGuenter Roeck2013-04-081-52/+21Star
| | | | | | | | | So far the driver reported the voltage on VAUX as "vout2". This was not entirely appropriate as it is not an output voltage, and complicates the code. Use the new virtual "VMON" register set and report the voltage as "vmon" instead. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/ltc2978) Add support for LTC2974 and LTC3883Guenter Roeck2013-04-082-21/+132
| | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/ltc2978) Code cleanupGuenter Roeck2013-04-081-11/+14
| | | | | | | | | | 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>
* hwmon: (pmbus/ltc2978) Fix temperature reportingGuenter Roeck2013-03-141-6/+8
| | | | | | | | | | | | | | 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>
* hwmon: (pmbus) Fix krealloc() misuse in pmbus_add_attribute()David Woodhouse2013-03-141-5/+7
| | | | | | | | If krealloc() returns NULL, it *doesn't* free the original. So any code of the form 'foo = krealloc(foo, …);' is almost certainly a bug. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>