summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/pmbus_core.c
Commit message (Collapse)AuthorAgeFilesLines
* hwmon: (pmbus) Use long variables for register to data conversionsGuenter Roeck2011-07-121-10/+10
| | | | | | | | | | Using integer variable types for register to data conversions can cause overflows especially for power calculations, which are in microwatt. Use long variables instead. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Jean Delvare <khali@linux-fr.org> Cc: stable@kernel.org # 2.6.39+
* hwmon: (pmbus) Drop check for PMBus revision register in probe functionGuenter Roeck2011-07-011-8/+3
| | | | | | | | | Some PMBus devices do not support the PMBus revision register, so don't check if it exists. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com> Cc: stable.kernel.org # 2.6.39
* hwmon: (pmbus) Initialize sysfs attributesGuenter Roeck2011-05-271-0/+1
| | | | | | | | | | | Initialize sysfs attrs before device_create_file() call to suppress lockdep_init_map() warning: WARNING: at kernel/lockdep.c:2701 lockdep_init_map+0x12d/0x140() Reviewed-by: Robert Coulson <robert.coulson@ericsson.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Cc: stable@kernel.org # .39.x
* hwmon: (pmbus) Use device specific function to read fan configurationGuenter Roeck2011-05-191-4/+2
| | | | | | | | Fan control implementation tends to be device specific, so start using the device specific function call to read fan configuration registers. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Tom Grennan <tom.grennan@ericsson.com>
* hwmon: (pmbus) Expand scope of device specific get_status functionGuenter Roeck2011-05-191-11/+18
| | | | | | | | | Some devices use non-standard registers to access various functionality. This does not only affect status registers, but other registers as well. Rename local get_status function to get_byte_data to reflect this requirement. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Tom Grennan <tom.grennan@ericsson.com>
* hwmon: (pmbus) Introduce infrastructure to detect sensors and limit registersGuenter Roeck2011-05-191-514/+421
| | | | | | | | | This commit replaces hard-coded sensor and limit register detection code with table based sensor detection. This change eliminates code block repetition and reduces code size. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Tom Grennan <tom.grennan@ericsson.com>
* hwmon: (pmbus) Removed unused variable from struct pmbus_dataGuenter Roeck2011-04-191-1/+0
| | | | | | | | struct pmbus_data included an unused variable named status_bits. Remove it. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Tom Grennan <tom.grennan@ericsson.com>
* hwmon: (pmbus) Fix temperature limit register accessGuenter Roeck2011-03-261-34/+36
| | | | | | | | | | Commit 8677011 added auto-update to temperature limit registers. Unfortunately, the update flag is also used to determine if an attribute is writable, which results in read-only temperature limit registers. To fix the problem, pass 'readonly' as separate flag to the function used to add sensor attributes. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: (pmbus) Fix LINEAR16 data formatGuenter Roeck2011-03-141-14/+17
| | | | | | | | LINEAR16 data format is unsigned, not signed. Impact is that affected attributes report negative values in the upper half of the supported value range. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: (pmbus) Continuously update temperature limit registersGuenter Roeck2011-03-141-4/+10
| | | | | | | | | | | | PMBus only has one set of limit registers for up to three temperature sensors. Thus, changing a limit for one of the temperature sensors affects limits for other temperature sensors in the same page (and potentially multiple pages depending on the chip implementation). To handle this situation, re-read all temperature limit registers when updating sensor data. This way, all affected temperature limits are updated whenever the limit for a single sensor is changed. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: (pmbus) Improve support for paged temperature sensorsGuenter Roeck2011-03-141-18/+28
| | | | | | | | | | | | | Assumption so far was that PMBus devices would support TEMP2 and TEMP3 registers only on page 0, and that only the TEMP1 register would be used/supported on other pages. Turns out that is not correct. UCD92xx devices support TEMP1 and TEMP2 on page 0, and TEMP2 on other pages. So it is necessary to change the core code such that it does not make a page based assumptions about temperature register support. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: (pmbus) Improve support for paged fansGuenter Roeck2011-03-141-30/+40
| | | | | | | | | | | | | | So far, it seemed like fans would either all be in page 0, or that there would be one page per fan. Turns out this was a wrong assumption. There is at least one PMBus fan controller which supports three pages with four fans each. Update code to handle this situation. Reported-by: Greg Schnorr <gschnorr@cisco.com> Tested-by: Greg Schnorr <gschnorr@cisco.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Greg Schnorr <gschnorr@cisco.com>
* hwmon: (pmbus) More stringent checking of VOUT_MODE registerGuenter Roeck2011-03-141-3/+4
| | | | | | | | | | | | | | | Some PMBus chips do not support the VOUT_MODE register. To make matters worse, such chips may not return an error when reading the register either, but instead return 0xff. Check if the register exists using pmbus_check_byte_register() before reading its value. In addition, validate the returned value and ignore it if it is 0xff (which is invalid). Reported-by: Greg Schnorr <gschnorr@cisco.com> Tested-by: Greg Schnorr <gschnorr@cisco.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Greg Schnorr <gschnorr@cisco.com>
* hwmon: PMBus device driverGuenter Roeck2011-03-141-0/+1628
This driver adds support for hardware monitoring features of various PMBus devices. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
OpenPOWER on IntegriCloud