summaryrefslogtreecommitdiff
path: root/drivers/hwmon/it87.c
AgeCommit message (Collapse)Author
2010-04-14hwmon: (it87) Invalidate cache on temperature sensor changeJean Delvare
When any temperature sensor type is changed, the corresponding temperature value needs to be updated. The register caching mechanism may delay this update, so we want to invalidate the cache to force an immediate update. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-04-14hwmon: (it87) Properly handle wrong sensor type requestsJean Delvare
Currently, if someone tries to set the thermal sensor type to an unsupported value, subsequent accesses to the chip may temporarily show the sensor in question as disabled. Use a temporary variable and only update the cached value on success, to prevent such confusion. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-04-14hwmon: (it87) Don't arbitrarily enable temperature channelsJean Delvare
Temperature channels can be used in 2 different modes (thermistor and thermal diode) and we don't know which one, if any, is correct for every given board. So don't arbitrarily choose one. Instead, leave the temperature channels untouched. They can be configured from user-space if needed anyway. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-03-05hwmon: (it87) Validate auto pwm settingsJean Delvare
Before switching to automatic fan control mode, make sure that all the trip points make sense. Otherwise, the control loop could lead to weird fan behavior. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-03-05hwmon: (it87) Add support for old automatic fan speed controlJean Delvare
Add support for the automatic fan speed control interface as implemented by IT8705F chips up to revision F and IT8712F chips up to revision G. This implementation fits very well in our standard sysfs interface. I implemented the old and not the new interface because the only chip I have at hand is an old one, and the new interface is more difficult to map to the standard sysfs interface. Adding support later should be possible though, if someone with a supported chip is interested. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-03-05hwmon: (it87) Use strict_strtol instead of simple_strtolJean Delvare
For consistency and robustness, use strict_strtol instead of simple_strtol. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-03-05hwmon: (it87) Fix many checkpatch errors and warningsJean Delvare
Fix 20 errors and 11 warnings reported by the checkpatch script. The remainining errors would require more work. The remaining warnings will be addressed later. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-03-05hwmon: (it87) Add support for beep on alarmJean Delvare
The IT87xxF chips support beeping on alarm, if properly wired and configured. There is one control bit for each input type (temperature, fan, voltage.) Let the user see and change them. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-03-05hwmon: (it87) Create vid attributes by groupJean Delvare
Only VID-related attributes are left in it87_attributes_opt, so we might as well rename it to it87_attributes_vid and use this group to create all attributes at once. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-03-05hwmon: (it87) Refactor attributes creation and removalJean Delvare
There is a lot of code redundancy in the creation of the fan and pwm attributes. Move these attributes to arrays so that the code can be simplified. This in turns makes the attributes removal code larger, so move it to a separate function that can be called in both the standard removal case and the error path during probing. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-03-05hwmon: (it87) Expose the PWM/temperature mappingsJean Delvare
Let the user read the PWM-to-temperature mappings. Until the trip points are also exposed, this is essentially a way to know how the BIOS has set things up. The ability to change the settings will be added later, together with the trip points. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-03-05hwmon: (it87) Display fan outputs in automatic mode as suchJean Delvare
The it87 driver doesn't yet support automatic fan control. Let it at least tell the user when a fan output is in automatic mode. Also let the user switch from automatic mode (possibly set by the BIOS) to manual mode and back without losing the settings. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-09hwmon: (it87) Check for fan2 and fan3 availabilityJean Delvare
The fan2 and fan3 input and output pins can be used as GPIOs. Check their function before exposing their sysfs attributes and accessing their registers. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-09hwmon: (it87) Verify the VID pin usageJean Delvare
The VID input pins can alternatively be used as GPIOs. Make sure we have at least 4 pins used for VID, otherwise don't bother reading and exposing VID. Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Adam Nielsen <a.nielsen@shikadi.net>
2009-10-24hwmon: (it87) Fix VID reading on IT8718F/IT8720FJean Delvare
Comparing apples to bananas doesn't seem right. Consistently use the chips enum for chip type comparisons, to avoid such bugs in the future. The bug has been there since support for the IT8718F was added, so VID never worked for this chip nor for the similar IT8720F. Signed-off-by: Jean Delvare <khali@linux-fr.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-03-12hwmon: (it87) Properly decode -128 degrees C temperatureJean Delvare
The it87 driver is reporting -128 degrees C as +128 degrees C. That's not a terribly likely temperature value but let's still get it right, especially when it simplifies the code. 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>
2009-01-07hwmon: (it87) Add support for the ITE IT8720FJean-Marc Spaggiari
Allow it87.c to handle IT8720 chipset like IT8718 in order to retrieve voltage, temperatures and fans speed from sensors tools. Also updating the related documentation. Signed-off-by: Jean-Marc Spaggiari <jean-marc@spaggiari.org> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-10-17hwmon: (it87) Fix thermal sensor type valuesJean Delvare
The it87 driver doesn't follow the standard sensor type values as documented in Documentation/hwmon/sysfs-interface. It uses value 2 for thermistors instead of value 4. This causes "sensors" to tell the user that the chip is setup for a transistor while it is actually setup for a thermistor. Using value 4 for thermistors solves the problem. For compatibility reasons, we still accept value 2 but emit a warning message so that users update their configuration files. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Hans de Goede <hdegoede@redhat.com>
2008-10-09hwmon: (it87) Prevent power-off on Shuttle SN68PTJean Delvare
On the Shuttle SN68PT, FAN_CTL2 is apparently not connected to a fan, but to something else. One user has reported instant system power-off when changing the PWM2 duty cycle, so we disable it. I use the board name string as the trigger in case the same board is ever used in other systems. This closes lm-sensors ticket #2349: pwmconfig causes a hard poweroff http://www.lm-sensors.org/ticket/2349 Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-09-20hwmon: (it87) Fix fan tachometer reading in IT8712F rev 0x7 (I)Andrew Paprocki
The IT8712F v0.9.1 datasheet applies to revisions >= 0x8 (J). The driver was incorrectly attempting to enable 16-bit fan readings on rev 0x7 (I) which led to incorrect RPM values. Signed-off-by: Andrew Paprocki <andrew@ishiboo.com> Tested-by: John Gumb <john.gumb@tandberg.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-08-06hwmon: (it87) Support for 16-bit fan reading in it8705 >= rev 0x03Andrew Paprocki
The it8705 chip supports 16-bit fan tachometers in revisions at least >= 0x03 (Version G). This patch enables 16-bit fan readings on all revisions >= 0x03 just like the it8712, it8716, and it8718 chips. Signed-off-by: Andrew Paprocki <andrew@ishiboo.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-08-06hwmon: (it87) Support for 16-bit fan reading in it8712 >= rev 0x07Andrew Paprocki
The it8712 chip supports 16-bit fan tachometers in revisions >= 0x07. Revisions >= 0x08 dropped support for 8-bit fan divisor registers. The patch enables 16-bit fan readings on all revisions >= 0x07 just like the it8716 and it8718 chips. Signed-off-by: Andrew Paprocki <andrew@ishiboo.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-02-08hwmon: (it87) Delete pwmN_freq files on driver removalJean Delvare
In commit f8d0c19a93cea3a26a90f2462295e1e01a4cd250 I forgot to delete the pwmN_freq files on driver removal, here's the fix. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Riku Voipio <riku.voipio@movial.fi> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (it87) Add individual alarm filesJean Delvare
The new libsensors needs this. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (it87) Discard a dead e-mail addressJean Delvare
Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: 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-22hwmon: (it87) request only Environment Controller portsBjorn Helgaas
The IT8705F and related parts are Super I/O controllers that contain many separate devices. Some BIOSes describe IT8705F I/O port usage under a motherboard device (PNP0C02) with overlapping regions, e.g., 0x290-0x29f and 0x290-0x294. The it87 driver supports only the Environment Controller, which requires only two ISA ports, but it used to request an eight-port range. If that range exceeds a range reported by the BIOS, as 0x290-0x297 would, the request fails, and the it87 driver cannot claim the device. This patch makes the it87 driver request only the two ports used for the Environment Controller device. Systems where this problem has been reported: Gigabyte GA-K8N Ultra 9 Gigabyte M56S-S3 Gigabyte GA-965G-DS3 Kernel bug reports: http://bugzilla.kernel.org/show_bug.cgi?id=9514 http://lkml.org/lkml/2007/12/4/466 Related change: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=a7839e960675b549f06209d18283d5cee2ce9261 The patch above increases the number of PNP port resources we support. Prior to this patch, we ignored some port resources, which masked the it87 problem. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-10-10hwmon: VRM is not read from registersJean Delvare
The VRM value is not read from chip registers, so there's no need to update the device data cache before exporting the VRM value to user-space. 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>
2007-10-10hwmon: (it87) Add support for fan4 and fan5Jean Delvare
Add support for the IT8716F and IT8718F fan4 and fan5. The late revisions of the IT8712F have these too but support is harder to add and nobody asked for it yet, so I didn't include it. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-10-10hwmon: 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-07-31hwmon: Add missing __devexit tags in various driversJean Delvare
On Sun, 22 Jul 2007 00:30:56 +0200, Gabriel C wrote: > I noticed this warnings on current git: > > drivers/hwmon/pc87360.c:1082: warning: 'pc87360_remove' defined but not used > drivers/hwmon/sis5595.c:580: warning: 'sis5595_remove' defined but not used > drivers/hwmon/smsc47m1.c:608: warning: 'smsc47m1_remove' defined but not used > drivers/hwmon/via686a.c:648: warning: 'via686a_remove' defined but not used > drivers/hwmon/vt8231.c:755: warning: 'vt8231_remove' defined but not used Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-07-19hwmon: convert it87 to platform drivercorentin.labbe
This is the patch for converting it87 to a platform driver (and remove i2c-isa). Signed-off-by: Corentin LABBE <corentin.labbe@geomatys.fr> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-07-19hwmon/it87: Add IT8726F supportRudolf Marek
Add support for IT8726F chip driver, which is just same as IT8716F with additional glue logic for AMD power sequencing. Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-02-14hwmon: Cleanup a bogus legacy commentJean Delvare
Cleanup a bogus legacy comment that has been replicated to many hardware monitoring drivers. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-02-14hwmon: Simplify the locking model of two driversJean Delvare
Many hardware monitoring drivers use two different mutexes, one to protect their per-device data structure, and one to protect the access to the device registers. These mutexes are essentially redundant, as the drivers are transfering values between the device registers and the data cache, so they almost always end up holding both mutexes at the same time. Using a single mutex will make the code more simple and faster. I am changing only two of the affected drivers here, the authors of the other affected drivers are welcome to submit similar patches if they want. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-02-14hwmon/it87: Add PWM base frequency controlJean Delvare
Let the user select the base PWM frequency when using the it87 hardware monitoring driver. Different frequencies can give better control on some fans. Also update the documentation to mention the PWM frequency control files, with misc cleanups to the PWM section. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2006-12-12hwmon/it87: Remove the SMBus interface supportJean Delvare
This interface was useless as the LPC ISA-like interface is always available, is faster, and is more reliable. This cuts the driver size by some 20%. This change is also required to later convert the it87 driver to a platform driver, so that we can get rid of i2c-isa in a near future. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2006-09-28Fix unchecked return status, batch 5Jean Delvare
hwmon: Fix unchecked return status, batch 5 Fix up some hwmon drivers so that they no longer ignore return status from device_create_file(). Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-28it87: Copyright updateJean Delvare
it87: Copyright update I think my contributions to the it87 driver over the past two years qualify me as a co-author of this driver. Also drop old comments of dubious usefulness. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-28it87: Overwrite broken default limitsJean Delvare
it87: Overwrite broken default limits Some IT8716F chips where seen with unreasonable defaults for low voltage and high temperature limits. Overwrite them with sane defaults so as to not generate meaningless alarms. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-28it87: Add support for the IT8718FJean Delvare
it87: Add support for the IT8718F The IT8718F is a Super-I/O chip with integrated hardware monitoring functions. It is very similar to the IT8716F, so adding support to the it87 driver was pretty straightforward. The most significant difference is that the IT8718F has up to 8 VID pins, instead of 6 for the older chips. For the IT8718F, the VID value can only be read from Super-I/O space. Userspace support is already in lm_sensors SVN (to be soon released as 2.10.1.) Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-28it87: Cleanup set_fan_divJean Delvare
it87: Cleanup set_fan_div We only change one fan clock divider at a time, so there is only one fan min which needs to be saved and restored. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-28it87: in8 has no limit registersJean Delvare
it87: in8 has no limit registers Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-28it87: Prevent overflow on fan clock divider writeJean Delvare
it87: Prevent overflow on fan clock divider write The highest possible clock divider for fan1 and fan2 is 128. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-28it87: No sysfs files for disabled fansJean Delvare
it87: No sysfs files for disabled fans Only create the fan attributes for enabled fan tachometers. Some motherboards have a nice BIOS which only enables the fan inputs which are wired to a fan header on the board. This makes the configuration easier for the user. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-28it87: Add support for the IT8716FJean Delvare
it87: Add support for the IT8716F The IT8716F is a Super-I/O chip with integrated hardware monitoring functions. It is very similar to the IT8712F, so adding support to the it87 driver was pretty straightforward. The most significant change here is that the IT8716F has 16-bit fan speed counters, so the user no more needs to tweak the fan clock dividers to get the best readings. Userspace support is already in lm_sensors SVN (to be soon released as 2.10.1.) Thanks to Stian Oksavik, Olivier Nicolas, Prakash Punnoor and Juergen Kilb for testing the early versions of this patch. Thanks also to ITE for providing datasheets and answering my questions. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-26i2c-isa: Restore driver ownerJean Delvare
i2c-isa: Restore driver owner Commit 2b48716d1d2f2edb1e7cbc5ecf1cb2cb39373e33 back in January 2006 was a bit overzealous. It removed .owner from all i2c drivers, including i2c-isa ones, while they still need it. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>