summaryrefslogtreecommitdiff
path: root/drivers/hwmon/f75375s.c
AgeCommit message (Collapse)Author
2012-01-05hwmon: (f75375s) Add support for F75387SG/RGBjörn Gerhart
Fintek F75387SG/RG is mostly compatible to F75373/F75375. Add support for it to the F75375S driver. Fan support for F75387SG/RG has been implemented but not tested. Cc: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Bjoern Gerhart <oss@extracloud.de> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-05hwmon: (f75375s) Disable setting DC fan control mode for F75373Guenter Roeck
F75373 does not support DC (linear voltage) fan control mode, so don't let the user set it. Cc: Riku Voipio <riku.voipio@iki.fi> Reviewed-by: Bjoern Gerhart <oss@extracloud.de> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-05hwmon: (f75375s) Initialize pwmX_mode and pwmX_enable if there is no ↵Guenter Roeck
platform data pwmX_mode and pwmX_enable are not initialized if no platform data is provided to the driver. Read chip configuration at driver initialization time and initialize attributes to reflect chip configuration. Cc: Riku Voipio <riku.voipio@iki.fi> Reviewed-by: Bjoern Gerhart <oss@extracloud.de> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-05hwmon: (f75375s) Fix value range for PWM modesGuenter Roeck
Accepted value range for PWM modes was 0..4, even though only 0..3 is subsequently used. Limit permitted value range to 0..3 to avoid unpredictable behavior. Cc: Riku Voipio <riku.voipio@iki.fi> Reviewed-by: Bjoern Gerhart <oss@extracloud.de> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-05hwmon: (f75375s) Use standard sysfs attribute namesGuenter Roeck
The driver uses non-standard sysfs attribute names for maximum and target fan speeds, even though standard attibute names for the same values do exist. Replace non-standard attribute names with standard attribute names. Cc: Riku Voipio <riku.voipio@iki.fi> Reviewed-by: Bjoern Gerhart <oss@extracloud.de> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-05hwmon: (f75375s) Fix checkpatch errors and warningsGuenter Roeck
Clean up driver to follow current coding style. Cc: Riku Voipio <riku.voipio@iki.fi> Reviewed-by: Bjoern Gerhart <oss@extracloud.de> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-10-24Merge branch 'for-next' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits) Update broken web addresses in arch directory. Update broken web addresses in the kernel. Revert "drivers/usb: Remove unnecessary return's from void functions" for musb gadget Revert "Fix typo: configuation => configuration" partially ida: document IDA_BITMAP_LONGS calculation ext2: fix a typo on comment in ext2/inode.c drivers/scsi: Remove unnecessary casts of private_data drivers/s390: Remove unnecessary casts of private_data net/sunrpc/rpc_pipe.c: Remove unnecessary casts of private_data drivers/infiniband: Remove unnecessary casts of private_data drivers/gpu/drm: Remove unnecessary casts of private_data kernel/pm_qos_params.c: Remove unnecessary casts of private_data fs/ecryptfs: Remove unnecessary casts of private_data fs/seq_file.c: Remove unnecessary casts of private_data arm: uengine.c: remove C99 comments arm: scoop.c: remove C99 comments Fix typo configue => configure in comments Fix typo: configuation => configuration Fix typo interrest[ing|ed] => interest[ing|ed] Fix various typos of valid in comments ... Fix up trivial conflicts in: drivers/char/ipmi/ipmi_si_intf.c drivers/usb/gadget/rndis.c net/irda/irnet/irnet_ppp.c
2010-10-18Update broken web addresses in the kernel.Justin P. Mattock
The patch below updates broken web addresses in the kernel Signed-off-by: Justin P. Mattock <justinmattock@gmail.com> Cc: Maciej W. Rozycki <macro@linux-mips.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Finn Thain <fthain@telegraphics.com.au> Cc: Randy Dunlap <rdunlap@xenotime.net> Cc: Matt Turner <mattst88@gmail.com> Cc: Dimitry Torokhov <dmitry.torokhov@gmail.com> Cc: Mike Frysinger <vapier.adi@gmail.com> Acked-by: Ben Pfaff <blp@cs.stanford.edu> Acked-by: Hans J. Koch <hjk@linutronix.de> Reviewed-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-09-17hwmon: (f75375s) Do not overwrite values read from registersGuillem Jover
All bits in the values read from registers to be used for the next write were getting overwritten, avoid doing so to not mess with the current configuration. Signed-off-by: Guillem Jover <guillem@hadrons.org> Cc: Riku Voipio <riku.voipio@iki.fi> Cc: stable@kernel.org Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-09-17hwmon: (f75375s) Shift control mode to the correct bit positionGuillem Jover
The spec notes that fan0 and fan1 control mode bits are located in bits 7-6 and 5-4 respectively, but the FAN_CTRL_MODE macro was making the bits shift by 5 instead of by 4. Signed-off-by: Guillem Jover <guillem@hadrons.org> Cc: Riku Voipio <riku.voipio@iki.fi> Cc: stable@kernel.org Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-06-03i2c: Remove all i2c_set_clientdata(client, NULL) in driversWolfram Sang
I2C drivers can use the clientdata-pointer to point to private data. As I2C devices are not really unregistered, but merely detached from their driver, it used to be the drivers obligation to clear this pointer during remove() or a failed probe(). As a couple of drivers forgot to do this, it was agreed that it was cleaner if the i2c-core does this clearance when appropriate, as there is no guarantee for the lifetime of the clientdata-pointer after remove() anyhow. This feature was added to the core with commit e4a7b9b04de15f6b63da5ccdd373ffa3057a3681 to fix the faulty drivers. As there is no need anymore to clear the clientdata-pointer, remove all current occurrences in the drivers to simplify the code and prevent confusion. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Richard Purdie <rpurdie@linux.intel.com> Acked-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo
implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2009-12-14i2c: Drop I2C_CLIENT_INSMOD_2 to 8Jean Delvare
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>
2009-12-14i2c: Get rid of struct i2c_client_address_dataJean Delvare
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>
2009-12-14i2c: Drop the kind parameter from detect callbacksJean Delvare
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>
2009-12-09hwmon: Clean up detect functionsJean Delvare
As kind is now hard-coded to -1, there is room for code clean-ups. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Corentin Labbe <corentin.labbe@geomatys.fr> Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> Cc: Juerg Haefliger <juergh@gmail.com> Cc: Riku Voipio <riku.voipio@iki.fi> Acked-by: "Hans J. Koch" <hjk@linutronix.de> Cc: Rudolf Marek <r.marek@assembler.cz>
2009-03-30trivial: Update my email addressRiku Voipio
Update my email address. Signed-off-by: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-12hwmon: (f75375s) Remove unnecessary and confusing initializationAndrew Klossner
f75375_probe calls i2c_get_clientdata to initialize the data pointer, but there isn't yet any client data to get, and the value is never used before the variable is assigned a new value seven lines later. The call doesn't hurt anything and wastes only a couple of cycles. The reason to fix it is because this module serves as an example to hackers writing new hwmon drivers, and this part of the example is confusing. Signed-off-by: Andrew Klossner <andrew@cesa.opbu.xerox.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-07-16hwmon: (f75375s) Drop legacy i2c driverJean Delvare
Drop the legacy f75375s i2c driver, and add a detect callback to the new-style i2c driver to achieve the same functionality. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Riku Voipio <riku.voipio@movial.fi>
2008-04-29i2c: Convert most new-style drivers to use module aliasingJean Delvare
Based on earlier work by Jon Smirl and Jochen Friedrich. Update most new-style i2c drivers to use standard module aliasing instead of the old driver_name/type driver matching scheme. I've left the video drivers apart (except for SoC camera drivers) as they're a bit more diffcult to deal with, they'll have their own patch later. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Jon Smirl <jonsmirl@gmail.com> Cc: Jochen Friedrich <jochen@scram.de>
2008-04-29i2c: Add support for device alias namesJean Delvare
Based on earlier work by Jon Smirl and Jochen Friedrich. This patch allows new-style i2c chip drivers to have alias names using the official kernel aliasing system and MODULE_DEVICE_TABLE(). At this point, the old i2c driver binding scheme (driver_name/type) is still supported. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Jochen Friedrich <jochen@scram.de> Cc: Jon Smirl <jonsmirl@gmail.com> Cc: Kay Sievers <kay.sievers@vrfy.org>
2008-02-18hwmon: normal_i2c arrays should be constMark M. Hoffman
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-11-08hwmon: (f75375s) pwmX_mode sysfs files writable for f75375 variantRiku Voipio
Fix value check in set_pwm_mode(). Instead of checking for chip variant there, make pwmX_mode sysfs nodes only writable on f75375 variant. Signed-off-by: Riku Voipio <riku.voipio@movial.fi> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-11-08hwmon: (f75375s) Allow setting up fans with platform_dataRiku Voipio
Allow initializing fans on systems where BIOS does not do that by default. - define f75375s_platform_data in new file f75375s.h - if platform_data was provided, set fans accordingly in f75375_init() - split set_pwm_enable() to a sysfs callback and directly usable set_pwm_enable_direct() Signed-off-by: Riku Voipio <riku.voipio@movial.fi> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-11-08hwmon: (f75375s) Add new style bindingsRiku Voipio
Following the example of David Brownell's work on lm75: - Create a second driver struct, using new-style driver binding methods. - Rename the old driver struct as f75375_legacy_driver. - Make the legacy bind/unbind logic delegate all its work. Signed-off-by: Riku Voipio <riku.voipio@movial.fi> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-11-08hwmon: (f75375s) fix pwm mode settingRiku Voipio
Spotted by the Coverity checker. (Thanks Adrian Bunk) Signed-off-by: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-10-09hwmon: Convert from class_device to deviceTony Jones
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-09hwmon: Add f75375s driverRiku Voipio
Add support for Fintek F75375S/SP and F75373. Signed-off-by: Riku Voipio <riku.voipio@movial.fi> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>