History log of /drivers/hwmon/smsc47m1.c
Revision Date Author Comments
1d0045ee4a220872b65147b5b290e4a4852386d9 28-Mar-2012 Guenter Roeck <linux@roeck-us.net> hwmon: (smsc47m1) Fix compiler warning

Some configurations produce the following compiler warning:

drivers/hwmon/smsc47m1.c: In function 'sm_smsc47m1_init':
drivers/hwmon/smsc47m1.c:938: warning: 'address' may be used uninitialized in this function

While this is a false positive, it can easily be fixed by overloading the return
value from smsc47m1_find with both address and error return code (the address
is an unsigned short and thus never negative). This also reduces module size by
a few bytes (46 bytes for x86_64).

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
85a0c0d1a17cd83f4c2cec09c3ae69ed210f23b2 15-Jan-2012 Guenter Roeck <linux@roeck-us.net> hwmon: (smsc47m1) Fix checkpatch issues

Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
ERROR: space required after that ',' (ctx:VxV)
ERROR: spaces required around that '<=' (ctx:VxV)
ERROR: spaces required around that '==' (ctx:VxV)
ERROR: spaces required around that '>=' (ctx:VxV)
ERROR: trailing statements should be on next line
ERROR: trailing whitespace
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: static const char * array should probably be static const char * const

Modify multi-line comments to follow Documentation/CodingStyle.

Also: s/#define^I/#define /

Not fixed (false positive):
ERROR: Macros with multiple statements should be enclosed in a do - while loop

Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7e612685a3a3f0c1159f4562421e91a6c55d024e 17-Jan-2012 Guenter Roeck <linux@roeck-us.net> hwmon: (smsc47m1) Fix: do not use assignment in if condition

Fix checkpatch issue:
ERROR: do not use assignment in if condition

Replace repeated calls to device_create_file() with calls to sysfs_create_group.

Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
512504e9f5489dbe85c80fd2c1b44ab5a8e0d5fa 20-Oct-2010 Joe Perches <joe@perches.com> hwmon: (smsc47m1) Use pr_fmt and pr_<level>

Added #define pr_fmt KBUILD_MODNAME ": " fmt
Converted printks to pr_<level>
Coalesced any long formats
Removed prefixes from formats

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
a00d643a2a841e76dfb76ec4f8a1e71844252974 25-Jan-2010 Jeff Mahoney <jeffm@suse.com> hwmon: (smsc47m1) Fix section mismatch

smsc47m1_restore is called from sm_smsc47m1_exit, which is an __exit
function, so it can't be __init.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
fa0bff02239abdad446effef22e5db281cf3d562 16-Dec-2009 Jean Delvare <khali@linux-fr.org> hwmon: (smsc47m1) Enable device if needed

If the address is set but the device isn't enabled, attempt to enable
it. If it won't work for any reason (resource conflict, no function
enabled) the initial state is restored. The initial state is also
restored on module unloading.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Sean Fidler <fidlersean@gmail.com>
3ecf44b312758d10be20539b06b2df5d77d59cdb 16-Dec-2009 Jean Delvare <khali@linux-fr.org> hwmon: (smsc47m1) Fail module loading on error

If an error occurs during probing, there's no point in keeping the
module in memory. Better fail the module loading early to make the
problem more visible.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Sean Fidler <fidlersean@gmail.com>
a0e92d70f35b5fd7da8ec2160cda78b98e2113bc 16-Dec-2009 Jean Delvare <khali@linux-fr.org> hwmon: (smsc47m1) Only request I/O ports we really use

The I/O area of the SMSC LPC47M1xx chips which we use, gives access to
a lot of registers, some of which are related to fan speed monitoring
and control, but many are not. At the moment, the smsc47m1 driver
requests the whole I/O port range. This could easily result in
resource conflicts with either ACPI or other drivers.

Request only the I/O ports we really use, to prevent such conflicts.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Sean Fidler <fidlersean@gmail.com>
6055fae8aceee41471edfd1876e5617d16e028fe 15-Sep-2009 H Hartley Sweeten <hartleys@visionengravers.com> hwmon: Include <linux/io.h> instead of <asm/io.h>

