aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/w83792d.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-05-24treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61Thomas Gleixner1-14/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 675 mass ave cambridge ma 02139 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 441 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc) Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190520071858.739733335@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-16hwmon: (w83792d) Remove duplicate NULL checkAndy Shevchenko1-10/+5
Since i2c_unregister_device() became NULL-aware we may remove duplicate NULL check. Cc: Jean Delvare <jdelvare@suse.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: linux-hwmon@vger.kernel.org Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (w83792d) use permission-specific DEVICE_ATTR variantsJulia Lawall1-8/+7
Use DEVICE_ATTR_RO for read only attributes and DEVICE_ATTR_RW for read/write attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-07-03hwmon: (w83792d) Additional PWM outputs supportRoger Lucas1-5/+22
Add pwm[4-7] and the associated pwm[4-7]_mode attributes. Signed-off-by: Roger Lucas <vt8231@hiddenengine.co.uk> Signed-off-by: Jean Delvare <jdelvare@suse.de>
2014-04-04hwmon: Avoid initializing the same field twiceJean Delvare1-1/+0
All hwmon drivers allocate their data structure with some form of kzalloc, so setting data fields to zero explicitly is a waste of time. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18hwmon: Correct some typosLABBE Corentin1-1/+1
Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-09-06hwmon: (w83792d) Update module authorShane Huang1-2/+2
w83792d was written by me in 2004, I'd like to update my first name into my current one to keep consistent, and delete invalid address. Signed-off-by: Shane Huang <shane.huang@amd.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2013-04-07hwmon: Fix checkpatch warning 'quoted string split across lines'Guenter Roeck1-6/+7
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>
2013-01-25hwmon: Replace SENSORS_LIMIT with clamp_valGuenter Roeck1-13/+12
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>
2012-11-05hwmon: Fix chip feature table headersJean Delvare1-1/+1
These got broken by recent patches fixing checkpatch warnings in these drivers. The trick is that the patches themselves looked good, but the source files after applying them do not. That's why I am not a big fan of using tabs inside comments. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <linux@roeck-us.net>
2012-10-10hwmon: Add missing inclusions of <linux/jiffies.h>Jean Delvare1-0/+1
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>
2012-09-23hwmon: (w83792d) Remove legacy chassis intrusion detection attributesGuenter Roeck1-56/+2
Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Jean Delvare <khali@linux-fr.org>
2012-07-21hwmon: (w83792d) Convert to use devm_ functionsGuenter Roeck1-12/+6
Convert to use devm_ functions to reduce code size and simplify the code. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-18hwmon: (w83792d) Fix checkpatch issuesGuenter Roeck1-148/+229
Fixed: ERROR: code indent should use tabs where possible ERROR: do not use assignment in if condition ERROR: space prohibited after that open parenthesis '(' ERROR: space required after that ',' (ctx:VxV) ERROR: space required after that ',' (ctx:WxV) ERROR: spaces required around that ':' (ctx:VxE) ERROR: spaces required around 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: spaces required around that '||' (ctx:VxV) ERROR: spaces required around that ':' (ctx:VxV) ERROR: spaces required around that '?' (ctx:VxV) WARNING: braces {} are not necessary for any arm of this statement WARNING: braces {} are not necessary for single statement blocks WARNING: line over 80 characters WARNING: simple_strtol is obsolete, use kstrtol instead WARNING: simple_strtoul is obsolete, use kstrtoul instead WARNING: space prohibited between function name and open parenthesis '(' Modify multi-line comments to follow Documentation/CodingStyle. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18hwmon: convert drivers/hwmon/* to use module_i2c_driver()Axel Lin1-15/+1
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>
2012-03-18hwmon: remove () used with returnFrans Meulenbroeks1-2/+2
fix checkpatch ERROR: return is not a function, parentheses are not required Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-13module_param: make bool parameters really bool (drivers & misc)Rusty Russell1-1/+1
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>
2012-01-05hwmon: replaced strict_str* with kstr*Frans Meulenbroeks1-1/+1
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>
2011-03-31Fix common misspellingsLucas De Marchi1-1/+1
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-01-12hwmon: (w83792d) Implement the standard intrusion detection interfaceJean Delvare1-3/+41
We have a standard intrusion detection interface now, drivers should implement it. I've left the old interface in place for the time being, with a deprecation warning, it will be removed later. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2009-12-14i2c: Drop I2C_CLIENT_INSMOD_1Jean Delvare1-2/+1
This macro simply declares an enum, so drivers might as well declare it themselves. 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 Delvare1-1/+1
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 Delvare1-2/+2
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: (w83792d) Clean up detect functionJean Delvare1-43/+18
As kind is now hard-coded to -1, there is room for code clean-ups. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07hwmon: Don't overuse I2C_CLIENT_MODULE_PARMJean Delvare1-1/+4
I2C_CLIENT_MODULE_PARM is overkill for force_subclients. We really only use 4 out of the 48 slots, so we're better defining a custom variable instead. This change saves 92 bytes of data for each of the five drivers affected. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Wolfgang Grandegger <wg@grandegger.com> Acked-by: Marc Hulsman <m.hulsman@tudelft.nl> Cc: Mark M. Hoffman <mhoffman@lightlink.com>
2008-07-16hwmon: (w83792d) Convert to a new-style i2c driverJean Delvare1-142/+72
The new-style w83792d driver implements the optional detect() callback to cover the use cases of the legacy driver. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-02-18hwmon: normal_i2c arrays should be constMark M. Hoffman1-1/+2
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-10-18Add missing newlines to some uses of dev_<level> messagesJoe Perches1-2/+2
Found these while looking at printk uses. Add missing newlines to dev_<level> uses Add missing KERN_<level> prefixes to multiline dev_<level>s Fixed a wierd->weird spelling typo Added a newline to a printk Signed-off-by: Joe Perches <joe@perches.com> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: Mark M. Hoffman <mhoffman@lightlink.com> Cc: Roland Dreier <rolandd@cisco.com> Cc: Tilman Schmidt <tilman@imap.cc> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Jeff Garzik <jeff@garzik.org> Cc: Stephen Hemminger <shemminger@linux-foundation.org> Cc: Greg KH <greg@kroah.com> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Cc: James Smart <James.Smart@Emulex.Com> Cc: Andrew Vasquez <andrew.vasquez@qlogic.com> Cc: "Antonino A. Daplas" <adaplas@pol.net> Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Jaroslav Kysela <perex@suse.cz> Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-09hwmon: Convert from class_device to deviceTony Jones1-5/+5
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: (w83792d) Add individual alarm filesGong Jun1-1/+48
w83792d: add individual alarm files for the new libsensors. Signed-off-by: Gong Jun <jgong@winbond.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2006-12-12hwmon: Update Rudolf Marek's e-mail addressJean Delvare1-1/+1
The Silicon Hill club is not what it used to be. Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2006-09-28w83792d: Fix unchecked return statusRudolf Marek1-231/+323
w83792d: Fix unchecked return status Fix the w83792d driver. Add error checking to device_create_file and also care to destroy the files upon exit. Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-06-30Remove obsolete #include <linux/config.h>Jörn Engel1-1/+0
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-06-26spelling fixesAndreas Mohr1-1/+1
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>
2006-06-22[PATCH] w83792d: Add missing data access locksYuan Mu1-5/+25
Add missing data lock in w83792d driver to avoid unexpected data change. Signed-off-by: Yuan Mu <ymu@winbond.com.tw> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-06-22[PATCH] w83792d: Fix setting the PWM valueYuan Mu1-27/+29
W83792D use pwm register low 4 bits to store PWM/DC value, bit 7 is used to store fan PWM/DC mode. The store_pwm function did not convert the pwm input correctly, so it may change the fan mode when new value is set. This fix the problem. Change the "index" value of pwm*_mode and pwm* SENSOR_ATTR to simplify code. Signed-off-by: Yuan Mu <ymu@winbond.com.tw> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-04-14[PATCH] w83792d: Be quiet on misdetectionJean Delvare1-2/+3
Make the w83792d driver keep quiet when misdetecting a chip. This can happen, and the user doesn't need to know. Also renumber the messages, and add one, for consistency. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-03-23[PATCH] hwmon: Semaphore to mutex conversionsIngo Molnar1-4/+5
convert drivers/hwmon/*.c semaphore use to mutexes. the conversion was generated via scripts, and the result was validated automatically via a script as well. all affected hwmon drivers were build-tested. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-03-23[PATCH] hwmon: w83792d drop useless macrosJean Delvare1-21/+3
Drop 3 useless macros in the w83792d hardware monitoring driver. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-03-23[PATCH] hwmon: w83792d use arrays of attributesYuan Mu1-284/+241
Use arrays of attributes in the w83792d driver. Signed-off-by: Jim Cromie <jim.cromie@gmail.com> Signed-off-by: Yuan Mu <ymu@winbond.com.tw> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-02-06[PATCH] hwmon: Inline w83792d register access functionsJean Delvare1-17/+14
Inline w83792d_{read,write}_value for better performance. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Yuan Mu <Ymu@winbond.com.tw> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-05[PATCH] hwmon: w83792d simplify in low bits handlingJean Delvare1-38/+10
Simplify the way the w83792d driver handles the extra resolution bits of voltage input channels. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Yuan Mu <Ymu@winbond.com.tw> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-05[PATCH] hwmon: w83792d misc cleanupsJean Delvare1-20/+9
Cleanup the w83792d driver a bit: * Discard unused lock and irrelevant comments inherited from the w83781d driver. * Simplify w83792d_{read,write}_value functions. * Drop useless address test during detection. * Drop useless bitmasking. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Yuan Mu <Ymu@winbond.com.tw> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-05[PATCH] I2C: Remove .owner setting from i2c_driver as it's no longer neededGreg Kroah-Hartman1-1/+0
Now that i2c_add_driver() doesn't need the module owner to be set by hand, we can delete it from the drivers. This patch catches all of the drivers that I found in the current tree (if a driver sets the .owner by hand, it's not a problem, just not needed.) Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Cc: Jean Delvare <khali@linux-fr.org>
2006-01-05[PATCH] i2c: Drop i2c_driver.{owner,name}, 3 of 11Laurent Riffard1-2/+4
We should use the i2c_driver.driver's .name and .owner fields instead of the i2c_driver's ones. This patch updates the hwmon drivers. Signed-off-by: Laurent Riffard <laurent.riffard@free.fr> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-05[PATCH] i2c: Drop i2c_driver.flags, 2 of 3Jean Delvare1-1/+0
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>
2005-11-29[PATCH] hwmon: w83792d fix unused fan pinsJean Delvare1-7/+18
1. This patch add check for fan4,5,6,7 and do not create device file if their pins are not configured as fan. 2. Fix the issue that can not set fan divisor to 128. 3. Fix the index out of bounds bug in w83792d_detect function. Signed-off-by: Yuan Mu <ymu@winbond.com.tw> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28[PATCH] hwmon: kzalloc conversionDeepak Saxena1-4/+2
Use kzalloc instead of kmalloc+memset in all hardware monitoring drivers. Signed-off-by: Deepak Saxena <dsaxena@plexity.net> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28[PATCH] hwmon: Discard bogus comment about init setting limitsJean Delvare1-1/+0
Discard a common out-of-date comment in 5 hardware monitoring drivers. The hardware monitoring chip drivers are no more setting sensor limits at initialization time, for quite some time already. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> drivers/hwmon/lm78.c | 1 - drivers/hwmon/via686a.c | 1 - drivers/hwmon/w83627hf.c | 1 - drivers/hwmon/w83781d.c | 1 - drivers/hwmon/w83792d.c | 1 - 5 files changed, 5 deletions(-)
2005-09-05[PATCH] hwmon: hwmon vs i2c, second round (07/11)Jean Delvare1-1/+0
The only part left in i2c-sensor is the VRM/VRD/VID handling code. This is in no way related to i2c, so it doesn't belong there. Move the code to hwmon, where it belongs. Note that not all hardware monitoring drivers do VRM/VRD/VID operations, so less drivers depend on hwmon-vid than there were depending on i2c-sensor. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>