History log of /drivers/hwmon/w83795.c
Revision Date Author Comments
7c81c60f3789a082e141d7a013392af5f78db16a 29-Jan-2014 Jean Delvare <khali@linux-fr.org> Update Jean Delvare's e-mail address

Signed-off-by: Jean Delvare <khali@linux-fr.org>
b55f375725ff85aada394da488802b0a3cc99e88 10-Jan-2013 Guenter Roeck <linux@roeck-us.net> hwmon: Fix checkpatch warning 'quoted string split across lines'

Cc: Corentin Labbe <corentin.labbe@geomatys.fr>
Cc: Mark M. Hoffman <mhoffman@lightlink.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Juerg Haefliger <juergh@gmail.com>
Cc: Andreas Herrmann <herrmann.der.user@googlemail.com>
Cc: Rudolf Marek <r.marek@assembler.cz>
Cc: Jim Cromie <jim.cromie@gmail.com>
Cc: Roger Lucas <vt8231@hiddenengine.co.uk>
Cc: Marc Hulsman <m.hulsman@tudelft.nl>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2a844c148e1f714ebf42cb96e1b172ce394c36c9 09-Jan-2013 Guenter Roeck <linux@roeck-us.net> hwmon: Replace SENSORS_LIMIT with clamp_val

SENSORS_LIMIT and the generic clamp_val have the same functionality,
and clamp_val is more efficient.

This patch reduces text size by 9052 bytes and bss size by 11624 bytes
for x86_64 builds.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: George Joseph <george.joseph@fairview5.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
0657777fcefffbf79d4a5fa0952a3f1a4248c0da 10-Oct-2012 Jean Delvare <khali@linux-fr.org> hwmon: Drop needless includes of <linux/delay.h>

These drivers use no sleep or delay functions so they don't need to
include <linux/delay.h>.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Cc: Rudolf Marek <r.marek@assembler.cz>
dcd8f39230b9f724ba4f55f14ed2bb8119204385 10-Oct-2012 Jean Delvare <khali@linux-fr.org> hwmon: Add missing inclusions of <linux/jiffies.h>

Many hwmon drivers use jiffies but omit the inclusion of the header
file. Fix that, and also fix one driver which was including the header
file but didn't need it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Luca Tettamanti <kronos.it@gmail.com>
Cc: Marc Hulsman <m.hulsman@tudelft.nl>
Cc: Rudolf Marek <r.marek@assembler.cz>
4cb14a3a6545bf4c51d6b61b95ccc1afe59510c9 02-Jun-2012 Guenter Roeck <linux@roeck-us.net> hwmon: (w83795) Convert to use devm_ functions

Convert to use devm_ functions to reduce code size and simplify the code.

Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
c10b3ee8aa7b26875a8ec0afb6f6323810b35043 23-Mar-2012 Guenter Roeck <linux@roeck-us.net> hwmon: (w83795) Fix multi-line comments

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
72fea694c4208d7ee1704a7dbccddd54af352cde 23-Mar-2012 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Unconditionally support manual fan speed control

Manual fan speed control uses a standard interface and has received
sufficient testing and review by now, it can be enabled
unconditionally. This includes attributes pwm[1-8], pwm[1-8]_enable,
pwm[1-8]_mode and pwm[1-8]_freq.

We only let the user switch from automatic mode to manual mode, but
not the other way around, as automatic control settings may not have
been set properly by the BIOS.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
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>
90ab5ee94171b3e28de6bb42ee30b527014e0be7 13-Jan-2012 Rusty Russell <rusty@rustcorp.com.au> module_param: make bool parameters really bool (drivers & misc)

module_param(bool) used to counter-intuitively take an int. In
fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
trick.

It's time to remove the int/unsigned int option. For this version
it'll simply give a warning, but it'll break next kernel version.

Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
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>
014bcd28a04ec085940ea3125f5ea91b16a1945d 12-Jan-2011 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Silent false warning from gcc

The code triggers a false warning with older versions of gcc:
w83795.c: In function 'w83795_update_device':
w83795.c:475: warning: 'lsb' may be used uninitialized in this function

I admit that the code is a little tricky, but I see no way to write it
differently without hurting performance. So let's just silent the
warning with a needless initialization.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
52d159eecced3e4ead901e2a14347f5c11ea4bab 15-Nov-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Check for BEEP pin availability

