Commit Graph

740 Commits

Author SHA1 Message Date
Linus Torvalds 7e92214b53 Merge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
  hwmon: (abituguru3) Fix CONFIG_DMI=n fallback to probe
  hwmon: (abituguru3) Enable DMI probing feature on IN9 32X MAX
  hwmon: (abituguru3) Match partial DMI board name strings
  hwmon: Add a driver for the ADT7475 hardware monitoring chip
  hwmon: (k8temp) Fix temperature reporting for (most) K8 RevG CPUs
  hwmon: (k8temp) Fix wrong sensor selection for AMD K8 RevF/RevG CPUs
  hwmon: (k8temp) Warn about fam F rev F errata
2009-01-15 16:40:12 -08:00
Pavel Machek 9e1c9d8655 hp_accel: do not call ACPI from invalid context
The LED on HP notebooks is connected through ACPI.  That unfortunately
means that it needs to be delayed by using schedule_work() to avoid
calling the ACPI interpreter from an invalid context.

[akpm@linux-foundation.org: use flush_work() rather than sort-of reimplementing it]
Signed-off-by: Pavel Machek <pavel@suse.cz>
Cc: Éric Piel <eric.piel@tremplin-utc.net>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-15 16:39:41 -08:00
Eric Piel 9e0c797821 lis3lv02d: merge with leds hp disk
Move the second part of the HP laptop disk protection functionality (a red
led) to the same driver.  From a purely Linux developer's point of view,
the led and the accelerometer have nothing related.  However, they
correspond to the same ACPI functionality, and so will always be used
together, moreover as they share the same ACPI PNP alias, there is no
other simple to allow to have same loaded at the same time if they are not
in the same module.  Also make it requires the led class to compile and
update the Kconfig text.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-15 16:39:40 -08:00
Alex Murray c3d6362b87 hwmon: applesmc: fix light sensor readings on newer MacBooks
The light sensors ALV0 and ALV1 on newer MacBooks (early 2008 and later)
changed to report 10 bytes instead the earlier 6, and the sensor encoding
subsequently changed.  As a result, the reported light sensors readings
are much too low.

Via experiments leading up to this patch, it seems only the ALV0 is
reporting data, and the most useful value therein is a 10-bit big-endian
value at offset 6.  This suggests that a new protocol was added as a
backward-compatible replacement on top of the old one.

This patch makes applesmc report the improved light sensor reading for the
new machines, on a scale in conformance with earlier ones.

Signed-off-by: Alex Murray <murray.alex@gmail.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Cc: Nicolas Boichat <nicolas@boichat.ch>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-15 16:39:39 -08:00
Alistair John Strachan 46a5f173fc hwmon: (abituguru3) Fix CONFIG_DMI=n fallback to probe
When CONFIG_DMI is not enabled, dmi detection should flag that no board
could be detected (err=1) rather than another error condition (err<0).

This fixes the fallback to manual probing for all motherboards, even
those without DMI strings, when CONFIG_DMI=n.

Signed-off-by: Alistair John Strachan <alistair@devzero.co.uk>
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-15 22:27:48 +01:00
Alistair John Strachan 3907a8def7 hwmon: (abituguru3) Enable DMI probing feature on IN9 32X MAX
Switch the IN9 32X MAX over from port probing to the preferred DMI
probe method.

Signed-off-by: Alistair John Strachan <alistair@devzero.co.uk>
Tested-by: Paul Hartman <paul.hartman+gentoo@gmail.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-15 22:27:48 +01:00
Alistair John Strachan 058943ddcb hwmon: (abituguru3) Match partial DMI board name strings
The switch-over to using DMI board strings to identify abituguru3 compatible
mainboards works most of the time, but sometimes the vendor has substantially
modified the board string between BIOS revisions.

We have found that the vendor chipset identification string (provided in
brackets) changes frequently and is of no use to us. The rest of the board
string sometimes changes in subtle ways, e.g. whitespace or variations in
capitalization.

The new comparison code checks only a part of the supplied DMI board string,
trimming the bracketed content, whitespace, and ignoring case as necessary.

This fixes a bug where an IP35 Pro running an early BIOS would not be
detected without the force=1 module parameter, and also speculatively
fixes other similiar issues.

Signed-off-by: Alistair John Strachan <alistair@devzero.co.uk>
Reported-by: Nick Pasich <NewsLetters@nickandbarb.net>
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-15 22:27:47 +01:00
Jordan Crouse 1c301fc539 hwmon: Add a driver for the ADT7475 hardware monitoring chip
Hwmon driver for the ADT7475 chip.

