summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
Commit message (Collapse)AuthorAgeFilesLines
* hwmon: Avoid building drivers for powerpc that read/write ISA addressesDean Nelson2011-11-041-2/+13
| | | | | | | | | | | A modprobe of hwmon drivers that read/write ISA addresses on a powerpc results in a kernel Oops. These reads/writes are being done via the inb()/in_8() and outb()/out_8() macros. Prevent these drivers from being built for powerpc. Signed-off-by: Dean Nelson <dnelson@redhat.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* Merge branch 'for-next' of git://git.infradead.org/users/sameo/mfd-2.6Linus Torvalds2011-11-031-6/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'for-next' of git://git.infradead.org/users/sameo/mfd-2.6: (80 commits) mfd: Fix missing abx500 header file updates mfd: Add missing <linux/io.h> include to intel_msic x86, mrst: add platform support for MSIC MFD driver mfd: Expose TurnOnStatus in ab8500 sysfs mfd: Remove support for early drop ab8500 chip mfd: Add support for ab8500 v3.3 mfd: Add ab8500 interrupt disable hook mfd: Convert db8500-prcmu panic() into pr_crit() mfd: Refactor db8500-prcmu request_clock() function mfd: Rename db8500-prcmu init function mfd: Fix db5500-prcmu defines mfd: db8500-prcmu voltage domain consumers additions mfd: db8500-prcmu reset code retrieval mfd: db8500-prcmu tweak for modem wakeup mfd: Add db8500-pcmu watchdog accessor functions for watchdog mfd: hwacc power state db8500-prcmu accessor mfd: Add db8500-prcmu accessors for PLL and SGA clock mfd: Move to the new db500 PRCMU API mfd: Create a common interface for dbx500 PRCMU drivers mfd: Initialize DB8500 PRCMU regs ... Fix up trivial conflicts in arch/arm/mach-imx/mach-mx31moboard.c arch/arm/mach-omap2/board-omap3beagle.c arch/arm/mach-u300/include/mach/irqs.h drivers/mfd/wm831x-spi.c
| * hwmon: Convert mc13783-adc to mc13xxx APIUwe Kleine-König2011-10-241-6/+6
| | | | | | | | | | | | | | | | | | The mc13783_... functions are going to be removed, so switch to the more generic API. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | drivers/hwmon/hwmon.c: convert idr to ida and use ida_simple_get()Jonathan Cameron2011-10-311-39/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | A straightforward looking use of idr for a device id. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Tejun Heo <tj@kernel.org> Cc: Guenter Roeck <guenter.roeck@ericsson.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Acked-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* | hwmon: convert idr to ida and use ida_simple interfaceJonathan Cameron2011-10-311-24/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hwmon was using an idr with a NULL pointer, so convert to an ida which then allows use of Rusty's ida_simple_get. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Tejun Heo <tj@kernel.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: David Airlie <airlied@linux.ie> Cc: Thomas Hellstrom <thellstrom@vmware.com> Cc: Evgeniy Polyakov <zbr@ioremap.net> Cc: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* | Merge branch 'x86-microcode-for-linus' of ↵Linus Torvalds2011-10-281-24/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip * 'x86-microcode-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86, microcode, AMD: Add microcode revision to /proc/cpuinfo x86, microcode: Correct microcode revision format coretemp: Get microcode revision from cpu_data x86, intel: Use c->microcode for Atom errata check x86, intel: Output microcode revision in /proc/cpuinfo x86, microcode: Don't request microcode from userspace unnecessarily Fix up trivial conflicts in arch/x86/kernel/cpu/amd.c (conflict between moving AMD BSP code to cpu_dev helper function and adding AMD microcode revision to /proc/cpuinfo code)
| * | coretemp: Get microcode revision from cpu_dataAndi Kleen2011-10-141-24/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the ucode revision is available in cpu_data remove the existing code in coretemp.c to query it manually. Read the ucode revision from cpu_data instead Signed-off-by: Andi Kleen <ak@linux.intel.com> Acked-by: H. Peter Anvin <hpa@zytor.com> Cc: jbeulich@novell.com Cc: fenghua.yu@intel.com Cc: khali@linux-fr.org Link: http://lkml.kernel.org/r/1318466795-7393-3-git-send-email-andi@firstfloor.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
* | | hwmon: (w83627ehf) Better fix for negative temperature valuesJean Delvare2011-10-241-25/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is more efficient to left-align 8-bit temperature values, so that 8-bit and 9-bit temperature values can be handled exactly the same way in the rest of the code. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon: (w83627ehf) Uninline is_word_sizedJean Delvare2011-10-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Helper function is_word_sized has grown too much to be kept inline. It was OK when there were only 6 word-sized registers but support for new devices have made the list much longer. The function is also called from more places than before. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon: (lm75) Document why clones are not detectedJean Delvare2011-10-241-13/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Explain why clones of the LM75 are generally not detected by the driver, and why this isn't going to change. Also update the documentation to reflect the list of chip names currently supported by the driver. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon: (w83627ehf) Move fan pins check to a separate functionJean Delvare2011-10-241-53/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | Move the check of fan pin usage to a separate function. This improves readability, and will make it easier to integrate chip-specific conditions. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon: (w83627ehf) Skip reading unused voltage registersJean Delvare2011-10-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | When in6 is missing, don't read the corresponding registers, it's a waste of time. The logic is similar to what we do for fans and temperatures. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon: (lm75) Add support for Analog Devices ADT75Michael Hennerich2011-10-242-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add datasheet reference and device ID for ADT75. The ADT75, like some other LM75 derivatives, needs to be instantiated using methods 1, 2, or 4. For more information see Documentation/i2c/instantiating-devices. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon: (pmbus_core) Simplify sign extensionsGuenter Roeck2011-10-241-13/+4
| | | | | | | | | | | | | | | | | | | | | Shift operations can be used for sign extensions. Use it. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
* | | hwmon: (pmbus) Add support for Lineage Power DC-DC convertersGuenter Roeck2011-10-241-0/+4
| | | | | | | | | | | | | | | | | | | | | Add device IDs and reference to datasheets for Lineage Power DC-DC converters. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
* | | hwmon: (pmbus/ltc2978) Add support for LTC3880 to LTC2978 driverGuenter Roeck2011-10-242-14/+127
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | hwmon: (pmbus/ltc2978) Explicit driver for LTC2978Guenter Roeck2011-10-244-2/+307
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | hwmon: (pmbus) Add support for TEMP2 peak attributesGuenter Roeck2011-10-242-5/+43
| | | | | | | | | | | | | | | | | | | | | | | | At least one PMBus chip supports peak attributes for READ_TEMPERATURE2. Add virtual registers to be able to report it to the user. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
* | | hwmon: AD7314 driver (ported from IIO)Jonathan Cameron2011-10-243-0/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Driver for AD7314, ADT7301, and ADT7302, ported from IIO. Currently dropped power down mode support. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> [guenter.roeck@ericsson.com: Added MODULE_DEVICE_TABLE] Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon: (pmbus) Add support for Intersil power management chipsGuenter Roeck2011-10-243-0/+268
| | | | | | | | | | | | | | | | | | | | | | | | Add support for Intersil / Zilker Labs ZL2004, ZL2006, ZL2008, ZL2105, ZL2106, ZL6100, and ZL6105. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
* | | hwmon: (pmbus) Always call _pmbus_read_byte in core driverGuenter Roeck2011-10-246-15/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Always call _pmbus_read_byte() instead of pmbus_read_byte() in PMBus core driver. With this change, device specific read functions can be implemented for all registers. Since the device specific read_byte function is now always called, we need to be more careful with page validations. Only fail if the passed page number is larger than 0, since -1 means "current page". Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
* | | hwmon: (pmbus) Replace EINVAL return codes with more appropriate errorsGuenter Roeck2011-10-244-13/+13
| | | | | | | | | | | | | | | | | | | | | EINVAL was over-used in the code. Replace it with more appropriate errors. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
* | | hwmon/f71882fg: Make the decision wether to register fan attr. per fanHans de Goede2011-10-241-65/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch the f71882fg driver completely fails to initialize on systems which have reserved settings in the pwm enable register, and it disables all auto pwm sysfs attributes if any fan is controlled by a digital sensor reading. This patch changes the fail to initialize into don't register any attributes for the fan for which there are reserved settings in the pwm enable register and also makes the not registering of auto pwm sysfs attributes a per fan thing. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon/f71882fg: Add a f71882fg_create_fan_sysfs_files helper functionHans de Goede2011-10-241-44/+64
| | | | | | | | | | | | | | | | | | | | | | | | This is a preparation patch for not registering fan/pwm attributes for some fans (rather then register them for all or for none). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon/f71882fg: Make all fan/pwm attr tables 2 dimensionalHans de Goede2011-10-241-24/+26
| | | | | | | | | | | | | | | | | | | | | | | | This is a preparation patch for not registering fan/pwm attributes for some fans (rather then register them for all or for none). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon: (exynos4_tmu) Remove IRQF_DISABLEDYong Zhang2011-10-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit [c58543c8: genirq: Run irq handlers with interrupts disabled], we run all interrupt handlers with interrupts disabled and we even check and yell when an interrupt handler returns with interrupts enabled (see commit [b738a50a: genirq: Warn when handler enables interrupts]). So now this flag is a NOOP and can be removed. Signed-off-by: Yong Zhang <yong.zhang0@gmail.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon: Add driver for EXYNOS4 TMUDonggeun Kim2011-10-243-0/+535
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows to read temperature from TMU(Thermal Management Unit) of SAMSUNG EXYNOS4 series of SoC. Signed-off-by: Donggeun Kim <dg77.kim@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon: (pmbus/adm1275) Add support for ADM1276Guenter Roeck2011-10-242-10/+54
| | | | | | | | | | | | | | | | | | | | | | | | ADM1276 is mostly compatible to ADM1275, with added support for input power measurement. Add support for it to the ADM1275 driver. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Jean Delvare <khali@linux-fr.org>
* | | hwmon: (pmbus/adm1275) Add support for second current limitGuenter Roeck2011-10-241-7/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ADM1275 supports a second current limit, which can be configured as either lower or upper limit. Add support for it and report it as either lower or upper critical current limit. Also replace error return code EINVAL for unsupported pages with ENXIO as this is more appropriate for the observed condition. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Jean Delvare <khali@linux-fr.org>
* | | hwmon: (pmbus) Don't return errors from driver remove functionsGuenter Roeck2011-10-2410-21/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Driver remove functions have an error return value, but rarely return an error in practice. If a driver does return an error from its remove function, the driver won't be unloaded and is expected to stay alive. pmbus_do_remove() is defined as returning an int, but always returns 0 (no error). Calling code passes that return value on to high level driver remove functions, but does not evaluate it and removes driver data even if pmbus_do_remove() returned an error (which it in practice never does). Even if this code could never cause a real problem, it is nevertheless conceptually wrong. To reduce confusion and simplify the code, change pmbus_do_remove() to be a void function, and have PMBus client drivers always return zero in their driver remove functions. Reported-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Jean Delvare <khali@linux-fr.org>
* | | hwmon: (pmbus) Add comments explaining internal driver API return valuesGuenter Roeck2011-10-241-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | Return values for functions reading/writing manufacturer specific registers are poorly explained. Add comments to improve documentation. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Jean Delvare <khali@linux-fr.org>
* | | hwmon: (w83627ehf) add caseopen detectionDmitry Artamonow2011-10-241-0/+62
| |/ |/| | | | | | | | | | | | | | | Export caseopen alarm status into userspace for Winbond W83627* and Nuvoton NCT677[56] chips and implement alarm clear attribute. Second caseopen alarm on NCT6776 is also supported. Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | hwmon: (w83627ehf) Fix negative 8-bit temperature valuesJean Delvare2011-10-201-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Since 8-bit temperature values are now handled in 16-bit struct members, values have to be cast to s8 for negative temperatures to be properly handled. This is broken since kernel version 2.6.39 (commit bce26c58df86599c9570cee83eac58bdaae760e4.) Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Guenter Roeck <guenter.roeck@ericsson.com> Cc: stable@kernel.org # 2.6.39+ Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | hwmon: (w83627ehf) Properly report thermal diode sensorsJean Delvare2011-10-131-4/+11
|/ | | | | | | | | | | | | | | | The w83627ehf driver is improperly reporting thermal diode sensors as type 2, instead of 3. This caused "sensors" and possibly other monitoring tools to report these sensors as "transistor" instead of "thermal diode". Furthermore, diode subtype selection (CPU vs. external) is only supported by the original W83627EHF/EHG. All later models only support CPU diode type, and some (NCT6776F) don't even have the register in question so we should avoid reading from it. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: stable@kernel.org Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: (coretemp) Avoid leaving around dangling pointerGuenter Roeck2011-09-281-0/+1
| | | | | | | | | | Storing the struct temp_data pointer allocated from create_core_data() when returning an error has the potential of leaving around a pointer to freed memory. Reset it to NULL for error returns. Reported-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Jean Delvare <khali@linux-fr.org>
* hwmon: (coretemp) Fixup platform device ID changeJean Delvare2011-09-281-15/+12
| | | | | | | | | | | | | | | With recent change "hwmon: (coretemp) don't use kernel assigned CPU number as platform device ID", the microcode check is now running on random CPU. Fix that by checking the microcode before creating the platform device rather than at probe time. Also avoid calling TO_PHYS_ID(cpu) twice in the same function, it's expensive. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Jan Beulich <jbeulich@suse.com> Cc: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: (coretemp) remove struct platform_data * parameter from ↵Jan Beulich2011-09-231-6/+3
| | | | | | | | | | | create_core_data() The only caller of the function obtained the pointer solely for the purpose of passing it to this function, while it can be easily determined from the struct platform_device * parameter also passed. Signed-off-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: (coretemp) constify static dataJan Beulich2011-09-231-2/+2
| | | | | | | | These arrays won't ever be written to, so protect them from unintentional modification. Signed-off-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: (coretemp) don't use kernel assigned CPU number as platform device IDJan Beulich2011-09-231-2/+2
| | | | | | | | | ... as that has the potential to conflict with (particularly soft) CPU hot removal and re-adding. Signed-off-by: Jan Beulich <jbeulich@suse.com> [guenter.roeck@ericsson.com: use platform device ID as physical CPU id] Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: (ds620) Fix handling of negative temperaturesRoland Stigge2011-09-211-1/+1
| | | | | | | | Signed (negative) temperatures were not handled correctly. Signed-off-by: Roland Stigge <stigge@antcom.de> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Cc: stable@kernel.org # v2.6.38+
* hwmon: (w83791d) rename prototype parameter from 'register' to 'reg'Chris Peterson2011-09-211-2/+2
| | | | | | | | | | | gcc -Wextra warns "register is not at beginning of declaration" because the compiler thinks the parameter has been marked as a 'register' variable, but the function prototype intended to name the parameter "register" (which is a reserved keyword). Signed-off-by: Chris Peterson <cpeterso@cpeterso.com> Acked-by: Marc Hulsman <m.hulsman@tudelft.nl> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: (coretemp) Don't use threshold registers for tempX_maxGuenter Roeck2011-09-211-121/+14
| | | | | | | | | | | | | | | | | | | | | | | | | With commit c814a4c7c4aad795835583344353963a0a673eb0, the meaning of tempX_max was changed. It no longer returns the value of bits 8:15 of MSR_IA32_TEMPERATURE_TARGET, but instead returns the value of CPU threshold register T1. tempX_max_hyst was added to reflect the value of temperature threshold register T0. As it turns out, T0 and T1 are used on some systems, presumably by the BIOS. Also, T0 and T1 don't have a well defined meaning. The thresholds may be used as upper or lower limits, and it is not guaranteed that T0 <= T1. Thus, the new attribute mapping does not reflect the actual usage of the threshold registers. Also, register contents are changed during runtime by an entity other than the hwmon driver, meaning the values cached by the driver do not reflect actual register contents. Revert most of c814a4c7c4aad795835583344353963a0a673eb0 to address the problem. Support for T0 and T1 will be added back in with a separate commit, using new attribute names. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Durgadoss R <durgadoss.r@intel.com> Acked-by: Jean Delvare <khali@linux-fr.org>
* hwmon: (coretemp) Let the user force TjMaxJean Delvare2011-09-211-0/+15
| | | | | | | | | | | | | | | On old CPUs (and even some recent Atom CPUs) TjMax can't be read from the CPU registers, so it is guessed by the driver using a complex heuristic which isn't reliable. So let users who know their CPU's TjMax pass it as a module parameter. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: "R, Durgadoss" <durgadoss.r@intel.com> Cc: Guenter Roeck <guenter.roeck@ericsson.com> Cc: Alexander Stein <alexander.stein@systec-electronic.com> Acked-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: (coretemp) Drop duplicate function get_pkg_tjmaxJean Delvare2011-09-211-22/+4
| | | | | | | | | | | | | | | | | Function get_pkg_tjmax is a simplified copy of get_tjmax. Drop it and always use get_tjmax, result is the same and this avoids code duplication. Also make get_tjmax less verbose: don't warn about MSR read failure when failure was expected, and don't report TjMax in the logs unless debugging is enabled. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Guenter Roeck <guenter.roeck@ericsson.com> Cc: Durgadoss R <durgadoss.r@intel.com> Acked-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: (coretemp) Initialize tminJean Delvare2011-09-141-1/+6
| | | | | | | | | | | | | | ttarget is initialized when the driver is loaded, but tmin is not. As a result, tempX_max_hyst attributes read 0. Fix this. Also use THERM_*_THRESHOLD* constants in these initializations instead of hard-coding the constants. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: "R, Durgadoss" <durgadoss.r@intel.com> Cc: Guenter Roeck <guenter.roeck@ericsson.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: (pmbus) Fix low limit temperature alarmsGuenter Roeck2011-09-131-1/+8
| | | | | | | | | | | | | | | Temperature alarms are detected by checking the alarm bit and comparing temperature limits against the current temperature. For low limits, this comparison needs to be reversed (temp < limit instead of temp > limit). This was not taken into account, resulting in wrong alarms if a temperature fell below a low limit. Fix by adding a low limit flag in the limit data structure. When creating the sensor entry, the order of registers to compare is now reversed for low limits. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Jean Delvare <khali@linux-fr.org> Cc: stable@kernel.org # 3.0+
* hwmon: (ucd9000/ucd9200) Optimize array walkJean Delvare2011-09-062-8/+4
| | | | | | | | | | | Rewrite the loop walking the id array during probe. The new code is better adapted to a null-terminated array, and is also clearer and more efficient than the original. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Axel Lin <axel.lin@gmail.com> Cc: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: (max16065) Fix current calculationGuenter Roeck2011-09-061-1/+1
| | | | | | | | Current calculation is completely wrong. Add missing brackets to fix it. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Jean Delvare <khali@linux-fr.org> Cc: stable@kernel.org # 3.0+
* hwmon: (i5k_amb) Drop i5k_channel_pci_idJean Delvare2011-08-231-28/+14
| | | | | | | | | | Function i5k_channel_pci_id looks like it can fail, while a better code design would make it more obvious that it can't. We can even get rid of the function. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: (ntc_thermistor) Simplify if sequenceGuenter Roeck2011-08-221-2/+1
| | | | | | | | | | | | | | | | | | | | Replace unnecessary if with else statement. This fixes the following (false) compile warning reported with some combinations of C compiler version and configuration. drivers/hwmon/ntc_thermistor.c: In function 'ntc_show_temp': drivers/hwmon/ntc_thermistor.c:225: warning: 'low' may be used uninitialized in this function drivers/hwmon/ntc_thermistor.c:225: note: 'low' was declared here drivers/hwmon/ntc_thermistor.c:225: warning: 'high' may be used uninitialized in this function drivers/hwmon/ntc_thermistor.c:225: note: 'high' was declared here drivers/hwmon/ntc_thermistor.c:294: warning: 'temp' may be used uninitialized in this function Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Jean Delvare <khali@linux-fr.org>
OpenPOWER on IntegriCloud