Commit Graph

91 Commits (a10d206ef1a83121ab7430cb196e0376a7145b22)

Author SHA1 Message Date
Jean Delvare c7f1f7166a hwmon: (it87) Add support for fan4 and fan5
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-09 22:56:30 -04:00
Tony Jones 1beeffe433 hwmon: Convert from class_device to device
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-09 22:56:30 -04:00
Jean Delvare d054612898 hwmon: Add missing __devexit tags in various drivers
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-30 21:05:43 -04:00
corentin.labbe b74f3fdd98 hwmon: convert it87 to platform driver
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-19 14:22:14 -04:00
Rudolf Marek 08a8f6e9e6 hwmon/it87: Add IT8726F support
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-07-19 14:22:13 -04:00
Jean Delvare ed6bafbf60 hwmon: Cleanup a bogus legacy comment
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-14 21:15:03 +01:00
Jean Delvare 7f999aa726 hwmon: Simplify the locking model of two drivers
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-14 21:15:03 +01:00
Jean Delvare f8d0c19a93 hwmon/it87: Add PWM base frequency control
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>
2007-02-14 21:15:02 +01:00
Jean Delvare 8e9afcbbde hwmon/it87: Remove the SMBus interface support
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-12-12 18:18:28 +01:00
Jean Delvare 87808be4f9 Fix unchecked return status, batch 5
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-28 15:31:18 -07:00
Jean Delvare b19367c6f4 it87: Copyright update
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-28 15:31:13 -07:00
Jean Delvare c5df9b7a7c it87: Overwrite broken default limits
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-28 15:31:13 -07:00
Jean Delvare 87673dd735 it87: Add support for the IT8718F
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-28 15:31:13 -07:00
Jean Delvare 8ab4ec3ef4 it87: Cleanup set_fan_div
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-28 15:31:13 -07:00
Jean Delvare 3543a53f6c it87: in8 has no limit registers
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-28 15:31:13 -07:00
Jean Delvare b9e349f710 it87: Prevent overflow on fan clock divider write
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-28 15:31:13 -07:00
Jean Delvare 9060f8bdd0 it87: No sysfs files for disabled fans
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-28 15:31:13 -07:00
Jean Delvare 17d648bf57 it87: Add support for the IT8716F
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-28 15:31:13 -07:00
Jean Delvare 8721884209 i2c-isa: Restore driver owner
i2c-isa: Restore driver owner

Commit 2b48716d1d 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>
2006-09-26 15:38:52 -07:00
Darren Jenkins f6c27fc17c [PATCH] I2C: hwmon: Rename register parameters
"register" is a reserved keyword so using it as a parameter name
can confuse some compilers, most notably ICC.

The patch below just renames all occurences to reg which fits the actual
function declarations.