Signed-off-by: Jordan Crouse <jordan.crouse@amd.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-15 22:27:47 +01:00
Andreas Herrmann 76ff08da34 hwmon: (k8temp) Fix temperature reporting for (most) K8 RevG CPUs
Current Temperature for K8 RevG desktop CPUs is a "normalized value"
which can be below ambient temperature.

As a consequence lots of RevG systems report temperatures like:

$ sensors
k8temp-pci-00c3
Adapter: PCI adapter
Core0 Temp:    +17 C
Core0 Temp:     +3 C
Core1 Temp:    +21 C
Core1 Temp:     +5 C

being quite below ambient temperature.
There are even reports of negative temperature values.

This patch corrects the temperature reporting of k8temp for
RevG desktop CPUs.

Cc: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-15 22:27:47 +01:00
Andreas Herrmann a2e066bba2 hwmon: (k8temp) Fix wrong sensor selection for AMD K8 RevF/RevG CPUs
Meaning of ThermSenseCoreSel bit was inverted beginning with K8 RevF.
That means with current driver temp1/temp2 belong to core 1 and
temp3/temp4 belong to core 0 on a K8 RevF/RevG CPU.

This patch ensures that temp1/temp2 always belong to core 0 and
temp3/temp4 to core 1 for all K8 revisions.

Cc: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-15 22:27:47 +01:00
Andreas Herrmann bb9a35f293 hwmon: (k8temp) Warn about fam F rev F errata
Add warning about wrong CPU temperature readouts on all fam F rev F.

The allowed combinations of processors ensure that all processors
in a multisocket system have similar characteristics, e.g.

(1) provide temperature sensor interface (>=RevC && <RevF)
(2) are affected by erratum #141 (>=RevF)

Thus it is sufficient to check the revision of the boot CPU.

For "mixed silicon support" refer to
"Revision Guide for AMD Athlon 64 and AMD Opteron Processors" (RevA-E) and
"Revision Guide for AMD NPT Family 0Fh Processors" (RefF-G).

Cc: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-15 22:27:46 +01:00
Eric Piel cfce41a6d6 LIS3LV02D: separate the core from HP ACPI API
The sensor can be accessed via various buses.  In particular, SPI, I²C
and, on HP laptops, via a specific ACPI API (the only one currently
supported).  Separate this latest platform from the core of the sensor
driver to allow support for the other bus type.  The second, and more
direct goal is actually to be able to merge this part with the
hp-disk-leds driver, which has the same ACPI PNP number.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-09 16:54:42 -08:00
Linus Torvalds 2f2408a88c Merge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: (29 commits)
  hwmon: Fix various typos
  hwmon: Check for ACPI resource conflicts
  hwmon: (lm70) Add TI TMP121 support
  hwmon: (lm70) Code streamlining and cleanup
  hwmon: Deprecate the fscher and fscpos drivers
  hwmon: (fschmd) Add watchdog support
  hwmon: (fschmd) Cleanups for watchdog support
  hwmon: (i5k_amb) Load automatically on all 5000/5400 chipsets
  hwmon: (it87) Add support for the ITE IT8720F
  hwmon: Don't overuse I2C_CLIENT_MODULE_PARM
  hwmon: Add LTC4245 driver
  hwmon: (f71882fg) Fix fan_to/from_reg prototypes
  hwmon: (f71882fg) Printout fan modes
  hwmon: (f71882fg) Add documentation
  hwmon: (f71882fg) Fix auto_channels_temp temp numbering with f8000
  hwmon: (f71882fg) Add missing pwm3 attr for f71862fg
  hwmon: (f71882fg) Add F8000 support
  hwmon: (f71882fg) Remove the fan_mode module option
  hwmon: (f71882fg) Separate max and crit alarm and beep
  hwmon: (f71882fg) Check for hwmon powerdown state
  ...