Drivers should be including <linux/io.h> instead of <asm/io.h>.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Alistair John Strachan <alistair@devzero.co.uk>
Cc: Nicolas Boichat <nicolas@boichat.ch>
Cc: Juerg Haefliger <juergh@gmail.com>
Cc: Frank Seidel <frank@f-seidel.de>
Acked-by: Jim Cromie <jim.cromie@gmail.com>
Cc: "Mark M. Hoffman" <mhoffman@lightlink.com>
Cc: Roger Lucas <vt8231@hiddenengine.co.uk>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
1b54ab450b180eaeeb0eee6f0f64349246a22c14 28-Jul-2009 Jean Delvare <khali@linux-fr.org> hwmon: (smsc47m1) Differentiate between LPC47M233 and LPC47M292

The SMSC LPC47M233 and LPC47M292 chips have the same device ID but
are not compatible.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Juerg Haefliger <juergh@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
b9acb64a385c5b26fc392e0d58ac7b8e0a2cd812 07-Jan-2009 Jean Delvare <jdelvare@suse.de> 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>
1f08af7ea95e0f4ec632664b9f21a687426df658 06-Jan-2008 Jean Delvare <khali@linux-fr.org> hwmon: (smsc47m1) Add individual alarm files

The new libsensors needs these individual alarm files.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Juerg Haefliger <juergh at gmail.com>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
67b671bceb4a8340a30929e9642620d99ed5ad76 06-Dec-2007 Jean Delvare <khali@linux-fr.org> hwmon: Let the user override the detected Super-I/O device ID

While it is possible to force SMBus-based hardware monitoring chip
drivers to drive a not officially supported device, we do not have this
possibility for Super-I/O-based drivers. That's unfortunate because
sometimes newer chips are fully compatible and just forcing the driver
to load would work. Instead of that we have to tell the users to
recompile the kernel driver, which isn't an easy task for everyone.

So, I propose that we add a module parameter to all Super-I/O based
hardware monitoring drivers, letting advanced users force the driver
to load on their machine. The user has to provide the device ID of a
supposedly compatible device. This requires looking at the source code or
a datasheet, so I am confident that users can't randomly force a driver
without knowing what they are doing. Thus this should be relatively safe.

As you can see from the code, the implementation is pretty simple and
unintrusive.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Hans de Goede <j.w.r.degoede@hhs.nl>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
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>
8477d026893d42b00474e9a13ab01ccce7fc2673 16-Aug-2007 Jean Delvare <khali@linux-fr.org> hwmon: (smsc47m1) No confusing debugging messages

It's confusing to display debugging messages for fan3 and pwm3 for
chips which don't have them.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
68a50b567895ea677645ca3cebc484674123532d 12-Aug-2007 Jean Delvare <khali@linux-fr.org> hwmon: (smsc47m1) restore missing name attribute

The smsc47m1 driver no longer creates the name attribute used by
libsensors to identify chip types. It was lost during the conversion
to a platform driver. I was fooled by the fact that we do have a
group with all attributes, but only to delete them all at once. The
group is not used to create the attributes, so we have to explicitly
create the name attribute.

This fixes lm-sensors ticket #2236:
http://lm-sensors.org/ticket/2236

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
d0546128980c18748010c758903b02909e634830 22-Jul-2007 Jean Delvare <khali@linux-fr.org> 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>
04a6217df28e3004ba4e76eb0a356a30f72c564f 12-Jun-2007 Jean Delvare <khali@linux-fr.org> hwmon: Fix a potential race condition on unload

Fix a potential race condition when some hardware monitoring platform
drivers are being unloaded. I believe that the driver data pointer
shouldn't be cleared before all the sysfs files are removed, otherwise
a sysfs callback might attempt to dereference a NULL pointer. I'm not
sure exactly what the driver core protects drivers against, so let's
play it safe.

While we're here, clear the driver data pointer when probe fails, so
as to not leave an invalid pointer behind us.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2df6d811574f46bea0d38bf91aa54df4c05488cd 09-Jun-2007 Jean Delvare <khali@linux-fr.org> hwmon: Use platform_device_add_data()

Use platform_device_add_data() in hardware monitoring drivers. This
makes the code nicer and smaller too. Reported by David Hubbard.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: David Hubbard <david.c.hubbard@gmail.com>
e84cfbcbe830c20af030fd7ba37edf8ed88fda5f 08-May-2007 Jean Delvare <khali@linux-fr.org> hwmon/smsc47m1: Use dynamic sysfs callbacks

This lets us get rid of macro-generated functions and shrinks the
driver size by about 7%.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
620100cf97a5dd144035e51aeea330d691176489 08-May-2007 Jean Delvare <khali@linux-fr.org> hwmon/smsc47m1: Use DRVNAME consistently