Signed-off-by: Darren Jenkins <darrenrjenkins@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-03-23 14:21:55 -08:00
Ingo Molnar 9a61bf6300 [PATCH] hwmon: Semaphore to mutex conversions
convert drivers/hwmon/*.c semaphore use to mutexes.

the conversion was generated via scripts, and the result was validated
automatically via a script as well.

all affected hwmon drivers were build-tested.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-03-23 14:21:52 -08:00
Jean Delvare be79c38325 [PATCH] it87: Fix oops on removal
Fix an oops on it87 module removal when no supported hardware was
found.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-02-13 22:30:10 -08:00
Jean Delvare c5e3fbf22c [PATCH] hwmon: Fix reboot on it87 driver load
Only scan I2C address 0x2d. This is the default address and no IT87xxF
chip was ever seen on I2C at a different address. These chips are
better accessed through their ISA interface anyway.

This fixes bug #5889, although it doesn't address the whole class
of problems. We'd need the ability to blacklist arbitrary I2C addresses
on systems known to contain I2C devices which behave badly when probed.

Plan the I2C interface for removal as well. If nobody complains within
a year, it will confirm my impression that the I2C interface isn't
actually needed by anyone.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-02-06 12:02:15 -08:00
Jean Delvare a7be58a126 [PATCH] hwmon: it87 use u8 for vrm
VRM values fit in u8 by design now.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-05 22:16:26 -08:00
Greg Kroah-Hartman 2b48716d1d [PATCH] I2C: Remove .owner setting from i2c_driver as it's no longer needed
Now that i2c_add_driver() doesn't need the module owner to be set by
hand, we can delete it from the drivers.  This patch catches all of the
drivers that I found in the current tree (if a driver sets the .owner by
hand, it's not a problem, just not needed.)

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Jean Delvare <khali@linux-fr.org>
2006-01-05 22:16:25 -08:00
Laurent Riffard cdaf79349c [PATCH] i2c: Drop i2c_driver.{owner,name}, 3 of 11
We should use the i2c_driver.driver's .name and .owner fields
instead of the i2c_driver's ones.

This patch updates the hwmon drivers.

Signed-off-by: Laurent Riffard <laurent.riffard@free.fr>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-05 22:16:23 -08:00
Jean Delvare 8a9947552d [PATCH] i2c: Drop i2c_driver.flags, 2 of 3
Just about every i2c chip driver sets the I2C_DF_NOTIFY flag, so we
can simply make it the default and drop the flag. If any driver really
doesn't want to be notified when i2c adapters are added, that driver
can simply omit to set .attach_adapter. This approach is also more
robust as it prevents accidental NULL pointer dereferences.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-05 22:16:21 -08:00
Jean Delvare 07eab46db7 [PATCH] hwmon: Fix missing it87 fan div init
Fix a bug where setting the low fan speed limits will not work if no
data was ever read through the sysfs interface and the fan clock
dividers have not been explicitely set yet either. The reason is that
data->fan_div[nr] may currently be used before it is initialized from
the chip register values. The fix is to explicitely initialize
data->fan_div[nr] before using it.

Bug reported, and fix tested, by Nicolas Mailhot.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-23 23:04:27 -08:00
Ben Dooks c49efceffa [PATCH] hwmon: Static function fixes, 3 of 4
Fixup functions that have been declared static
and then actually defined without the static on.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28 14:02:13 -07:00
Deepak Saxena ba9c2e8d15 [PATCH] hwmon: kzalloc conversion
Use kzalloc instead of kmalloc+memset in all hardware monitoring
drivers.

Signed-off-by: Deepak Saxena <dsaxena@plexity.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28 14:02:12 -07:00
Jean Delvare 9174999628 [PATCH] hwmon: Drop legacy ISA address support from it87
Drop legacy ISA address support from the it87 driver. All supported
chips are Super-I/O chips, so the device ISA address can be safely read
from Super-I/O space rather than blindly assumed.

Two nearby inaccurate documentation statements have been fixed as well:
* The IT8705F doesn't have an SMBus interface.
* The SiS950 doesn't have a distinct prefix.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28 14:02:09 -07:00
Jean Delvare 303760b44a [PATCH] hwmon: hwmon vs i2c, second round (07/11)
The only part left in i2c-sensor is the VRM/VRD/VID handling code.
This is in no way related to i2c, so it doesn't belong there. Move
the code to hwmon, where it belongs.

Note that not all hardware monitoring drivers do VRM/VRD/VID
operations, so less drivers depend on hwmon-vid than there were
depending on i2c-sensor.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-09-05 09:14:22 -07:00
Jean Delvare f4b5026120 [PATCH] hwmon: hwmon vs i2c, second round (06/11)
The only thing left in i2c-sensor.h are module parameter definition
macros. It's only an extension of what i2c.h offers, and this extension
is not sensors-specific. As a matter of fact, a few non-sensors drivers
use them. So we better merge them in i2c.h, and get rid of i2c-sensor.h
altogether.

Signed-off-by: Jean Delvare <khali@linux-fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-09-05 09:14:21 -07:00
Jean Delvare 2ed2dc3c11 [PATCH] hwmon: hwmon vs i2c, second round (04/11)
i2c_probe and i2c_detect now do the exact same thing and operate on
the same data structure, so we can have everyone call i2c_probe.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-09-05 09:14:20 -07:00
Jean Delvare e6cfb3ad72 [PATCH] hwmon: tag super-i/o find functions __init
Super-I/O find functions in hardware monitoring drivers can be tagged
__init as they are only called from functions themselves tagged __init.
Two of them (smsc47b397 and w83627ehf) already do, but the other four
of them (it87, pc87360, smsc47m1 and w83627hf) did not.

This saves a few bytes of memory after the drivers are loaded, 192 in
the case of the it87 driver.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-09-05 09:14:15 -07:00
Jean Delvare 7bef559455 [PATCH] I2C: refactor message in i2c_detach_client
We could refactor the error message 34 different i2c drivers print if
i2c_detach_client() fails in this function itself. Saves quite a few
lines of code. Documentation is updated to reflect that change.

Note that this patch should be applied after Rudolf Marek's w83792d
patches.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-09-05 09:14:14 -07:00
Jean Delvare 5071860aba [PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (7/9)
Kill normal_isa in header files, documentation and all chip drivers, as
it is no more used.

normal_i2c could be renamed to normal, but I decided not to do so at the
moment, so as to limit the number of changes. This might be done later
as part of the i2c_probe/i2c_detect merge.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-09-05 09:14:12 -07:00
Jean Delvare 2d8672c5a6 [PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (5/9)
Call the ISA chip drivers detection function directly instead of relying
on i2c_detect. The net effect is that address lists won't be handled
anymore, but they were mostly useless in the ISA case anyway (pc87360,
smsc47m1, smsc47b397 had already dropped them).

We don't need to handle multiple devices, all we may need is a way to
force a given address instead of the original one (some drivers already
do: sis5595, via686a, w83627hf), and, for drivers supporting multiple
chips, a way to force one given kind. All this may be added later on
demand, but I actually don't think there will be much demand.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-09-05 09:14:10 -07:00
Jean Delvare fde0950903 [PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (3/9)
Convert the 10 ISA hardware monitoring drivers (it87, lm78, pc87360,
sis5595, smsc47b397, smsc47m1, via686a, w83627hf, w83627ehf, w83781d) to
explicitely register with i2c-isa. For hybrid drivers (it87, lm78,
w83781d), we now have two separate instances of i2c_driver, one for the
I2C interface of the chip, and one for ISA interface. In the long run,
the one for ISA will be replaced with a different driver type.

At this point, all drivers are working again, except for missing
dependencies in Kconfig.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-09-05 09:14:09 -07:00
Mark M. Hoffman 943b0830ce [PATCH] I2C hwmon: add hwmon sysfs class to drivers
This patch modifies sensors chip drivers to make use of the new
sysfs class "hwmon".

Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-09-05 09:14:08 -07:00
Jean Delvare 8d5d45fb14 [PATCH] I2C: Move hwmon drivers (2/3)
Part 2: Move the driver files themselves.

Note that the patch "adds trailing whitespace", because it does move the
files as-is, and some files happen to have trailing whitespace.

From: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-07-11 14:42:50 -07:00