summaryrefslogtreecommitdiff
path: root/drivers/hwmon
AgeCommit message (Collapse)AuthorFilesLines
2008-02-08hwmon: (adm1031) Add individual alarm and fault filesJean Delvare1-0/+38
The new libsensors needs these. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (adm1031) Get rid of macro-generated wrappersJean Delvare1-193/+132
Use the standard dynamic sysfs callbacks instead of macro-generated wrappers. It makes the code more simple and the binary smaller (-8% on my system.) Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (adm1031) Various cleanupsJean Delvare1-64/+62
* Rename new_client to client * Drop redundant initializations to 0 * Drop trailing space * Other whitespace cleanups * Split/fold a few long lines * Constify static data * Optimizations in set_fan_div() Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (adm1031) Fix register overwrite in set_fan_div()Jean Delvare1-2/+10
Don't rely on the register cache when setting a new fan clock divider. For one thing, the cache might not have been initialized at all if the driver has just been loaded. For another, the cached values may be old and you never know what can happen in the driver's back. Also invalidate the cache instead of trying to adjust the measured fan speed: the whole point of changing the clock divider is to get a better reading. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (it87) Delete pwmN_freq files on driver removalJean Delvare1-0/+3
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: (w83781d) Misc cleanupsJean Delvare1-9/+4
* Drop unused defines * Drop unused driver ID * Remove trailing whitespace Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (w83781d) Drop W83627HF supportJean Delvare2-27/+8
The W83627HF hardware monitoring features are supported by the w83627hf driver for several years now. Support by the w83781d has been advertised as deprecated 6 months ago, it's about time to see it go. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (adm1026) Don't create files for missing inputsJean Delvare1-20/+50
On the ADM1026, pins 27 and 28 can be used for two different functions: either temp3, or in8+in9. We should only create the sysfs files for the function that is configured, otherwise it is confusing for the user. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (adm1026) More cleanups (updated)Jean Delvare1-31/+21
Various cleanups: * Drop an unused define. * Drop unused struct member "type". * Drop one useless instruction. * Drop redundant initializations to 0. * Rename new_client to client. * Drop a useless cast. * Minor code cleanup. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (adm1026) Whitespace cleanupsJean Delvare1-224/+227
Whitespace cleanups only: * Trim trailing whitespace. * Use tabs for indentation and alignment. * Add missing space after commas. * Remove extra spaces. No functional change, binary is identical before and after this patch. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (adm1026) Add individual alarm filesJean Delvare1-0/+65
The new libsensors needs these. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (it87) Add individual alarm filesJean Delvare1-9/+66
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 Delvare1-2/+2
Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (adt7470) Support per-sensor alarm filesDarrick J. Wong1-12/+84
Remove the old alarms hack and replace it with per-sensor alarm files. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (fschmd) Read voltage scaling factors from BIOS DMIHans de Goede1-2/+88
This patch adds support to the fschmd driver for reading the voltage scaling factors from BIOS DMI tables, as specified in the Siemens datasheet. Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl> Acked-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 Delvare11-12/+61
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-02-08hwmon: (vt8231) Add missing "space"Joe Perches1-1/+1
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (gl520sm) Add individual alarm and beep filesJean Delvare1-2/+89
libsensors 3.0 needs these. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (gl520sm) De-macro the sysfs callbacksJean Delvare1-169/+239
Use standard dynamic sysfs callbacks instead of macro-generated wrappers. This makes the code more readable, and the binary smaller (by about 11%). Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (gl520sm) Put register addresses in arraysJean Delvare1-64/+40
This allows for some code refactoring, making the binary slightly smaller. This is also required to use dynamic sysfs callbacks for voltage and temperature files. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (gl520sm) Various cleanupsJean Delvare1-33/+30
* Drop trailing spaces * Drop unused driver ID * Drop stray backslashes in macros * Rename new_client to client * Drop redundant initializations to 0 Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (lm90) Use generic i2c reads during detectionJean Delvare1-13/+13
As indirectly reported by Olof Johansson, the lm90 driver uses a custom i2c read function even during detection, at which point we don't know yet what device we're talking with. It would make more sense to only use the generic i2c read function at this point, so that we don't log irrelevant errors on misdetection. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (gl518sm) Fix the reported fan speedJean Delvare1-3/+3
The fan speeds reported by the gl518sm driver are twice as much as they should. It's currently reporting the number of pulses per minute, not rotations per minute, while typical fans emit two pulses per rotation. This explains why all reports with this driver had very high speed values (between 9000 to 12000 RPM). Odd that nobody ever actually complained about this bug. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (gl518sm) Report error on invalid fan div valueJean Delvare1-2/+12
If the user attempts to write a fan clock divider not supported by the chip, an error should be returned. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (gl518sm) Add individual alarm and beep filesJean Delvare1-0/+69
The new libsensors needs these. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (gl518sm) Refactor fan functionsJean Delvare1-50/+60
This makes the code more readable and the binary smaller (by 5% or so). Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (gl518sm) Don't create sysfs files for missing featuresJean Delvare1-4/+19
The early revisions of the GL518SM do not report voltage values for the first 3 voltage channels. We should not create sysfs attributes for these missing features. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (gl518sm) Various cleanupsJean Delvare1-30/+19
* Drop history, it doesn't belong there * Drop unused struct member * Drop bogus struct member comment * Drop unused driver ID * Rename new_client to client * Drop redundant initializations to 0 * Drop useless cast * Drop trailing space * Fix comment * Drop duplicate comment Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (fschmd) Discard non-ASCII charactersJean Delvare1-2/+2
Somehow non-ASCII characters managed to sneak into the fschmd driver. Kick them out. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Hans de Goede <j.w.r.degoede@hhs.nl> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (adm1025) Various cleanupsJean Delvare1-44/+36
* Whitespace cleanups * Constify scaling constants * Fold long lines * Drop redundant initializations to 0 * Rename new_client to just client * Use sysfs_create_group() * Drop a useless comment Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (adm1025) Add individual alarm filesJean Delvare1-1/+29
The future libsensors needs these individual alarm and fault files. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (adm1025) Use dynamic sysfs callbacksJean Delvare1-137/+154
This lets us get rid of macro-generated functions and shrinks the driver size by about 30%. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (lm87) Add support for the Analog Devices ADM1024Jean Delvare2-8/+21
It happens that the Analog Devices ADM1024 is fully compatible with the National Semiconductor LM87, so support for the former can easily be added to the lm87 driver. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: Add support for Winbond W83L786NG/NRKevin Lo3-0/+832
Signed-off-by: Kevin Lo <kevlo@kevlo.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (adt7470) Replace power-of-two testRobert P. J. Day1-3/+1
Since <linux/log2.h> already supplies a power-of-two test, there's no point in having this source file redefine it again. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (w83793) remove duplicated definesNicolas Kaiser1-4/+1
Remove duplicated defines. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-08hwmon: (lm78/w83781d) Probe fewer I2C addressesJean Delvare2-8/+5
We've never seen any device supported by the lm78 or w83781d driver at addresses 0x20-0x27, so let's stop probing these addresses. Extra probes cost time, and have potential for confusing or misdetecting other I2C devices. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-07leds: Standardise LED naming schemeRichard Purdie1-1/+1
As discussed on LKML some notion of 'function' is needed in LED naming. This patch adds this to the documentation and standardises existing LED drivers. Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
2008-01-22hwmon: (it87) request only Environment Controller portsBjorn Helgaas1-9/+23
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>
2008-01-03hwmon: (w83627ehf) Be more careful when changing VID input levelJean Delvare1-14/+22
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-12-04HWMON: coretemp, suspend fixRafael J. Wysocki1-3/+2
It's not permitted to unregister a device after devices have been suspended. It causes deadlocks to appear on systems with coretemp hwmon loaded.  To avoid this, we can make coretemp_cpu_callback() do nothing if the _FROZEN bit is set in action.   Also, in other cases it's generally too late to unregister the coretemp device if the CPU is already dead, so it should be unregistered on CPU_DOWN_PREPARE.   Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Mark M. Hoffman <mhoffman@lightlink.com> Cc: Jiri Slaby <jirislaby@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-08hwmon: (i5k_amb) Convert macros to C functionsDarrick J. Wong1-22/+43
akpm objected to some of the macros, so convert them into functions. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-11-08hwmon: (w83781d) Add missing curly bracesJean Delvare1-1/+2
Missing curly braces cause an if statement to be evaluated when it shouldn't. It happens to be harmless, but that's still worth fixing. Thanks to Riku Voipio for reporting. 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>
2007-11-08hwmon: (abituguru3) Identify ABit IP35 Pro as suchHans de Goede1-1/+1
This patch changes the identification string for motherboards with an id of 0x001A from unknown to "Abit IP35 Pro". Thanks to James Scott who has an Abit IP35 Pro. Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-11-08hwmon: (f75375s) pwmX_mode sysfs files writable for f75375 variantRiku Voipio1-3/+16
Fix value check in set_pwm_mode(). Instead of checking for chip variant there, make pwmX_mode sysfs nodes only writable on f75375 variant. Signed-off-by: Riku Voipio <riku.voipio@movial.fi> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-11-08hwmon: (f75375s) Allow setting up fans with platform_dataRiku Voipio1-7/+35
Allow initializing fans on systems where BIOS does not do that by default. - define f75375s_platform_data in new file f75375s.h - if platform_data was provided, set fans accordingly in f75375_init() - split set_pwm_enable() to a sysfs callback and directly usable set_pwm_enable_direct() Signed-off-by: Riku Voipio <riku.voipio@movial.fi> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-11-08hwmon: (f75375s) Add new style bindingsRiku Voipio1-26/+83
Following the example of David Brownell's work on lm75: - Create a second driver struct, using new-style driver binding methods. - Rename the old driver struct as f75375_legacy_driver. - Make the legacy bind/unbind logic delegate all its work. Signed-off-by: Riku Voipio <riku.voipio@movial.fi> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-11-08hwmon: (lm70) Convert semaphore to mutexMatthias Kaehlcke1-5/+6
Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-11-08hwmon: (applesmc) Add support for Mac Pro 2 x Quad-CoreRené Rebe1-6/+101
At least the 2x Quad-Core Apple Mac Pro appears to have some over-heat protection which suddenly powers off the whole box under load. This adds support for the fans and temerature sensors in the Mac Pro - later some "windwarm" a-like code should probably monitor the values. For now manually tweaking the fans prevents the sudden shutdown for me. cd /sys/devices/platform/applesmc.768 for x in fan{1,2,3,4}; do echo 1 > ${x}_manual echo 1285 > ${x}_output done Two sensors are 0, while four are 129 °C, those might be removed again, later. Signed-off-by: René Rebe <rene@exactcode.de> Cc: Nicolas Boichat <nicolas@boichat.ch> Cc: Jean Delvare <khali@linux-fr.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-11-08hwmon: (abituguru3) Add support for 2 new motherboardsHans de Goede1-0/+54
Signed-of-by: Hans de Goede <j.w.r.degoede@hhs.nl> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>