On the W83795ADG, there's a single pin for BEEP and OVT#, so you
can't have both. Check the configuration and don't create beep
attributes when BEEP pin is not available.

The W83795G has a dedicated BEEP pin so the functionality is always
available there.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
793c51d5fdfa76043f1221fdaa022f50146e8386 15-Nov-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Clear intrusion alarm immediately

When asked to clear the intrusion alarm, do so immediately. We have to
invalidate the cache to make sure the new status will be read. But we
also have to read from the status register once to clear the pending
alarm, as writing to CLR_CHS surprising won't clear it automatically.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
cf6b9ea661ef4f20b4a4cba1a232a732339aae2c 15-Nov-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Read the intrusion state properly

We can't read the intrusion state from the real-time alarm registers
as we do for all other alarm flags, because real-time alarm bits don't
stick (by definition) and the intrusion state has to stick until
explicitly cleared (otherwise it has little value.)

So we have to use the interrupt status register instead, which is read
from the same address but with a configuration bit flipped in another
register.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2a2d27da00250c9f117e35653ed5a6a3212e5d77 15-Nov-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Print the actual temperature channels as sources

Don't expose raw register values to user-space. Decode and encode
temperature channels selected as temperature sources as needed.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
edff2f8d81ce976ad6895f1d649fcb164be80e3d 15-Nov-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) List all usable temperature sources

Temperature sources are not correlated directly with temperature
channels. A look-up table is required to find out which temperature
sources can be used depending on which temperature channels (both
analog and digital) are enabled.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
d5ab845a13de7ff2d195917dad8879acfb6d8ff9 15-Nov-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Expose fan control method

Expose fan control method (DC vs. PWM) using the standard sysfs
attributes. I've made it read-only as the board should be wired for
a given mode, the BIOS should have set up the chip for this mode, and
you shouldn't have to change it. But it would be easy enough to make
it changeable if someone comes up with a use case.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
ae51cd9bcd9ca841bf45c0ba33823c56ac1ce81e 15-Nov-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Fix fan control mode attributes

There were two bugs:
* Speed cruise mode was improperly reported for all fans but fan1.
* Fan control method (PWM vs. DC) was mixed with the control mode.
It will be added back as a separate attribute, as per the standard
sysfs interface.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
24377101023d3c66136123bd8b20441814da6a90 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Use standard attributes for chassis intrusion

Follow the standard attribute naming for the chassis intrusion
feature. I couldn't test the beeping (my board apparently doesn't do
that) but the alarm works fine.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
00030af23153f1958f015df8b9fec8c29fcca8b8 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Exclude fan control feature by default

The fan control feature of the w83795 driver is insufficiently
reviewed and tested for public consumption at this time, so make it
optional and disabled by default. We will change the default when
review and testing is deemed sufficient. Ultimately the option will
go away.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
e3760b432d589ddd9bdb8c337539b815125bc7aa 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Add myself as co-author and maintainer

I've made so many changes to the w83795 driver that it's only fair to
list myself as a co-author. I'll also maintain the driver for some
time. There's more work needed on the driver for sure.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
eb02755a50f8f3508030b311e3788426fbdc23b7 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) More style cleanups

Cleanups suggested by Guenter Roeck, falling into 4 categories:
* Swapping test orders, because if (var == CONSTANT) is much easier to
read than if (CONSTANT == var).
* Simplifying comparisons with 0.
* Dropping unneeded masks.
* Dropping unneeded parentheses and curly braces.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
5d2cd958f777e533fa2809527836996f59b2d823 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Fix LSB reading of voltage limits

Wrong index caused the wrong register value to be read, resulting in
random LSB for voltage limits.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
21fc977551da43ec21ae0ebb859411afd4243d2b 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Use dev_get_drvdata() where possible

When we don't need the client pointer, calling dev_get_drvdata() is
more efficient that calling to_i2c_client() and then
i2c_get_clientdata().

Signed-off-by: Jean Delvare <khali@linux-fr.org>
1bb3450ce5050bc677c1995a60a0ddfe9e33e7b6 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Delay reading pwm config registers

Wait until we need the pwm config register values, instead of
pre-reading them. This saves over 1 second on modprobe on my test
system.

Obviously this time is added when first accessing pwm config
attributes, however not everybody will use them, so it seems unfair
to slow down driver loading (and thus boot) for an optional feature.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2ae61de90545fe3dadae8119181c430d89a8627b 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Delay reading limit registers

