aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/dme1737.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-10-04Merge tag 'hwmon-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-stagingLinus Torvalds1-1/+1
Pull hwmon updates from Guenter Roeck: "New drivers: - Driver for MAX31760 fan speed controller - Driver for TEXAS TPS546D24 Buck Converter - Driver for EMC2301/2/3/5 RPM-based PWM Fan Speed Controller Removed drivers: - Drop obsolete asus_wmi_ec_sensors driver Cleanups, affecting various drivers: - Use DEFINE_SIMPLE_DEV_PM_OPS where appropriate - Remove forward declarations - Move from strlcpy with unused retval to strscpy - Make use of devm_clk_get_enabled() - Drop devm_of_pwm_get() Other notable cleanup and improvements: - Support for additional USB devide ID and support for reporting of rail mode via debugfs added to corsair-psu driver - Support for aditional USB ID in nzxt-smart2 driver - Support for Aquacomputer High Flow Next in aquacomputer_d5next driver - Major cleanup of pwm-fan driver - Major cleanup of mr75203 driver, and added support for new device revision And various other minor fixes and cleanups" * tag 'hwmon-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (86 commits) hwmon: (corsair-psu) add USB id of new revision of the HX1000i psu hwmon: (pmbus/mp2888) Fix sensors readouts for MPS Multi-phase mp2888 controller dt-bindings: hwmon: sensirion,shtc1: Clean up spelling mistakes and grammar hwmon: (nct6683) remove unused variable in nct6683_create_attr_group hwmon: w83627hf: Reorder symbols to get rid of a few forward declarations hwmon: (ina3221) Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() hwmon: (w83627ehf) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (tmp108) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (tmp103) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (tmp102) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (pwm-fan) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (nct6775) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (max6639) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (max31730) witch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (max31722) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (ltc2947) Switch to EXPORT_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (lm90) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (it87) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (gpio-fan) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() hwmon: (adt7x10) Switch to EXPORT_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() ...
2022-09-19hwmon: move from strlcpy with unused retval to strscpyWolfram Sang1-1/+1
Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/20220818210014.6769-1-wsa+renesas@sang-engineering.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-08-16i2c: Make remove callback return voidUwe Kleine-König1-3/+1
The value returned by an i2c driver's remove function is mostly ignored. (Only an error message is printed if the value is non-zero that the error is ignored.) So change the prototype of the remove function to return no value. This way driver authors are not tempted to assume that passing an error to the upper layer is a good idea. All drivers are adapted accordingly. There is no intended change of behaviour, all callbacks were prepared to return 0 before. Reviewed-by: Peter Senna Tschudin <peter.senna@gmail.com> Reviewed-by: Jeremy Kerr <jk@codeconstruct.com.au> Reviewed-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Crt Mori <cmo@melexis.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Marek Behún <kabel@kernel.org> # for leds-turris-omnia Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Petr Machata <petrm@nvidia.com> # for mlxsw Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com> # for surface3_power Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> # for bmc150-accel-i2c + kxcjk-1013 Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> # for media/* + staging/media/* Acked-by: Miguel Ojeda <ojeda@kernel.org> # for auxdisplay/ht16k33 + auxdisplay/lcd2s Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # for versaclock5 Reviewed-by: Ajay Gupta <ajayg@nvidia.com> # for ucsi_ccg Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> # for iio Acked-by: Peter Rosin <peda@axentia.se> # for i2c-mux-*, max9860 Acked-by: Adrien Grassein <adrien.grassein@gmail.com> # for lontium-lt8912b Reviewed-by: Jean Delvare <jdelvare@suse.de> # for hwmon, i2c-core and i2c/muxes Acked-by: Corey Minyard <cminyard@mvista.com> # for IPMI Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com> # for drivers/power Acked-by: Krzysztof Hałasa <khalasa@piap.pl> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2021-10-12hwmon: cleanup non-bool "valid" data fieldsPaul Fertser1-2/+2
We have bool so use it consistently in all the drivers. The following Coccinelle script was used: @@ identifier T; type t = { char, int }; @@ struct T { ... - t valid; + bool valid; ... } @@ identifier v; @@ ( - v->valid = 0 + v->valid = false | - v->valid = 1 + v->valid = true ) followed by sed to fixup the comments: sed '/bool valid;/{s/!=0/true/;s/zero/false/}' Few whitespace changes were fixed manually. All modified drivers were compile-tested. Signed-off-by: Paul Fertser <fercerpav@gmail.com> Link: https://lore.kernel.org/r/20210924195202.27917-1-fercerpav@gmail.com [groeck: Fixed up 'u8 valid' to 'boool valid' in atxp1.c] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2020-09-23hwmon: (dme1737) use simple i2c probeStephen Kitt1-4/+5
As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20200821160035.590142-1-steve@sk2.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
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-01-10hwmon: (dme1737) Fix overflows seen when writing into limit attributesGuenter Roeck1-12/+16
Writes into voltage limit, temperature limit, temperature hysteresis, and temperature zone attributes can overflow due to unclamped parameters to multiplications, additions, and subtractions. Cc: Juerg Haefliger <juergh@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (dme1737) use permission-specific DEVICE_ATTR variantsJulia Lawall1-9/+9
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>
2014-10-20hwmon: drop owner assignment from platform_driversWolfram Sang1-1/+0
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-08-05hwmon: (dme1737) Prevent overflow problem when writing large limitsAxel Lin1-15/+18
On platforms with sizeof(int) < sizeof(long), writing a temperature limit larger than MAXINT will result in unpredictable limit values written to the chip. Avoid auto-conversion from long to int to fix the problem. Voltage limits, fan minimum speed, pwm frequency, pwm ramp rate, and other attributes have the same problem, fix them as well. Zone temperature limits are signed, but were cached as u8, causing unepected values to be reported for negative temperatures. Cache as s8 to fix the problem. vrm is an u8, so the written value needs to be limited to [0, 255]. Signed-off-by: Axel Lin <axel.lin@ingics.com> [Guenter Roeck: Fix zone temperature cache] Cc: stable@vger.kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07hwmon: Fix checkpatch warning 'quoted string split across lines'Guenter Roeck1-34/+34
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-8/+7
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-28hwmon: remove use of __devexitBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Jean Delvare <khali@linux-fr.org> Cc: Alistair John Strachan <alistair@devzero.co.uk> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Juerg Haefliger <juergh@gmail.com> Cc: Andreas Herrmann <herrmann.der.user@googlemail.com> Cc: Clemens Ladisch <clemens@ladisch.de> Cc: Rudolf Marek <r.marek@assembler.cz> Cc: Jim Cromie <jim.cromie@gmail.com> Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> Cc: Roger Lucas <vt8231@hiddenengine.co.uk> Acked-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-28hwmon: remove use of __devinitBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Jean Delvare <khali@linux-fr.org> Cc: Alistair John Strachan <alistair@devzero.co.uk> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Juerg Haefliger <juergh@gmail.com> Cc: Andreas Herrmann <herrmann.der.user@googlemail.com> Cc: Clemens Ladisch <clemens@ladisch.de> Cc: Rudolf Marek <r.marek@assembler.cz> Cc: Jim Cromie <jim.cromie@gmail.com> Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> Cc: Roger Lucas <vt8231@hiddenengine.co.uk> Acked-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-28hwmon: remove use of __devexit_pBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Jean Delvare <khali@linux-fr.org> Cc: Alistair John Strachan <alistair@devzero.co.uk> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Juerg Haefliger <juergh@gmail.com> Cc: Andreas Herrmann <herrmann.der.user@googlemail.com> Cc: Clemens Ladisch <clemens@ladisch.de> Cc: Rudolf Marek <r.marek@assembler.cz> Cc: Jim Cromie <jim.cromie@gmail.com> Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> Cc: Roger Lucas <vt8231@hiddenengine.co.uk> Acked-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-23hwmon: (dme1737) Convert to use devm_ functionsGuenter Roeck1-32/+13
Convert to use devm_ functions to reduce code size and simplify the code. Cc: Juerg Haefliger <juergh@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18hwmon: (dme1737) Fix checkpatch issuesGuenter Roeck1-216/+290
Fixed: WARNING: braces {} are not necessary for any arm of this statement WARNING: braces {} are not necessary for single statement blocks WARNING: simple_strtol is obsolete, use kstrtol instead 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: Juerg Haefliger <juergh@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-01-13module_param: make bool parameters really bool (drivers & misc)Rusty Russell1-2/+2
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-03switch sysfs_chmod_file() to umode_tAl Viro1-3/+3
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2011-01-12hwmon: (dme1737) Minor cleanupsJuerg Haefliger1-48/+73
Minor cleanups. Mostly removing assignments in if statements to get rid of checkpatch errors. Signed-off-by: Juerg Haefliger <juergh@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2011-01-12hwmon: (dme1737) Add support for in7 for SCH5127Juerg Haefliger1-15/+53
Add support for the 1.5V voltage monitoring input (in7) of the SMSC SCH5127 chip. Signed-off-by: Juerg Haefliger <juergh@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2011-01-08hwmon: (dme1737) Use pr_fmt and pr_<level>Joe Perches1-6/+6
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>
2010-05-27hwmon: (dme1737) Add SCH5127 supportJuerg Haefliger1-103/+225
Add support for the hardware monitoring capabilities of the SCH5127 chip to the dme1737 driver. Signed-off-by: Juerg Haefliger <juergh@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Jeff Rickman <jrickman@myamigos.us>
2009-12-14i2c: Drop I2C_CLIENT_INSMOD_2 to 8Jean Delvare1-5/+1
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 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-1/+1
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 Delvare1-21/+11
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-10-24hwmon: (dme1737) No vid attributes for SCH311xJean Delvare1-5/+24
The SCH311x chips do not have VID inputs, so the cpu0_vid and vrm attributes shouldn't be created for them. This fixes lm-sensors ticket #2353: http://www.lm-sensors.org/ticket/2353 Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Udo van den Heuvel <udovdh@xs4all.nl> Cc: Juerg Haefliger <juergh@gmail.com>
2009-09-23dme1737: Keep index within pwm_config[]Roel Kluin1-1/+1
The static code scanner "Parfait" reported this because pwm_config is only 3 bytes - pwm_config[3] is out of range. Since this code path is never called with ix == 3 (the device has no PWM4 output) this doesn't change anything in practice. But to encourage testing with Parfait, lets make the warning go away... Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-15hwmon: Include <linux/io.h> instead of <asm/io.h>H Hartley Sweeten1-1/+1
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>
2009-01-07hwmon: Check for ACPI resource conflictsJean Delvare1-0/+5
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>
2008-10-14hwmon: (dme1737) Convert to a new-style i2c driverJean Delvare1-58/+48
The new-style dme1737 driver implements the optional detect() callback to cover the use cases of the legacy driver. I don't actually expect any new-style device for that driver, but as the old i2c API is going away soon, we have to switch to the new one. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Juerg Haefliger <juergh@gmail.com>
2008-10-14hwmon: (dme1737) Be less i2c-centricJean Delvare1-115/+111
The dme1737 driver support both LPC (ISA) and SMBus devices. At the moment it's rather i2c-centric, and LPC variants use a fake i2c_client for some operations. In a near future, i2c_client will be allocated by i2c-core rather than by the device drivers, so non-i2c drivers will not have one. As a preparation step, change the driver code to no longer assume that an i2c_client structure is always available. No functional change. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Juerg Haefliger <juergh@gmail.com>
2008-08-06hwmon: (dme1737) Add support for the SMSC SCH5027Juerg Haefliger1-63/+130
Add support for the SCH5027. The differences to the DME1737 are: - No support for programmable temp offsets - In auto mode, PWM outputs stay on min value if temp goes below low threshold and can't be programmed to fully turn off - Different voltage scaling - No VID input Signed-off-by: Juerg Haefliger <juergh@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-08-06hwmon: (dme1737) Skip detection if forcedJuerg Haefliger1-6/+9
Skip the checking of the device ID register in the hwmon register block if the force_id option is used. Signed-off-by: Juerg Haefliger <juergh@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-08-06hwmon: (dme1737) CleanupsJuerg Haefliger1-47/+47
Fix names of attribute structs to make them more consistent with the rest of the code. Minor comment changes. Signed-off-by: Juerg Haefliger <juergh at gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-07-31hwmon: (dme1737) fix voltage scalingJuerg Haefliger1-11/+21
This patch fixes a voltage scaling issue for the sch311x device. Signed-Off-By: Juerg Haefliger <juergh at gmail.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-07-31hwmon: (dme1737) probe all addressesJuerg Haefliger1-1/+9
This patch adds a module load parameter to enable probing of non-standard LPC addresses 0x162e and 0x164e when scanning for supported ISA chips. Signed-Off-By: Juerg Haefliger <juergh at gmail.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-07-31hwmon: (dme1737) demacrofy for readabilityJuerg Haefliger1-101/+154
This patch gets rid of a couple of macros previously used for sysfs attribute generation and manipulation. This makes the source a little bigger but a lot more readable and maintainable. It also fixes an issue with pwm5 & pwm6 attributes not being created read-only initially. Signed-Off-By: Juerg Haefliger <juergh at gmail.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-18hwmon: normal_i2c arrays should be constMark M. Hoffman1-1/+1
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-07hwmon: (dme1737) fix Super-IO device ID overrideJuerg Haefliger1-1/+1
The dme1737 has a second place where the Super-IO device ID is checked. This has been missed by Jean's initial patch that adds support for user-controlled Super-IO device ID override. This patch fixes this issue. Signed-off-by: Juerg Haefliger <juergh at gmail.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-07hwmon: (dme1737) fix divide-by-0Juerg Haefliger1-4/+11
This patch fixes a possible divide-by-0 and a minor bug in the FAN_FROM_REG macro (in TPC mode). Signed-off-by: Juerg Haefliger <juergh at gmail.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2008-02-07hwmon: Let the user override the detected Super-I/O device IDJean Delvare1-1/+5
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>
2007-10-10hwmon: (dme1737) Add sch311x supportJuerg Haefliger1-41/+334
This patch adds support for the SMSC SCH3112, SCH3114, and SCH3116 Super-I/O chips. These chips feature identical hardware monitoring capabilites with the expection that some of the fan inputs and pmw outputs don't exist. The hardware monitoring features of the SCH311x chips can only be accessed via the ISA bus. The driver therefore registers as a platform driver, if such a chip is detected. Signed-off-by: Juerg Haefliger <juergh at gmail.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-10-10hwmon: (dme1737) Fix some merge conflictsMark M. Hoffman1-277/+312
class_dev -> hwmon_dev Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-10-10hwmon: (dme1737) group functions logicallyJuerg Haefliger1-48/+58
Move functions to group them logically. Device and I2C functions go in separate places. No functional changes (really!). Signed-off-by: Juerg Haefliger <juergh at gmail.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-10-10hwmon: (dme1737) cleanupsJuerg Haefliger1-233/+258
This patch cleans up and prepares the dme1737 driver for support of the sch311x chips. (Almost) no functional changes. - Replaced whitespaces with tabs. - Removed empty lines. - Added _i2c_ to names of functions that are strictly I2C related. - Added 4 new functions: dme1737_create_files, dme1737_remove_files, dme1737_sio_enter, and dme1737_sio_exit. - Added error messages in case client attach/detach fails. Signed-off-by: Juerg Haefliger <juergh at gmail.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
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-07-30hwmon: fix dme1737 temp fault attributeJuerg Haefliger1-1/+1
Fix temp?_fault attribute. The temp was incorrectly compared against 0x0800 rather than 0x8000. Only the upper 8 bits are compared as the datasheet doesn't specify what happens to the lower bits in case of a diode fault. Signed-off-by: Juerg Haefliger <juergh at gmail.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-07-19hwmon: New SMSC DME1737 driverJuerg Haefliger1-0/+2080
Add support for the hardware monitoring and fan control capabilities of the SMSC DME1737 and Asus A8000 Super-I/O chips. The hardware monitoring logic of this chip is similar to the LM85 but has some additional features that this driver supports. Even though it's a Super-I/O chip, the hardware monitoring logic can only be accessed via SMBus. Signed-off-by: Juerg Haefliger <juergh at gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>