2009-01-07 11:59:51 -08:00
Linus Torvalds 57c44c5f6f Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (24 commits)
  trivial: chack -> check typo fix in main Makefile
  trivial: Add a space (and a comma) to a printk in 8250 driver
  trivial: Fix misspelling of "firmware" in docs for ncr53c8xx/sym53c8xx
  trivial: Fix misspelling of "firmware" in powerpc Makefile
  trivial: Fix misspelling of "firmware" in usb.c
  trivial: Fix misspelling of "firmware" in qla1280.c
  trivial: Fix misspelling of "firmware" in a100u2w.c
  trivial: Fix misspelling of "firmware" in megaraid.c
  trivial: Fix misspelling of "firmware" in ql4_mbx.c
  trivial: Fix misspelling of "firmware" in acpi_memhotplug.c
  trivial: Fix misspelling of "firmware" in ipw2100.c
  trivial: Fix misspelling of "firmware" in atmel.c
  trivial: Fix misspelled firmware in Kconfig
  trivial: fix an -> a typos in documentation and comments
  trivial: fix then -> than typos in comments and documentation
  trivial: update Jesper Juhl CREDITS entry with new email
  trivial: fix singal -> signal typo
  trivial: Fix incorrect use of "loose" in event.c
  trivial: printk: fix indentation of new_text_line declaration
  trivial: rtc-stk17ta8: fix sparse warning
  ...
2009-01-07 11:31:52 -08:00
Jean Delvare 77fa49d94a hwmon: Fix various typos
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-07 16:37:35 +01:00
Jean Delvare b9acb64a38 hwmon: Check for ACPI resource conflicts
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-07 16:37:35 +01:00
Manuel Lauss c8ac32e471 hwmon: (lm70) Add TI TMP121 support
The Texas Instruments TMP121 is a SPI temperature sensor very similar
to the LM70, with slightly higher resolution.  This patch extends the
LM70 driver to support the TMP121.  The TMP123 differs in pin assign-
ment.

Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:34 +01:00
Kaiwan N Billimoria 2b7300513b hwmon: (lm70) Code streamlining and cleanup
This fixes a byteswap bug in the LM70 temperature sensor driver,
which was previously covered up by a converse bug in the driver
for the LM70EVAL-LLP board (which is also fixed).

Other fixes:  doc updates, remove an annoying msleep(), and improve
three-wire protocol handling.

Signed-off-by: Kaiwan N Billimoria <kaiwan@designergraphix.com>
[ dbrownell@users.sourceforge.net: doc and whitespace tweaks ]
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:34 +01:00
Hans de Goede 0589c2de64 hwmon: Deprecate the fscher and fscpos drivers
Now that the new merged fschmd driver has gained support for the watchdog
integrated into these IC's, there is no more reason to keep the old fscher
and fscpos drivers around, so mark them as deprecated.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:33 +01:00
Hans de Goede 97950c3d42 hwmon: (fschmd) Add watchdog support
This patch adds support for the watchdog part found in _all_ supported FSC
sensor chips.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:33 +01:00
Hans de Goede 453e308d77 hwmon: (fschmd) Cleanups for watchdog support
Various small cleanups in preparation of adding watchdog support,
mostly removing _MASK postfix from defines which are not masks.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:33 +01:00
Darrick J. Wong 6e31eb2b29 hwmon: (i5k_amb) Load automatically on all 5000/5400 chipsets
It turns out that we cannot create a pci_driver in this driver because PCI will
not call this module's probe function if the i5000-edac driver is already
loaded.  That said, we only want one value (AMBASE) from the PCI config space.
Neither driver alters this value, so it's safe to read it.  However, we still
want the module aliases, so provide that.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:33 +01:00
Jean-Marc Spaggiari b4da93e4b0 hwmon: (it87) Add support for the ITE IT8720F
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>
2009-01-07 16:37:32 +01:00
Jean Delvare 3aed198c35 hwmon: Don't overuse I2C_CLIENT_MODULE_PARM
I2C_CLIENT_MODULE_PARM is overkill for force_subclients. We really
only use 4 out of the 48 slots, so we're better defining a custom
variable instead. This change saves 92 bytes of data for each of the
five drivers affected.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Acked-by: Marc Hulsman <m.hulsman@tudelft.nl>
Cc: Mark M. Hoffman <mhoffman@lightlink.com>
2009-01-07 16:37:32 +01:00
Ira Snyder 6e34b187bc hwmon: Add LTC4245 driver
Add Linux support for the Linear Technology LTC4245 Multiple Supply Hot
Swap controller I2C monitoring interface.

Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:32 +01:00
Hans de Goede 2f650631b3 hwmon: (f71882fg) Fix fan_to/from_reg prototypes
The RPM after conversion from / before conversion to a register value can be
much more than 65535 (up to 1500000), so putting this into an u16 can cause
overflows. This changes the functions to use an int to store / get RPM instead.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:31 +01:00
Hans de Goede 28ba858798 hwmon: (f71882fg) Printout fan modes
Print the mode (duty-cycle or RPM) of each fan on driver load.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:31 +01:00
Hans de Goede 3b02d332b6 hwmon: (f71882fg) Add documentation
Add some documentation about the f71882fg driver, and update the Kconfig
documentation to report the new supported models.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:31 +01:00
Hans de Goede 3045301865 hwmon: (f71882fg) Fix auto_channels_temp temp numbering with f8000
Adjust auto_channels_temp show and store functions for different numbering of
temps between f8000 and other supported models.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:30 +01:00
Hans de Goede 4901062f78 hwmon: (f71882fg) Add missing pwm3 attr for f71862fg
For some reason the fan_attr array for the f71862fg was missing the attr for
the 3th pwm output. This patch fixes this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:30 +01:00
Hans de Goede ed4f7c20b3 hwmon: (f71882fg) Add F8000 support
And (finally) the patch actually adding f8000 support.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:30 +01:00
Hans de Goede 4c82c38ae2 hwmon: (f71882fg) Remove the fan_mode module option
Remove the fan_mode module option it was a monstrosity to begin with, and
when adding support for the F8000 it becomes a real pain!

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:30 +01:00
Hans de Goede 754a5907b0 hwmon: (f71882fg) Separate max and crit alarm and beep
While studying the datasheets for adding F8000 support, I noticed that the
F718x2 has separate alarms (and beep control) for its max and crit limits.