Wait until we need the limit register values, instead of pre-reading
them. This saves 544 ms on modprobe on my test system. Obviously this
time is added when first running "sensors" or any other monitoring
application, but I think it is better than slowing down the boot.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
0d7237bfd13a0a8df270654223c15a16b368a3bd 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Move register reads to dedicated functions

Move initial register reads out of probe, to dedicated functions.
This makes the code clearer, and will be needed if we want to delay
calling these functions until they are needed, or want to call them
periodically.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
476a4e5d3768ac72bb342166db294c0a9d2c010f 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Pack similar register reads

Pack similar register reads using for loops.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
fd7f82b8a37ff4d400c2db9c9fa8f9467dc54a08 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Make W83795_REG_PWM more efficient

Cascaded conditionals are inefficient. Reorder the fields so that
PWM register addresses can be computed more efficiently.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
5f7b77cbd4599b6a90d18981d9883a3e20e689fb 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Don't pre-read values we'll update later

There is no point in reading registers during initialization if we
will refresh the values in the update function later. This is only
slowing down the driver loading with no benefit, stop doing it.
This change saves 480 ms on driver load on my test system.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
39deb6993e7c22274c272c95013eef886f7004e8 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Simplify temperature sensor type handling

All 3 temperature sensor type sysfs functions (show_temp_mode,
store_temp_mode and show_dts_mode) can be simplified. We don't
create these files when the correponding input isn't in temperature
monitoring mode, so there is no point in handling that case.
Likewise, we don't allow changing inputs from temperature to voltage,
so the code handling this case is dead and can be removed.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
cd316df582925f3dab1ce5863651b3e260687035 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Drop _NUM constants

Consistently use ARRAY_SIZE() to control for loops.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
49c7347a44224b5b87c7e6a3c6c92619d77c06d5 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Drop REST_VLT_BEGIN/END

Get rid of REST_VLT_BEGIN and REST_VLT_END, they don't make the code
more readable.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
7eb8d508b5cfabbb147670ee063438469d94c465 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Fix parity checks

x % 1 is obviously wrong, as it always evaluates to 0. You want
x % 2, or x & 1, for parity checking.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
a654b9d4e7152b06557e2f22bcf0a245bc88bc98 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Get rid of VRLSB_SHIFT

VRLSB_SHIFT is a non-sense, the actual shift depends on the sensor
type (fans need 4, other sensors need 6). Get rid of it to prevent
any confusion. Also get rid of the useless masking, the meaningful
bits are always the MSb so there's nothing to mask out after
shifting.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
c1a792a6eea42d88a99e6ace215b22fbdb76c7b6 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Avoid reading the same register twice

Shorten driver load time by avoiding duplicate register access during
initialization. This saves 112 ms on modprobe on my test system.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
02728ffef9c2cf067e654e832b8c282a8a4d0b16 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Rework beep_enable implementation

Handle beep_enable just like all other beep bits. It doesn't need
anything special, so let's avoid redundant code. This also saves a
duplicate register read at initialization time.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
54891a3c135b30ca0718dbf81f78260795a5b2fe 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Report PECI agent Tbase values

On systems with PECI, report PECI agent Tbase temperature values.
This is informative only.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
dd127f5ccd7c61eb7ee215120a7809eb67c1ed7f 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Properly handle negative temperatures

The temperature registers hold regular 2's complement values, no need
to add any arithmetics.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
a0ce402fb006bd694436be8c8522fbe5e6823ac1 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Rename temperature limit attributes

Follow the standard for temperature limit attribute naming, so that
libsensors will pick the values.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
01879a855fb6bdb3fb820344a7a145de8a5cdbda 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Fix PWM duty cycle frequency attributes

The PWM duty cycle frequenty attributes are improperly named
(fanN_div instead of pwmN_div) and contain raw values instead of
actual frequencies. Rename them and fix their contents.

Also improve the logic when the user asks for a new frequency, to
always pick the closest supported frequency. The algorithm could
certainly be optimized, but the operation is infrequent enough that
I don't think it's worth the effort.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
0e256018b0f35d1b22ca37e1d0e207f7ba3d0076 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Add support for dynamic in0-2 limits