Also use pr_info instead of printk.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
51f2cca1f72db5e272ed79b678b62fb9472e916e 08-May-2007 Jean Delvare <khali@linux-fr.org> hwmon/smsc47m1: Convert to a platform driver

Convert the smsc47m1 driver from the nonsensical i2c-isa hack to a
regular platform driver.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
94e183fd0425a917d9c1453041ef88f3610c0f01 08-May-2007 Jean Delvare <khali@linux-fr.org> hwmon/smsc47m1: Get rid of a useless mutex

The smsc47m1 driver uses a mutex to protect the accesses to the
hardware registers. It really doesn't need any protection, as the
register space is flat. Get rid of that mutex for a smaller and
faster driver.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
8eccbb6fb97a5b54a9db166399f0d24f33114522 08-May-2007 Jean Delvare <khali@linux-fr.org> hwmon/smsc47m1: Add support for the LPC47M292

The new SMSC LPC47M292 Super-I/O chip is a bit different from the
previous ones, it supports a 3rd fan, but unfortunately the pin
configuration registers are different.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
6091780eba5d195213747b515a62211ac97641f1 08-Oct-2006 Jean Delvare <khali@linux-fr.org> smsc47m1: List the SMSC LPC47M112 as supported

The SMSC LPC47M112 Super-I/O chip appears to be compatible with the
LPC47M10x and LPC47M13x as far as hardware monitoring is concerned.
The device ID is even the same, so it's really only a documentation
update.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
ce8c6ce1eceecfe090f6c1aa4108087b2051497b 24-Sep-2006 Jean Delvare <khali@linux-fr.org> hwmon: Fix unchecked return status, SMSC chips

hwmon: Fix unchecked return status, SMSC chips

Fix up 2 more 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>
0dd7699ec4b27b3662d8980ff7a309cc81276298 28-Aug-2006 Jean Delvare <khali@linux-fr.org> smsc47m1: dev_warn fix

smsc47m1: dev_warn fix

We can't use dev_warn on an i2c client before it is attached.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
872188420997f7f7c1b968fd9bce6578e4c3d45f 03-Sep-2006 Jean Delvare <khali@linux-fr.org> i2c-isa: Restore driver owner

i2c-isa: Restore driver owner

Commit 2b48716d1d2f2edb1e7cbc5ecf1cb2cb39373e33 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>
d6e05edc59ecd79e8badf440c0d295a979bdfa3e 26-Jun-2006 Andreas Mohr <andi@lisas.de> spelling fixes

acquired (aquired)
contiguous (contigious)
successful (succesful, succesfull)
surprise (suprise)
whether (weather)
some other misspellings

Signed-off-by: Andreas Mohr <andi@lisas.de>
Signed-off-by: Adrian Bunk <bunk@stusta.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>
b890a07f7b002ee473986fa85ae3582de399a4cf 26-Oct-2005 Jean Delvare <khali@linux-fr.org> [PATCH] hwmon: smsc47m1 documentation update

The SMSC LPC47M997 Super-I/O chip seems to be compatible with the
LPC47M192, so it is supported by the smsc47m1 driver.

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>
0db9714a0ca2a1a36721a2e90fbfcbdf3d5ff117 06-Sep-2005 Jean Delvare <khali@linux-fr.org> [PATCH] hwmon: Update smsc47m1 head comment

Update the head comment of the smsc47m1 driver to mention all the
supported devices.

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>
e6cfb3ad7209e4f4dcdc14f5fc437db55667041f 27-Jul-2005 Jean Delvare <khali@linux-fr.org> [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>
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>
2d8672c5a6ba0d3f1d8d3ad61ef67868941364f0 19-Jul-2005 Jean Delvare <khali@linux-fr.org> [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>
fde0950903ce8cc38a91dd095280decceda2ff82 19-Jul-2005 Jean Delvare <khali@linux-fr.org> [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>
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>
1f57ff89fee47a317e9e8ca63bf0f139802cc116 25-Aug-2005 Alexey Dobriyan <adobriyan@gmail.com> [PATCH] drivers/hwmon/*: kfree() correct pointers

The adm9240 driver, in adm9240_detect(), allocates a structure. The
error path attempts to kfree() ->client field of it (second one),
resulting in an oops (or slab corruption) if the hardware is not present.

->client field in adm1026, adm1031, smsc47b397 and smsc47m1 is the first in
${HWMON}_data structure, but fix them too.

Signed-off-by: Jonathan Corbet <corbet@lwn.net
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
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>