We keep the temp#_alarm attributes as they are, even though it would be more
logical to rename them to temp#_max_alarm. Because lm_sensors v2 depends
on them.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:29 +01:00
Hans de Goede 12d66e840b hwmon: (f71882fg) Check for hwmon powerdown state
More F8000 prep work. Take over the checking if the hwmon part is not
powered down from the standalone f8000 driver.

This check is valid for all supported models.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:29 +01:00
Hans de Goede bc27490f91 hwmon: (f71882fg) Cleanup fan and temp hyst functions
Simplify fan and temp hyst. handling by treating the registers as an array of
nibbles instead of using switch cases. Also unify the way hysts are handled
between temp and fans, the temp code was storing the actual per temp hyst
values in 4 u8's, where as the fan code was storing actual register values.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:29 +01:00
Hans de Goede ce0bfa5ee2 hwmon: (f71882fg) Fix various sysfs callback function issues
While working on adding F8000 support I noticed that various of the
store sysfs functions (and a few of the show also) had issues.

This patch fixes the following issues in these functions:
* store: storing the result of strto[u]l in an int, resulting in a possible
  overflow before boundary checking
* store: use of f71882fg_update_device(), we don't want to read the whole
  device in store functions, just the registers we need
* store: use of cached register values instead of reading the needed regs
  in the store function, including cases where f71882fg_update_device() was
  not used, this could cause real isues
* show: shown value is a calculation of 2 or more cached register reads,
  without locking the data struct.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:28 +01:00
Hans de Goede 7567a04355 hwmon: (f71882fg) Prepare for adding F8000 support
This patch is a preparation patch for adding F8000 support to the f71882fg
driver. If you look at the register addresses and esp, the bits used for
the temperature channels, then you will notice that it appears that they
start at 1 in a system meant to start at 0. As the F8000 actually uses the 0
addresses and bits, this patch changes the f71882fg driver to take 4
temperatures numbered 0-3 in to account, using 1-3 in this new scheme for
the temperatures actually present in the F718x2FG.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:28 +01:00
Hans de Goede 3cc74758a6 hwmon: (f71882fg) Move some io access from the detect to the probe function
The f71882fg driver did some io to ioports it hadn't reserved yet in its
find (detect) function, this patches moves this io to the probe function
where these ports are reserved and this io belongs.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:28 +01:00
Hans de Goede 498be96834 hwmon: (f71882fg) Add support for the F71862FG superio sensors
This patch adds support for the Fintek f71862fg superio monitoring
functions to the f71882fg driver.