The W83795G can be configured to set the in0, in1 and/or in2 voltage
limits dynamically based on VID input pins. Switch the respective
sysfs attributes to read-only.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
6c82b2f3fb31e43a9b898769afd2151ca64986a4 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Fix LSB reading of fan speeds

Misplaced parentheses caused the wrong register value to be read,
resulting in random LSB for fan speed values and limits.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
71caf46fbf39207a324a16ddb6d8ef37c05777b9 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Clean up probe function

* The data structure is zalloc'd, so no need to set individual fields
to 0 explicitly.
* Refactor the handling of pins that can be used for either
temperature or voltage monitoring.
* Misc other clean-ups.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
6f9dfd85f7b14dd3ea87106909dc54def08947b1 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Fix in17-in20 gain factor

Gain bit set means 1x gain and cleared means 8x gain, not the other
way around.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
80646b95863ba282330d07290c79254c2f002139 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Only start monitoring if needed

This saves an SMBus write if monitoring was already enabled.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
86ef4d2fd5921ff0bcfd1c0d88403a08862087bc 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Add const markers

Attribute structures can be made const. Same for the I2C address
list.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
b2cc528e5838d744892b30c5104bd872a439088f 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Only create fan[1-8]_target files when needed

Only create fan[1-8]_target files when the fan in question can be
controlled (PWM output is present.) Also name these files according
to the standard.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
b5f6a90a0bbedc07a0b0b82b83aa716c7203fcd2 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Move PWM attributes to a dedidated array

Use a dedicated 2D array for PWM attributes. This way, PWM attributes
are handled the same way as other attributes, this is more consistent.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
87df0dad3e024538d2d0d2ce786230e639c2ea8b 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Use 2D arrays for many device attributes

Use 2D arrays for in, fan, temp and dts device attributes. Using
linear arrays is too risky as we have to skip some groups depending
on the device model and configuration. Adding or removing an
attribute would let the driver build silently but then it would crash
at runtime. With 2D arrays, the consistency checking happens at build
time, which is much safer.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
6f3dcde9c6dcbbe781a2a98900552bcb989733e3 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Merge w83795_create_files and w83795_remove_files

Functions w83795_create_files and w83795_remove_files iterate over
the same set of files, just calling a different function. Merge them
into a single function which takes the action as a parameter. This
saves code, and also ensure that file creation and deletion are in
sync.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
892514a6372d49ffe9749fb86cc587b4dce90733 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Move file creation to a separate function too

Function w83795_probe() is way too big, move file creation to a separate
function to make it more readable.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2fa09878ba1dc458b8cb6e9c8fbc8f2e5401d2b2 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Move files removal to a separate function

Sysfs files must be removed on device removal but also when device
registration fails. Move the code to a separate function to avoid
code redundancy.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2be381de0f1e5e0324e8b373e7a84fc9d25d05d3 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Improve detection routine

Check for additional identification registers. Improve debugging
messages on failed detection.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
b2469f422f9ee2054359c4ec609c3bdb1f2d52f5 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Refactor bank selection

Move the bank selection code to a separate function, to avoid
duplicating it in read and write functions. Improve error reporting
on register access error.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
093d1a4794cc23dd221019eb1cdf42b16b48abcc 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Drop duplicate enum

Enum chips and chip_types are redundant, get rid of the former. Fix
the detection code to properly identify the chip variant and name the
client accordingly.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
315bacfdbe5a77309c256b296f30bee13d59462b 28-Oct-2010 Jean Delvare <khali@linux-fr.org> hwmon: (w83795) Misc cleanups

* Improve driver description.
* Drop unused macro.
* Drop unreachable code.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
792d376b4f3f6af302d40373fa864f8b8e691c53 28-Oct-2010 Wei Song <Wsong@nuvoton.com> hwmon: New driver for the W83795G/ADG monitoring chips

There is still much work needed, but I wanted to give Wei the credit
he deserves. I've merged some of my own fixes already, to make
gcc and checkpatch happy. Individual fixes and improvements from me
will follow.

[JD: Fix build errors]
[JD: Coding style cleanups]
[JD: Get rid of forward declarations]
[JD: Drop VID support]
[JD: Drop fault output control feature]
[JD: Use lowercase for inline function names]
[JD: Use strict variants of the strtol/ul functions]
[JD: Shorten the read and write function names]

Signed-off-by: Jean Delvare <khali@linux-fr.org>