summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/pmbus
Commit message (Collapse)AuthorAgeFilesLines
* hwmon: (pmbus) Support per-page exponent in linear modeGuenter Roeck2014-02-021-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-131-13/+7
| | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Don't unnecessarily crash the kernelGuenter Roeck2013-10-131-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-111-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-072-10/+124
| | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/lm25066) Refactor device specific coefficientsGuenter Roeck2013-04-071-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-071-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-071-52/+21
| | | | | | | | | 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-072-21/+132
| | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/ltc2978) Code cleanupGuenter Roeck2013-04-071-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>
* hwmon: (pmbus/ltc2978) Use detected chip ID to select supported functionalityGuenter Roeck2013-03-031-1/+1
| | | | | | | | | | 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>
* hwmon: (pmbus/ltc2978) Fix peak attribute handlingGuenter Roeck2013-03-031-13/+15
| | | | | | | | | | 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>
* hwmon: (pmbus) Clean up for code size reductionGuenter Roeck2013-02-061-48/+38
| | | | | | | Rearranged some data structures, and merged some common functions. Overall code and data size reduction by more than 900 bytes. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/max34440) Add support for MAX34460 and MAX34461Guenter Roeck2013-02-062-3/+74
| | | | | | | MAX34460 is a PMBus 12-Channel Voltage Monitor & Sequencer. MAX34461 is a PMBus 16-Channel Voltage Monitor & Sequencer. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Add support for word status registerGuenter Roeck2013-02-061-28/+52
| | | | | | | Not all PMBus devices support the byte status register at 0x78. Try to use the word status register at 0x79 instead if that is the case. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/zl6100) Add support for VMON/VDRVGuenter Roeck2013-02-061-8/+168
| | | | | | | | | | | Some of the ZL6100 compatible chips support monitoring a separate voltage pin, VMON (ZL2004) or VDRV (ZL91xx). Report it as in2 / vmon. The chips support implicit warning limits for VMON/VDRV, as percentage of the respective critical voltage. Support by reading/writing the critical voltages and calculating the associated warning voltages. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Add function to clear sensor cacheGuenter Roeck2013-02-062-0/+9
| | | | | | | | | | | For PMBus chips, modifying one limit register may affect other limits. Since limits are all cached in the PMBus core driver, related changes are not reflected in reported limits. Introduce function to clear the attribute cache. After calling this function, the core pmbus driver re-reads all cached values. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Add support for additional voltage sensorGuenter Roeck2013-02-062-9/+55
| | | | | | | | | | | | | | | Some PMBus chips support monitoring an additional non-standard voltage. While this voltage can in many cases be supported by simulating an additional sensor page, this does not work in all cases. Specifically, it is problematic if the data format is linear and the voltage is reported in LINEAR11 format. Since output voltages use LINEAR16, and the exponent for LINEAR16 data is chip-wide and fixed, this can result in overflows. To solve this problem, add support for an additional virtual input voltage, call it 'vmon', and treat this voltage as input voltage (which, when the chip supports linear data format, uses LINEAR11). Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Use krealloc to allocate attribute memoryGuenter Roeck2013-02-061-109/+31
| | | | | | | | | | | | | So far, attribute memory was allocated by pre-calculating the maximum possible amount of attributes. Not only does this waste memory, it is also risky because the calculation might be wrong. It also requires a lot of defines to specify the maximum number of attributes per class. Allocate attribute memory using krealloc() instead. That means we have to use kfree(), since devm_krealloc() does not exist, but that is still less costly and less risky than trying to predict the number of attributes at the beginning. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Simplify memory allocation for sensor attributesGuenter Roeck2013-02-061-34/+29
| | | | | | | | Since memory is now allocated with dev_ functions, we no longer need to keep track of allocated memory. Sensor memory allocation can therefore be simplified significantly. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Improve boolean handlingGuenter Roeck2013-02-061-87/+74
| | | | | | | | | | | | | Boolean handling depends on storing the sensor data index in sensor_device_attr as part of the index variable. This limits the number of sensor attributes to 256, and means the sensor sequence number actually has to be maintained to be able to access sensor data from boolean functions. Rework the code to store sensor pointers in the pmbus_boolean data structure directly. With this approach, the number of supportable sensors is now unlimited. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Simplify memory allocation for labels and booleansGuenter Roeck2013-02-061-116/+149
| | | | | | | | Since memory is now allocated with dev_ functions, we no longer need to keep track of allocated memory. Memory allocation for booleans and labels can therefore be simplified substantially by allocating it only as needed. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Use dev variable to represent client->devGuenter Roeck2013-02-061-19/+18
| | | | | | This simplifies the code and makes it a bit smaller. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Fix 'Macros with multiple statements' checkpatch errorGuenter Roeck2013-02-061-33/+43
| | | | | | | | | | | | Fix: ERROR: Macros with multiple statements should be enclosed in a do - while loop by unwinding the problematic macros. As a side effect, this patch reduces code size on x86_64 by 160 bytes and bss size by 64 bytes. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Drop unnecessary error messages in probe error pathGuenter Roeck2013-02-061-18/+6
| | | | | | | Drop error messages due to implementation errors and due to memory allocation errors. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: Replace SENSORS_LIMIT with clamp_valGuenter Roeck2013-01-251-1/+1
| | | | | | | | | | | | SENSORS_LIMIT and the generic clamp_val have the same functionality, and clamp_val is more efficient. This patch reduces text size by 9052 bytes and bss size by 11624 bytes for x86_64 builds. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: George Joseph <george.joseph@fairview5.com> Acked-by: Jean Delvare <khali@linux-fr.org>
* hwmon: (pmbus) remove CONFIG_EXPERIMENTALKees Cook2012-10-141-1/+1
| | | | | | | | | | | This config item has not carried much meaning for a while now and is almost always enabled by default. As agreed during the Linux kernel summit, remove it. CC: Guenter Roeck <linux@roeck-us.net> CC: Jean Delvare <khali@linux-fr.org> Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: Drop needless includes of <linux/delay.h>Jean Delvare2012-10-101-1/+0
| | | | | | | | | These drivers use no sleep or delay functions so they don't need to include <linux/delay.h>. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <linux@roeck-us.net> Cc: Rudolf Marek <r.marek@assembler.cz>
* hwmon: Add missing inclusions of <linux/jiffies.h>Jean Delvare2012-10-101-0/+1
| | | | | | | | | | | | Many hwmon drivers use jiffies but omit the inclusion of the header file. Fix that, and also fix one driver which was including the header file but didn't need it. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Luca Tettamanti <kronos.it@gmail.com> Cc: Marc Hulsman <m.hulsman@tudelft.nl> Cc: Rudolf Marek <r.marek@assembler.cz>
* hwmon: (pmbus_core) Fix compiler warningGuenter Roeck2012-04-091-9/+8
| | | | | | | | | | | | | | Some configurations produce the following compiler warning: drivers/hwmon/pmbus/pmbus_core.c: In function 'pmbus_show_boolean': drivers/hwmon/pmbus/pmbus_core.c:752: warning: 'val' may be used uninitialized in this function While this is a false positive, it can easily be fixed by overloading the return value from pmbus_get_boolean with both val and error return code (val is a boolean and thus never negative). Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
* hwmon: (zl6100) Add support for ZL9101M and ZL9117MGuenter Roeck2012-03-182-4/+7
| | | | | | | ZL9101M and ZL9117M are compatible to ZL6100. Add support to the zl6100 driver. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Jean Delvare <khali@linux-fr.org>
* hwmon: (adm1275) Add support for ADM1075Guenter Roeck2012-03-182-6/+86
| | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (max34440) Add support for MAX34446Guenter Roeck2012-03-182-5/+111
| | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Add more virtual registersGuenter Roeck2012-03-182-29/+54
| | | | | | | | | | Add PMBUS_VIRT_READ_TEMP_AVG, PMBUS_VIRT_READ_TEMP2_AVG, PMBUS_VIRT_READ_POUT_AVG, PMBUS_VIRT_READ_POUT_MAX, and PMBUS_VIRT_RESET_POUT_HISTORY. We'll need those for MAX34446. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Add support for Lineage Power MDT040Guenter Roeck2012-03-182-1/+3
| | | | | | | MDT040 is supported by the generic PMBus driver. Add device ID and reference to datasheet. Also mention Lineage Power device support in Kconfig. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Add support for TI TPS40400 and TPS40422Guenter Roeck2012-03-182-1/+3
| | | | | | | TPS40400 and TPS40422 are supported by the generic PMBus driver. Add device IDs and data sheet references. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (max34440) Add support for 'lowest' output voltage attributeGuenter Roeck2012-03-181-0/+9
| | | | | | | | MAX34440 and compatibles support reporting the lowest measured output voltage. Add support for it. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Jean Delvare <khali@linux-fr.org>
* hwmon: (pmbus) Simplify remove functionsGuenter Roeck2012-03-1812-74/+13
| | | | | | | | | 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>
* hwmon: (pmbus) Convert pmbus drivers to use devm_kzallocGuenter Roeck2012-03-188-154/+56
| | | | | | Marginally less code and eliminate the possibility of memory leaks. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: convert drivers/hwmon/* to use module_i2c_driver()Axel Lin2012-03-1810-110/+10
| | | | | | | | | | | | | | | | | | 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>
* hwmon: (pmbus) Replace strict_strtol with kstrtolGuenter Roeck2012-03-181-1/+1
| | | | | | | | strict_strtol is deprecated and results in a checkpatch warning. Replace it with kstrtol. Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (zl6100) Enable interval between chip accesses for all chipsGuenter Roeck2012-03-141-9/+3
| | | | | | | | | | Intersil reports that all chips supported by the zl6100 driver require an interval between chip accesses, even ZL2004 and ZL6105 which were thought to be safe. Reported-by: Vivek Gani <vgani@intersil.com> Cc: stable@vger.kernel.org # 3.2+ Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: (zl6100) Maintain delay parameter in driver instance dataGuenter Roeck2012-03-071-4/+6
| | | | | | | | | | | | | A global delay parameter has the side effect of being overwritten with 0 if a single ZL2004 or ZL6105 is instantiated. If other chips supported by the same driver are in the system, this will result in access errors for those chips. To solve the problem, keep a per-instance copy of the delay parameter, and do not change the original parameter. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Cc: stable@vger.kernel.org # 3.1+ Acked-by: Jean Delvare <khali@linux-fr.org>
* hwmon: (pmbus_core) Fix maximum number of POUT alarm attributesGuenter Roeck2012-03-071-1/+2
| | | | | | | | There are up to three POUT alarm attributes, not two, since cap_alarm was added. Reported-by: Michele Petracca <mi.petracca@gmail.com> Cc: stable@vger.kernel.org # 3.0+ [3.0 will need backport] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
OpenPOWER on IntegriCloud