This support has been tested without problems on a Jetway J9F2 by
Tony McConnell.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:28 +01:00
Hans de Goede c13548c531 hwmon: (f71882fg) Style cleanups and put some repeating code into functions
Various small cleanups as preparation for adding f71862fg support to the
f71882fg driver.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:27 +01:00
Mark van Doesburg 9ab796ebe1 hwmon: (f71882fg) Add PWM support
Add PWM (fan speed control) support to the f71882fg driver. Both
manual control and automatic (temperature-based) modes are supported.
Additionally, each mode has a PWM-based and an RPM-based variant. By
default we use the mode set by the BIOS.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Cc: Mark van Doesburg <mark.vandoesburg@hetnet.nl>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:27 +01:00
Mark van Doesburg 77a4a3e2a3 hwmon: (f71882fg) Misc cleanups
A few cleanups that were originally part of a larger patch but are
better submitted separately.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Cc: Mark van Doesburg <mark.vandoesburg@hetnet.nl>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:27 +01:00
Mark van Doesburg bc37ae7120 hwmon: (f71882fg) Use sensor_device_attribute_2
Convert f71882fg driver from SENSOR_ATTR to SENSOR_ATTR2 use, this is a
preparation patch for adding pwm support, which is broken out to make what
changes really in the pwm support patch clear.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Cc: Mark van Doesburg <mark.vandoesburg@hetnet.nl>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07 16:37:27 +01:00
Linus Torvalds 40d7ee5d16 Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (60 commits)
  uio: make uio_info's name and version const
  UIO: Documentation for UIO ioport info handling
  UIO: Pass information about ioports to userspace (V2)
  UIO: uio_pdrv_genirq: allow custom irq_flags
  UIO: use pci_ioremap_bar() in drivers/uio
  arm: struct device - replace bus_id with dev_name(), dev_set_name()
  libata: struct device - replace bus_id with dev_name(), dev_set_name()
  avr: struct device - replace bus_id with dev_name(), dev_set_name()
  block: struct device - replace bus_id with dev_name(), dev_set_name()
  chris: struct device - replace bus_id with dev_name(), dev_set_name()
  dmi: struct device - replace bus_id with dev_name(), dev_set_name()
  gadget: struct device - replace bus_id with dev_name(), dev_set_name()
  gpio: struct device - replace bus_id with dev_name(), dev_set_name()
  gpu: struct device - replace bus_id with dev_name(), dev_set_name()
  hwmon: struct device - replace bus_id with dev_name(), dev_set_name()
  i2o: struct device - replace bus_id with dev_name(), dev_set_name()
  IA64: struct device - replace bus_id with dev_name(), dev_set_name()
  i7300_idle: struct device - replace bus_id with dev_name(), dev_set_name()
  infiniband: struct device - replace bus_id with dev_name(), dev_set_name()
  ISDN: struct device - replace bus_id with dev_name(), dev_set_name()
  ...
2009-01-06 17:02:07 -08:00
Harvey Harrison 29041b4b1a ibmpex: add endian annotation to extract_data() helper
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
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>
2009-01-06 15:59:18 -08:00
Henrik Rydberg 85e0e5ad1e hwmon: applesmc: Add support for MacBook Air 2
Add temperature sensor support for MacBook Air 2.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Cc: Nicolas Boichat <nicolas@boichat.ch>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06 15:59:18 -08:00
Darrick J. Wong 89fac11cb3 adt7470: make automatic fan control really work
It turns out that the adt7470's automatic fan control algorithm only works
when the temperature sensors get updated.  This in turn happens only when
someone tells the chip to read its temperature sensors.  Regrettably, this
means that we have to drive the chip periodically.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06 15:59:18 -08:00
Darrick J. Wong 2f22d5dff6 adt7470: observe the number of temperature sensors to shorten update time
The adt7470 driver currently assumes that 1s is the proper time to wait to
read all temperature sensors.  However, the correct time is 200ms *
number_of_sensors.  This patch sets the default time to provide for 10
sensors and then lowers it based on the number of sensor inputs that have
nozero values.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06 15:59:18 -08:00
Darrick J. Wong 2e75a4b7ae adt7470: fix pwm at a certain level during temperature sensor scan
In the small window that it takes to read the temperature sensors, the pwm
outputs momentarily drop to 0.  This causes a noticeable hiccup in fan
speed, which is slightly annoying.  The solution is to manually program
the pwm output with whatever the automatic value is and then shift the
fans to manual control while reading temperatures.  Once that is done, put
the fans back to whatever mode of control was there before.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06 15:59:18 -08:00
Darrick J. Wong 8f8c1fb0c8 adt74{62, 70, 73}: Use DIV_ROUND_CLOSEST for rounded division
Modify some hwmon drivers to use DIV_ROUND_CLOSEST instead of bloating
source with (naughty) macros.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06 15:59:18 -08:00