summaryrefslogtreecommitdiff
path: root/drivers/hwmon/w83627ehf.c
AgeCommit message (Collapse)Author
2011-11-11hwmon: (w83627ehf) Fix broken driver initGuenter Roeck
commit bfa02b0da66965caf46e441270af87edda4fea14 upstream. Commit 2265cef2 (hwmon: (w83627ehf) Properly report PECI and AMD-SI sensor types) results in kernel panic if data->temp_label was not initialized. The problem was found with chip W83627DHG-P. Add check if data->temp->label was set before use. Based on incomplete patch by Alexander Beregalov. Reported-by: Alexander Beregalov <a.beregalov@gmail.com> Tested-by: Alexander Beregalov <a.beregalov@gmail.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-11hwmon: (w83627ehf) Properly report PECI and AMD-SI sensor typesJean Delvare
commit 2265cef2751b3441df91f85e0107f9f549e5b711 upstream. When temperature sources are PECI or AMD-SI agents, it makes no sense to report their type as diode or thermistor. Instead we must report their digital nature. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-25hwmon: (w83627ehf) Fix negative 8-bit temperature valuesJean Delvare
commit 133d324d82e144588939ad25b732b5b6c33b03d9 upstream. 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> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-25hwmon: (w83627ehf) Properly report thermal diode sensorsJean Delvare
commit bf164c58e58328c40ebc597a8ac00cc6840f9703 upstream. 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> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-14hwmon: (w83627ehf) Display correct temperature sensor labels for systems ↵Guenter Roeck
with NCT6775F Systems with NCT6775F reported temperature sensor labels for systems with NCT6776F. This patch fixes the problem. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-03-14hwmon: (w83627ehf) Add fan debounce support for NCT6775F and NCT6776FIan Dobson
NCT6776F and NCT6775F support debouncing the fan RPM signal. This can help improve the stability of th RPM signal for some fans (Arctic cooling fans for example). This patch adds a module parameter fan_debounce, which when set to 1 enables debounce for all fans that the chip supports. Signed-off-by: Ian Dobson <i.dobson@planet-ian.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-03-14hwmon: (w83627ehf) Store rpm instead of raw fan speed dataGuenter Roeck
Since the fan speed value can be above 0xff, we can no longer use that value to determine if the fan speed reading is valid. This makes it difficult to manipulate the stored fan speed register value. If we store rpm instead of the fan speed register value, we do not need to correct it if the fan divisor value is changed, and the above mentioned problem no longer exists. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Ian Dobson <i.dobson@planet-ian.com>
2011-03-14hwmon: (w83627ehf) Use 16 bit fan count registers if supportedGuenter Roeck
Some of the chips supported by this driver have 13 bit or 16 bit fan count registers. This patch improves support for those registers, specifically for NCT6775F. With the changes in this patch, fan speed is reported correctly even if the fan divider is set to a low value, which results in a fan speed reading above 0xff. With this patch, the width of fan count registers is no longer used to determine if the chip has fan divider register(s) or not. A dedicated flag is used instead to determine if this is the case. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Ian Dobson <i.dobson@planet-ian.com>
2011-03-14hwmon: (w83627ehf) Add support for Nuvoton NCT6775F and NCT6776FGuenter Roeck
This patch adds support for NCT6775F and NCT6776F to the w83627ehf driver. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Tested-by: Ian Dobson <i.dobson@planet-ian.com> (NCT6776F) Tested-by: Zachary Marzec <zmarzec@gmail.com> (ASUS P8P67 PRO/NCT6776F) Acked-by: Ian Dobson <i.dobson@planet-ian.com>
2011-03-14hwmon: (w83627ehf) Permit enabling SmartFan IV mode if configured at startupGuenter Roeck
If SmartFan IV mode was configured at startup, it should be possible to re-enable it later on. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Ian Dobson <i.dobson@planet-ian.com>
2011-03-14hwmon: (w83627ehf) Convert register arrays to 16 bit, and convert access to ↵Guenter Roeck
pointers For newer chips, several registers are banked and thus need to be 16 bit. Also, register addresses change. To prepare for those chips, convert affected register arrays to 16 bit, and change access to those registers to array pointers in struct w83627ehf_data. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Ian Dobson <i.dobson@planet-ian.com>
2011-03-14hwmon: (w83627ehf) Improve support for W83667HG-BGuenter Roeck
Add support for 4th temperature sensor on W83677HG-B. Display temperature labels on W83677HG-B to report temperature sources. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Ian Dobson <i.dobson@planet-ian.com>
2011-03-14hwmon: (w83627ehf) Optimize multi-bank register accessGuenter Roeck
Assume that each register is banked, and set the bank for each access. Cache the bank number so it only needs to be set if it changes. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Ian Dobson <i.dobson@planet-ian.com>
2011-03-14hwmon: (w83627ehf) Fixed most checkpatch warnings and errorsGuenter Roeck
This cleanup fixes most of the checkpatch warnings and errors in the w83627ehf driver. Remaining warnings and errors are left untouched on purpose to avoid making the code less readable. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Ian Dobson <i.dobson@planet-ian.com>
2011-03-14hwmon: (w83627ehf) Unify temperature register access, and use strict string ↵Guenter Roeck
conversions This patch unifies temperature register access, and replaces simple_strtoXXX with strict_strtoXXX throughout the driver. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Ian Dobson <i.dobson@planet-ian.com>
2011-01-08hwmon: (w83627ehf) Use pr_fmt and pr_<level>Joe Perches
Added #define pr_fmt KBUILD_MODNAME ": " fmt Converted printks to pr_<level> Coalesced any long formats Removed prefixes from formats Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-09-17hwmon: (w83627ehf) Use proper exit sequenceJonas Jonsson
According to the datasheet for Winbond W83627DHG the proper way to exit the Extended Function Mode is to write 0xaa to the EFER(0x2e or 0x4e). Signed-off-by: Jonas Jonsson <jonas@ludd.ltu.se> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-08-14hwmon: (w83627ehf) Add support for W83667HG-BGuenter Roeck
Add support for W83667HG-B (very similar to the W83667HG). Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-08-14hwmon: (w83627ehf) Driver cleanupGuenter Roeck
- Moved fan pwm register array pointers into per-instance data. - Only read fan pwm data for installed/supported fans. - Update fan max output and fan step output information from data in registers. - Create max_output and step_output attribute files only if respective fan pwm registers exist. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-15hwmon: w83627ehf updatesDaniel J Blueman
Add control of fan minimum turn-on output levels, decoupling it from the fan turn-off output level. Add control of rate of change of fan output level. These in turn allow lower turn-off rotor speed and smoother transitions for better thermal and acoustic control authority. Add support for constant fan speed and proportional-response operations modes. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Daniel J Blueman <daniel.blueman@gmail.com> Cc: Jean Delvare <khali@linux-fr.org> Cc: David Hubbard <david.c.hubbard@gmail.com> Cc: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-15hwmon: Include <linux/io.h> instead of <asm/io.h>H Hartley Sweeten
Drivers should be including <linux/io.h> instead of <asm/io.h>. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Alistair John Strachan <alistair@devzero.co.uk> Cc: Nicolas Boichat <nicolas@boichat.ch> Cc: Juerg Haefliger <juergh@gmail.com> Cc: Frank Seidel <frank@f-seidel.de> Acked-by: Jim Cromie <jim.cromie@gmail.com> Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> Cc: Roger Lucas <vt8231@hiddenengine.co.uk> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-06-15hwmon: (w83627ehf) Add W83627DHG-P supportJean Delvare
Add support for the new incarnation of the Winbond/Nuvoton W83627DHG chip known as W83627DHG-P. It is basically the same as the original W83627DHG with an additional automatic can speed control mode (not supported by the driver yet.) Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Madhu <madhu.chinakonda@gmail.com>
2009-03-30hwmon: (w83627ehf) Only expose in6 or temp3 on the W83667HGGong Jun
The pin for in6 and temp3 is shared on the W83667HG, so only one of these features can be supported on any given system. Let the driver select which one depending on the temp3 disabled bit. Signed-off-by: Gong Jun <JGong@nuvoton.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-03-30hwmon: (w83627ehf) Add support for W83667HGGong Jun
Add initial support for the Nuvoton W83667HG chip to the w83627ehf driver. It has been tested on ASUS P5QL PRO by Gong Jun. At the moment there is still a usability issue which is that only in6 or temp3 can be present on the W83667HG, so the driver shouldn't expose both. This will be addressed later. Signed-off-by: Gong Jun <JGong@nuvoton.com> Acked-by: David Hubbard <david.c.hubbard@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-03-30hwmon: (w83627ehf) Invert fan pin variables logicJean Delvare
Use positive logic for fan pin variables (variable is set if pin is used for fan), instead of negative logic which is error prone. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Gong Jun <JGong@nuvoton.com>
2009-02-17hwmon: Fix ACPI resource check error handlingHans de Goede
This patch fixes a number of cases where things were not properly cleaned up when acpi_check_resource_conflict() returned an error, causing oopses such as the one reported here: https://bugzilla.redhat.com/show_bug.cgi?id=483208 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07hwmon: Fix various typosJean Delvare
Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Acked-by: David Hubbard <david.c.hubbard@gmail.com>
2009-01-07hwmon: Check for ACPI resource conflictsJean Delvare
Check for ACPI resource conflicts in hwmon drivers. I've included all Super-I/O and PCI drivers. I've voluntarily left out: * Vendor-specific drivers: if they conflicted on any system, this would pretty much mean that they conflict on all systems, and we would know by now. * Legacy ISA drivers (lm78 and w83781d): they only support chips found on old designs were ACPI either wasn't supported or didn't deal with thermal management. * Drivers accessing the I/O resources indirectly (e.g. through SMBus): the checks are already done where they belong, i.e. in the bus drivers. Signed-off-by: Jean Delvare <jdelvare@suse.de> Acked-by: David Hubbard <david.c.hubbard@gmail.com>
2008-02-07hwmon: (w83627ehf) The W83627DHG has 8 VID pinsJean Delvare
While the W83627EHF/EHG has only 6 VID pins, the W83627DHG has 8 VID pins, to support VRD 11.0. Add support for this. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-07hwmon: Let the user override the detected Super-I/O device IDJean Delvare
While it is possible to force SMBus-based hardware monitoring chip drivers to drive a not officially supported device, we do not have this possibility for Super-I/O-based drivers. That's unfortunate because sometimes newer chips are fully compatible and just forcing the driver to load would work. Instead of that we have to tell the users to recompile the kernel driver, which isn't an easy task for everyone. So, I propose that we add a module parameter to all Super-I/O based hardware monitoring drivers, letting advanced users force the driver to load on their machine. The user has to provide the device ID of a supposedly compatible device. This requires looking at the source code or a datasheet, so I am confident that users can't randomly force a driver without knowing what they are doing. Thus this should be relatively safe. As you can see from the code, the implementation is pretty simple and unintrusive. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Hans de Goede <j.w.r.degoede@hhs.nl> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-01-03hwmon: (w83627ehf) Be more careful when changing VID input levelJean Delvare
The VID input level change has been reported to cause trouble. Be more careful in this respect: * Only change the level on the W83627EHF/EHG. The W83627DHG is more complex in this respect. * Don't change the level if the VID pins are in output mode. * Only set the level to TTL if VRM 9.x is used. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-10-09hwmon: Convert from class_device to deviceTony Jones
Convert from class_device to device for hwmon_device_register/unregister Signed-off-by: Tony Jones <tonyj@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-10-09hwmon: Allow writing of negative trigger temperaturesChristian Hohnstaedt
- replace differing temperature variable types by long - use strtol() instead of strtoul() for conversion Signed-off-by: Christian Hohnstaedt <chohnstaedt@innominate.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-08-12hwmon: (w83627ehf) don't assume bank 0Jean Delvare
Don't assume that the default bank is 0. For one thing, we don't even set it to 0 when the driver is loaded, so the initial state might be different. For another, something (say, the BIOS) might access the chip and leave with the bank set to something different, so assuming that the bank value is 0 is not safe. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-08-12hwmon: (w83627ehf) read fan_div values during probeMark M. Hoffman
This patch forces the driver to read the fan divider values during early init. Otherwise, a call to store_fan_min() could access uninitialized variables. Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-07-19hwmon/w83627ehf: Be quiet when no chip is foundJean Delvare
This fixes bug #8593: http://bugzilla.kernel.org/show_bug.cgi?id=8593 Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-07-19hwmon/w83627ehf: No need to initialize fan_minJean Delvare
We don't need to initialize fan_min in this driver, as the fan_div attributes are read-only. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-07-19hwmon/w83627ehf: Export the thermal sensor typesJean Delvare
Add support for the w83627ehf thermal sensor types. I made them read-only, as the BIOS is supposed to set them up properly. This information makes it easier to find out which temperature channel corresponds to the CPU. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-07-19hwmon/w83627ehf: Enable VBAT monitoringJean Delvare
If VBAT monitoring is disabled, enable it. Original patch from an anonymous contributor on the lm-sensors trac system: http://lm-sensors.org/ticket/2218 Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-07-19hwmon/w83627ehf: Add support for the VID inputsJean Delvare
The W83627EHF and similar chips have 6 VID input pins, add support for them. The driver changes the input voltage level automatically if the current setting is not correct for the detected CPU model. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-07-19hwmon/w83627ehf: Fix timing issuesJean Delvare
* I have experimental evidence that the W83627EHG needs more than 1 second to refresh all the measured values. Increase the caching time to 1.5 second. * When changing a fan clock divider, the corresponding fan speed measurement register is no longer valid, until the next time the chip will refresh it. One way to fix this is to pretend that the cache is still valid for one more period (1.5 second.) Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-07-19hwmon/w83627ehf: Add error messages for two error casesDavid Hubbard
If the Super-I/O device is disabled, it is likely the BIOS has a good reason for leaving it disabled, so give a warning when enabling it -- it's not likely to be wired correctly or be able to give good data. Also, if the Super-I/O device is configured with an address of 0, the driver refuses to initialize it. Signed-off-by: David Hubbard <david.c.hubbard@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-07-19hwmon/w83627ehf: Convert to a platform driverDavid Hubbard
Remove i2c-isa from the w83627ehf driver, and use a platform driver instead. Signed-off-by: David Hubbard <david.c.hubbard@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-07-19hwmon/w83627ehf: Preserve speed reading when changing fan minJean Delvare
The w83627ehf driver changes the fan clock divider automatically when a new min fan speed is set. It is supposed to preserve the fan speed reading while doing so, bug doesn't really. Fix it. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-04-24hwmon/w83627ehf: Don't redefine REGION_OFFSETJean Delvare
On ia64, kernel headers define REGION_OFFSET so we can't use that. Reported by Andrew Morton. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: David Hubbard <david.c.hubbard@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-04-17hwmon/w83627ehf: Fix the fan5 clock divider writeJean Delvare
Users have been complaining about the w83627ehf driver flooding their logs with debug messages like: w83627ehf 9191-0a10: Increasing fan 4 clock divider from 64 to 128 or: w83627ehf 9191-0290: Increasing fan 4 clock divider from 4 to 8 The reason is that we failed to actually write the LSB of the encoded clock divider value for that fan, causing the next read to report the same old value again and again. Additionally, the fan number was improperly reported, making the bug harder to find. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-14hwmon/w83627ehf: Add support for the W83627DHG chipDavid Hubbard
Signed-off-by: David Hubbard <david.c.hubbard@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2006-12-12hwmon: Update Rudolf Marek's e-mail addressJean Delvare
The Silicon Hill club is not what it used to be. Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2006-10-18w83627ehf: Fix the detection of fan5Rudolf Marek
Fix the detection of fan5 and preserve the bit between the register writes, because the bit is write only. Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-28hwmon: Remove Yuan Mu's addressJean Delvare
hwmon: Remove Yuan Mu's address Yuan Mu no longer works at Winbond. I wish to publicly thank Yuan for his help with Winbond hardware monitoring chips support during the past 10 months. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>