History log of /drivers/hwmon/lm90.c
Revision Date Author Comments
f7001bb063ec06e7fff8782146a7bed49dfe6507 23-Mar-2012 Guenter Roeck <linux@roeck-us.net> hwmon: (lm90) Restore original configuration if probe function fails

The lm90 driver restores the original chip configuration in its exit function.
However, the chip configuration is not restored if the probe function fails.
Restore it there as well.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
ae544f64cc7b0850471f62e6808068ef77b90763 23-Mar-2012 Guenter Roeck <linux@roeck-us.net> hwmon: (lm90) Add support for GMT G781

GMT G781 is a ADM1032-compatible temperature sensor chip.
Add support to the LM90 driver.

Cc: Mike Gorchak <lestat@i.com.ua>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
f36ffeab0a1d0a0a56edd39be7a97a07486305e8 23-Mar-2012 Guenter Roeck <linux@roeck-us.net> hwmon: (lm90) Fix multi-line comments

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
f0967eea80ec2a19a4fe1ad27e3ff1b22c79a3c7 20-Jan-2012 Axel Lin <axel.lin@gmail.com> hwmon: convert drivers/hwmon/* to use module_i2c_driver()

This patch converts the drivers in drivers/hwmon/* to use the
module_i2c_driver() macro which makes the code smaller and a bit simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Corentin Labbe <corentin.labbe@geomatys.fr>
Cc: Dirk Eibach <eibach@gdsys.de>
Cc: "Mark M. Hoffman" <mhoffman@lightlink.com>
Cc: Steve Glendinning <steve.glendinning@smsc.com>
Cc: Riku Voipio <riku.voipio@iki.fi>
Cc: Guillaume Ligneul <guillaume.ligneul@gmail.com>
Cc: David George <david.george@ska.ac.za>
Cc: "Hans J. Koch" <hjk@hansjkoch.de>
Cc: Marc Hulsman <m.hulsman@tudelft.nl>
Cc: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
6b101116ae445311031f3e9f91d3010d444b9845 16-Jan-2012 Guenter Roeck <linux@roeck-us.net> hwmon: (lm90) Add range check to set_update_interval

When writing the update_interval attribute, the parameter value was
not range checked, which could cause an integer overflow and result
in an arbitrary update interval. Fix by limiting the value range to
<0, 100000>.

Reported-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
179c4fdb565dd2157e5dfe89318b74868e3b523d 04-Jan-2012 Frans Meulenbroeks <fransmeulenbroeks@gmail.com> hwmon: replaced strict_str* with kstr*

replaced strict_strtol with kstrtol and
replaced strict_strtuol with kstrtuol

This satisfies checkpatch -f
Compile tested only: no warnings or errors given

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
b2589ab02b46ea4a80b30a90fc2fe8eed957e86a 04-Nov-2011 Jean Delvare <khali@linux-fr.org> hwmon: (lm90) Make code more readable

Clean up the code to make it more readable:
* Remove reg_ and new_ prefixes from variable names, they made the
names longer, causing extra line breaks, while not adding much
value.
* Introduce struct device dev* = &client->dev in two functions, to
avoid repeating client->dev everywhere in these functions.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
8dc089d68b125179b1c97e75d29623472d99c68b 04-Nov-2011 Jean Delvare <khali@linux-fr.org> hwmon: (lm90) Fix warnings

With some configuration option combinations, we get the following
warnings:

drivers/hwmon/lm90.c: In function 'lm90_detect':
drivers/hwmon/lm90.c:1114: warning: 'chip_id' may be used uninitialized
in this function
drivers/hwmon/lm90.c:1114: warning: 'reg_config1' may be used
uninitialized in this function
drivers/hwmon/lm90.c:1114: warning: 'reg_convrate' may be used
uninitialized in this function
drivers/hwmon/lm90.c:1187: warning: 'reg_emerg2' may be used
uninitialized in this function
drivers/hwmon/lm90.c:1187: warning: 'reg_status2' may be used
uninitialized in this function

We can solve these easily by reading the register values first and
checking for errors later. These errors should be very rare, even in
the case of failed detection, so this change has no impact on
performance. And this makes checkpatch.pl happier.

Reported-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
f90be42fb383f39aa814b8e14de138da8973e5c1 24-Jul-2011 Jean Delvare <khali@linux-fr.org> hwmon: (lm90) Refactor reading of config2 register

Several vendors implement a second configuration register, which we
check during device detection. Refactor the code to avoid duplication.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Stijn Devriendt <sdevrien@cisco.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
6d101c588f0fe08ef00f16c1a93762dd5d563df7 24-Jul-2011 Jean Delvare <khali@linux-fr.org> hwmon: (lm90) Make SA56004 detection more robust

With a device ID register value of 0, the SA56004 detection is rather
weak. Check several other register too to confirm the detection, as we
do for other supported devices.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Stijn Devriendt <sdevrien@cisco.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Stijn Devriendt <sdevrien@cisco.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
a095f687f1e19c54147bd51f735717508a49e225 28-Jul-2011 Jean Delvare <khali@linux-fr.org> hwmon: (lm90) Simplify handling of extended local temp register

The optional extended local temperature register can never have
address 0, as this address is already used by another register. Thus
we can get rid of flag LM90_HAVE_LOCAL_EXT and simply rely on
reg_local_ext being non-zero to determine if a given chip has this
extension or not. This makes the code more simple.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Stijn Devriendt <sdevrien@cisco.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2ef017935d698b1c7c7421a7ebe20579d8f904dd 06-Jun-2011 Stijn Devriendt <sdevrien@cisco.com> hwmon: (lm90) Add support for Philips SA56004

Add support for Philips SA56004, an LM86 compatible temperature sensor.

Signed-off-by: Stijn Devriendt <sdevrien@cisco.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
5a4e5e6a701bea7d3cbeed19fa9ea45802e8fabb 29-Apr-2011 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (lm90) Add support for ADT7461A and NCT1008

This patch adds support for ADT7461A and NCT1008 to the lm90 driver.
Both chips have identical functionality and report the same manufacturing ID
and device ID values.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
25985edcedea6396277003854657b5f3cb31a628 31-Mar-2011 Lucas De Marchi <lucas.demarchi@profusion.mobi> Fix common misspellings

Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
c4f99a2b8fb4c564865f0037a2b7be690d4409f3 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (lm90) Add support for the W83L771W/G

I was wondering if that chip ever existed publicly... Apparently yes,
so add support for it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
0c01b644f77a3df892a48a59901997469aeab0a7 28-Oct-2010 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (lm90) Add support for update_interval sysfs attribute

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
1179324c411edcefb28a5293f8cc6a5bd9567448 28-Oct-2010 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (lm90) Introduce capability flag to indicate broken ALERT functionality

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
4667bcb8d8fc081a804a798df70dc91241946e0a 28-Oct-2010 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (lm90) Introduce chip parameter structure

Instead of using switch/case and if statements in probe, define chip specific
functionality in a parameter structure array.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
15b66ab69051c014d0ba9f46f7081a8a7e6ad1c3 28-Oct-2010 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (lm90) Rearrange code to no longer require forward declarations

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
06e1c0a2167d48442d0bd06373390886670aa6e5 28-Oct-2010 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (lm90) Add support for max6695 and max6696

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
6948708dd07573c578aa99f80915cd1867334abe 28-Oct-2010 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (lm90) Add support for extra features of max6659

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
13c84951a3d75ba820adf47eb2a3b1c5ab1fa635 28-Oct-2010 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (lm90) Add explicit support for max6659

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
96512861c3733609ac3d558602574674fa95ebf4 28-Oct-2010 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (lm90) Simplify set_temp11 register calculations

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
b6fc1bacc7eae99d276d096fe0c702b1e13e4499 28-Oct-2010 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (lm90) Introduce function to delete sysfs files

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
88073bb1ba969d4e3c41dc5f35c902c6b7dab0a7 28-Oct-2010 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (lm90) Introduce device feature bits

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
11e578129af74c4866cf559e62e981c6415fffd9 28-Oct-2010 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (lm90) Fix checkpatch errors

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
8c3c7a256f7ab142dfbcee2d8633dbce5a36fde7 27-May-2010 Ira W. Snyder <iws@ovro.caltech.edu> hwmon: (lm90) Use programmed update rate

The lm90 driver programs the sensor chip to update its readings at 2 Hz
(500 ms between readings). However, the driver only does reads from the
chip at intervals of 2 * HZ (2000 ms between readings). Change the driver
update rate to the programmed update rate.

Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
53de33427fa3d7dd62cc5ec75ce0d4e6c6d602dd 05-Mar-2010 Jean Delvare <khali@linux-fr.org> hwmon: (lm90) Add SMBus alert support

Tested successfully with an ADM1032 chip on its evaluation board. It
should work fine with all other chips as well.

At this point this is more of a proof-of-concept, we don't do anything
terribly useful on SMBus alert: we simply log the event. But this could
later evolve into libsensors signaling so that user-space applications
can take an appropriate action.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Trent Piepho <tpiepho@freescale.com>
95238364167edaf93ce2890e5f55326b63194851 05-Mar-2010 Jean Delvare <khali@linux-fr.org> hwmon: (lm90) Restore configuration on exit

Restore the chip configuration when unloading the driver. This ensures
we don't leave the chip running if it was initially stopped.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
6771ea1fff988651593f78c122bc02e80f5100a0 05-Mar-2010 Jean Delvare <khali@linux-fr.org> hwmon: (lm90) Add support for the Winbond/Nuvoton W83L771AWG/ASG

This chips is found on several Zotac Ion ITX boards, amongst others.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: MC Matti <mcmatti17@googlemail.com>
Cc: Manuel Lamotte-Schubert <mls@pronego.com>
e5e9f44c246fbafe723e579e9fe887677beb40e4 14-Dec-2009 Jean Delvare <khali@linux-fr.org> i2c: Drop I2C_CLIENT_INSMOD_2 to 8

These macros simply declare an enum, so drivers might as well declare
it themselves. This puts an end to the arbitrary limit of 8 chip types
per i2c driver.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
c3813d6af177fab19e322f3114b1f64fbcf08d71 14-Dec-2009 Jean Delvare <khali@linux-fr.org> i2c: Get rid of struct i2c_client_address_data

Struct i2c_client_address_data only contains one field at this point,
which makes its usefulness questionable. Get rid of it and pass simple
address lists around instead.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
310ec79210d754afe51e2e4a983e846b60179abd 14-Dec-2009 Jean Delvare <khali@linux-fr.org> i2c: Drop the kind parameter from detect callbacks

The "kind" parameter always has value -1, and nobody is using it any
longer, so we can remove it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
8f2fa77c53ba8c10696143c21b4111d449c85fb2 09-Dec-2009 Jean Delvare <khali@linux-fr.org> hwmon: (lm90) Clean up detect function

As kind is now hard-coded to -1, there is room for code clean-ups.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
1a51e068c900eb6ea23ce597361ebf3b19a57b23 12-Mar-2009 Darrick J. Wong <djwong@us.ibm.com> hwmon: (lm90) Document support for the MAX6648/6692 chips

Update documentation to prevent further confusion/duplication.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
97ae60bb38279e1941c738b1037a57e6b14efeaf 26-Oct-2008 Jean Delvare <khali@linux-fr.org> hwmon: (lm90) Add support for the LM99 16 degree offset

The LM99 differs from the LM86, LM89 and LM90 in that it reports
remote temperatures (temp2) 16 degrees lower than they really are. So
far we have been cheating and handled this in userspace but it really
should be handled by the driver directly.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
ec38fa2b35f13e7fa1d676a5bc997d0df1b02574 26-Oct-2008 Jean Delvare <khali@linux-fr.org> hwmon: (lm90) Fix handling of hysteresis value

There are several problems in the way the hysteresis value is handled
by the lm90 driver:

* In show_temphyst(), specific handling of the MAX6646 is missing, so
the hysteresis is reported incorrectly if the critical temperature
is over 127 degrees C.
* In set_temphyst(), the new hysteresis register value is written to
the chip but data->temp_hyst isn't updated accordingly, so there is
a short period of time (up to 2 seconds) where the old hystereris
value will be returned while the new one is already active.
* In set_temphyst(), the critical temperature which is used as a base
to compute the value of the hysteresis register lacks
device-specific handling. As a result, the value of the hysteresis
register might be incorrect for the ADT7461 and MAX6646 chips.

Fix these 3 bugs.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Ben Hutchings <bhutchings@solarflare.com>
Cc: Nate Case <ncase@xes-inc.com>
4b4e7a72fda549e309919931d8a39dea4e5b4be1 17-Oct-2008 Jean Delvare <khali@linux-fr.org> hwmon: (lm90) Don't spam the kernel log

Degrade the "Unsupported chip" message from info to debug level.
There's nothing wrong with this, so no need to bother the user.
Also make the message slightly more descriptive.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Martyn Welch <martyn.welch@gefanuc.com>
271dabf5bbf6ae6e2792cd5cf6f0434230e5c18c 17-Oct-2008 Ben Hutchings <bhutchings@solarflare.com> hwmon: (lm90) Support MAX6646, MAX6647 and MAX6649

These Maxim chips are similar to MAX6657 but use unsigned temperature
values to allow for readings up to 145 degrees.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
9d4d3834229e9949c066c2d0f73ed5d4b4965761 17-Oct-2008 Ben Hutchings <bhutchings@solarflare.com> hwmon: (lm90) Rename temperature conversion functions to match usage

The encoding of temperatures varies between chips and modes. So do not
use "temp1" or "temp2" in the names of the conversion functions, but
specify the encoding.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Martyn Welch <martyn.welch@gefanuc.com>
23b2d4778ad33ee6bfe60439fb73c16580f204f2 17-Oct-2008 Nate Case <ncase@xes-inc.com> hwmon: (lm90) Support ADT7461 in extended mode

Support ADT7461 in extended temperature range mode, which will change
the range of readings from 0..127 to -64..191 degC. Adjust the
register conversion functions accordingly.

Signed-off-by: Nate Case <ncase@xes-inc.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Martyn Welch <martyn.welch@gefanuc.com>
cea50fe2fdea36174aa24b58c69c4eb9770e7c49 17-Oct-2008 Nate Case <ncase@xes-inc.com> hwmon: (lm90) Convert some macros to static functions

Use static functions instead of the TEMPx_FROM_REG* and TEMPx_TO_REG*
macros. This will ensure type safety and eliminate any side effects
from arguments passed in since the macros referenced 'val' multiple
times. This change should not affect functionality.

Signed-off-by: Nate Case <ncase@xes-inc.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Martyn Welch <martyn.welch@gefanuc.com>
a874a10cf0b7105ae5eeb98b4860eae0fc78fcdd 17-Oct-2008 Jean Delvare <khali@linux-fr.org> hwmon: (lm90) Update datasheet links

Update the links to the datasheet of some of the devices supported by
the lm90 driver. Also remove the links from the driver itself, so that
we don't have to update them twice each time they change.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Martyn Welch <martyn.welch@gefanuc.com>
5f502a834a6471dc3cc456ccef66292e9e3a152e 17-Oct-2008 Jean Delvare <khali@linux-fr.org> hwmon: (lm90) Don't access nonexistent registers on Maxim chips

The Maxim chips supported by the lm90 driver have 8-bit high and low
remote limit values, not 11-bit as the other chips have. So stop reading
from and writing to registers that do not exist on these chips. Also
round the limit values set by the user properly.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Martyn Welch <martyn.welch@gefanuc.com>
f65e17086fc141bee1592bbf6e709e9c7a43541b 17-Oct-2008 Jean Delvare <khali@linux-fr.org> hwmon: (lm90) Support the extra resolution bits of MAX6657

The Maxim MAX6657, MAX6658 and MAX6659 have extra resolution bits for
the local temperature measurement. Let the lm90 driver read them and
export them to user-space.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Martyn Welch <martyn.welch@gefanuc.com>
6388a388ffb720f40fc8046c261252ea2be9c12f 17-Oct-2008 Jean Delvare <khali@linux-fr.org> hwmon: (lm90) Move 16-bit value read to a separate function

Move the code which aggregates two 8-bit register values into a 16-bit
value to a separate function. We'll need to do it a second time soon and
I don't want to duplicate the code.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Martyn Welch <martyn.welch@gefanuc.com>
9b0e85269275159a1f9c3e4a5d254caf5211950b 16-Jul-2008 Jean Delvare <khali@linux-fr.org> hwmon: (lm90) Convert to a new-style i2c driver

The new-style lm90 driver implements the optional detect() callback
to cover the use cases of the legacy driver.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
25e9c86d5a6d82ea45eb680fc66bf73ac5e50dff 18-Feb-2008 Mark M. Hoffman <mhoffman@lightlink.com> hwmon: normal_i2c arrays should be const

Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
7b501b1f53605bec17454dd8bbdbbf3f57a7cf32 03-Jan-2008 Jean Delvare <khali@linux-fr.org> hwmon: Discard useless I2C driver IDs

Many I2C hwmon drivers define a driver ID but no other code references
these, meaning that they are useless. Discard them, along with a few
IDs which are defined but never used at all.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
e0ae87a49cf3e721313bf8942299f3f140c6963c 25-Nov-2007 Jean Delvare <khali@linux-fr.org> hwmon: (lm90) Use generic i2c reads during detection

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>
69f2f96d9c189070ed5e40ec186b755ef697288d 05-Sep-2007 Jean Delvare <khali@linux-fr.org> hwmon: (lm90) Export temperature offset values

Now that we have standard sysfs names to export temperature offset
values, add this feature to the lm90 driver. All supported chips
except the MAX6657, MAX6658 and MAX6659 support it.

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>
1beeffe43311f64df8dd0ab08ff6b1858c58363f 20-Aug-2007 Tony Jones <tonyj@suse.de> 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>
f5744e3775171b8deb2164577d3861968e33f72e 27-Jul-2007 Guillaume Chazarain <guichaz@yahoo.fr> hwmon: Fix regression caused by typo in lm90.c

The commit http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=32c82a934759b2c9939c9e25865c2d7d1204b9e8
broke lm90 for my (Asus V6VA) laptop.

Before 2.6.23-rc1 and with the following patch, I get:

[g ~]$ sensors
max6657-i2c-0-4c
Adapter: SMBus I801 adapter at 0400
M/B Temp: +64°C (low = +0°C, high = +127°C)
CPU Temp: +78.9°C (low = +73.2°C, high = +88.2°C)
M/B Crit: +105°C (hyst = +95°C)
CPU Crit: +105°C (hyst = +95°C)

Which regressed into:

[g ~]$ sensors
No sensors found!
Make sure you loaded all the kernel drivers you need.
Try sensors-detect to find out which these are.
zsh: 2701 exit 1 sensors

and dmesg contains:

i2c-adapter i2c-0: Unsupported chip (man_id=0x4D, chip_id=0x4D).

It seems to be a typo, as address 0X4F is mentionned nowhere else in the file,
and my chip is actually at 0x4C.

Signed-off-by: Guillaume Chazarain <guichaz@yahoo.fr>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
7817a39e65f04abe136d94a65fa26b7fe3334a1f 09-Jun-2007 Jean Delvare <khali@linux-fr.org> hwmon: Fault files naming convention

We have the following naming convention documented in
Documentation/hwmon/sysfs-interface for fault files:

in[0-*]_input_fault
fan[1-*]_input_fault
temp[1-*]_input_fault

Some drivers follow this convention (lm63, lm83, lm90, smsc47m192).
However some drivers omit the "input" part and create files named
fan1_fault (pc87427) or temp1_fault (dme1737). And the new "generic"
libsensors follows this second (non-standard) convention, so it fails
to report fault conditions for drivers which follow the standard.

We want a single naming scheme, and everyone seems to prefer the
shorter variant, so let's go for it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
32c82a934759b2c9939c9e25865c2d7d1204b9e8 09-Jun-2007 Rainer Birkenmaier <rainer.birkenmaier@siemens.com> hwmon/lm90: Add support for the Maxim MAX6680/MAX6681

Signed-off-by: Rainer Birkenmaier <rainer.birkenmaier@siemens.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
0966415d7267c860b88fe96f7e83cfd687efe0bd 09-Jun-2007 Jean Delvare <khali@linux-fr.org> hwmon/lm90: Spelling fix: explicitly

Signed-off-by: Jean Delvare <khali@linux-fr.org>
0e39e01c908fdc498fff0d788fd7b955ab75ebb6 24-Sep-2006 Jean Delvare <khali@linux-fr.org> hwmon: Fix unchecked return status, batch 4

hwmon: Fix unchecked return status, batch 4

Fix up some hwmon drivers so that they no longer ignore return status
from device_create_file().

Note: f71805f actually checked the status from device_create_file
already. However it did not remove the files on device destruction.
It was also an opportunity to use sysfs_create/remove_group instead
of hand-made loops. This makes the changes much more important but
I think the result is worth it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2d45771e6ea79f56a7d85e448f702f60ef86c228 24-Sep-2006 Jean Delvare <khali@linux-fr.org> hwmon: Add individual alarm files to 4 drivers

hwmon: Add individual alarm files to 4 drivers

Add individual sysfs files for all f71805f, lm63, lm83 and lm90 alarm
and fault conditions. This is a requirement for the planned
chip-independent libsensors. Almost all other hwmon drivers will need
the same improvement.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
9a61bf6300533d3b64d7ff29adfec00e596de67d 18-Jan-2006 Ingo Molnar <mingo@elte.hu> [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>
2b48716d1d2f2edb1e7cbc5ecf1cb2cb39373e33 07-Dec-2005 Greg Kroah-Hartman <gregkh@suse.de> [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>
cdaf79349c7d24e1d33acb6497849c9e956a33ea 26-Nov-2005 Laurent Riffard <laurent.riffard@free.fr> [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>
8a9947552d43b0d20d5fa23ac0ba435d526be454 26-Nov-2005 Jean Delvare <khali@linux-fr.org> [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>
90209b42d0498d57a804bf81fea427bf39c5315c 26-Oct-2005 Jean Delvare <khali@linux-fr.org> [PATCH] hwmon: lm90 documentation update

Update the I2C addresses for the ADM1032 and ADT7461 chips.
Also update the links to the Analog Devices web site.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
c3df5806cdae6fac678c662b527cb974bef4b60c 26-Oct-2005 Jean Delvare <khali@linux-fr.org> [PATCH] hwmon: Add PEC support to the lm90 driver

Add PEC support to the lm90 driver. Only the ADM1032 chip supports it,
and in a rather tricky way, which is why this patch comes with
documentation reinforcements. At least, this demonstrates that the new
PEC support logic in i2c-core can properly deal with chips with partial
PEC support.

As enabling PEC causes a significant performance drop, it can be
disabled through a sysfs file (unsurprisingly named "pec").

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
8256fe0f40f1cd72f80f2c46fe0ab1638f03a98d 26-Oct-2005 Jean Delvare <khali@linux-fr.org> [PATCH] hwmon: Separate the lm90 register read function

Preparatory patch to add PEC support to the lm90 driver. We need a
centralized function to read register values, where the PEC code will
be later inserted. A positive side effect is that read errors are now
handled properly.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
ba9c2e8d15da029ea3051c95e446b2d638ef02e2 17-Oct-2005 Deepak Saxena <dsaxena@plexity.net> [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>
f4b50261207c987913f076d867c2e154d71fd012 31-Jul-2005 Jean Delvare <khali@linux-fr.org> [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>
2ed2dc3c116d26fc6a9384e83d136b15cc203b6c 31-Jul-2005 Jean Delvare <khali@linux-fr.org> [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>
7bef559455fc71f66f8573cc1aafe1dd33966c1c 27-Jul-2005 Jean Delvare <khali@linux-fr.org> [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>
5071860aba7fc69279ab822638ed2c2e4549f9fd 20-Jul-2005 Jean Delvare <khali@linux-fr.org> [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>
943b0830cebe4711354945ed3cb44e84152aaca0 16-Jul-2005 Mark M. Hoffman <mhoffman@lightlink.com> [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>
8d5d45fb14680326f833295f2316a4ec5e357220 02-Jul-2005 Jean Delvare <khali@linux-fr.org> [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>