1
0
Fork 0
Commit Graph

1630 Commits (61ba031841ad60c4a9ea16b20dd46b6cdb0faf2a)

Author SHA1 Message Date
Guenter Roeck 61ba031841 hwmon: (vt8231) Fix multi-line comments
Cc: Roger Lucas <vt8231@hiddenengine.co.uk>
Acked-by: Roger Lucas <vt8231@hiddenengine.co.uk>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:49 -07:00
Guenter Roeck 9ed5bc24fa hwmon: (adt7475) Fix multi-line comments
Cc: Jean Delvare <khali@linux-fr.org>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:49 -07:00
Guenter Roeck 2fff0840c2 hwmon: (f71805f) Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
ERROR: "foo* bar" should be "foo *bar"
ERROR: need consistent spacing around '|' (ctx:VxW)
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead
WARNING: static const char * array should probably be static const char * const

Also modified multi-line comments to follow Documents/Codingstyle.

Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-18 18:26:48 -07:00
Guenter Roeck 703af96040 hwmon: (max6650) Fix multi-line comments
Cc: Hans J. Koch <hjk@hansjkoch.de>
Acked-by: Hans J. Koch <hjk@hansjkoch.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:47 -07:00
Guenter Roeck c531eb3f22 hwmon: (w83781d) Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
ERROR: "foo* bar" should be "foo *bar"
ERROR: space prohibited after that open parenthesis '('
ERROR: space required after that ',' (ctx:VxV)
ERROR: spaces required around that '==' (ctx:VxV)
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 '('

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

Not all fixed (code complexity):
ERROR: do not use assignment in if condition

Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:47 -07:00
Guenter Roeck 2b22de5117 hwmon: (adm1025) Fix checkpatch issues
Fixed:
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: trailing whitespace
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead

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

Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:46 -07:00
Guenter Roeck 79738416f6 hwmon: (abituguru3) Fix checkpatch issues
Fixed:
ERROR: do not use assignment in if condition
ERROR: "foo* bar" should be "foo *bar"
WARNING: line over 80 characters

Not fixed:
WARNING: msleep < 20ms can sleep for up to 20ms

Cc: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:45 -07:00
Guenter Roeck 65fe5c7957 hwmon: (vt8231) Fix checkpatch issues
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
ERROR: trailing statements should be on next line
WARNING: braces {} are not necessary for any arm of this statement
WARNING: line over 80 characters
WARNING: please, no space before tabs
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead

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

Cc: Roger Lucas <vt8231@hiddenengine.co.uk>
Acked-by: Roger Lucas <vt8231@hiddenengine.co.uk>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:45 -07:00
Guenter Roeck bafda5d0f5 hwmon: (max6650) Fix checkpatch issues
Fixed:
ERROR: do not use assignment in if condition
ERROR: open brace '{' following struct go on the same line
ERROR: spaces required around that '||' (ctx:VxV)
ERROR: switch and case should be at the same indent
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Cc: Hans J. Koch <hjk@hansjkoch.de>
Acked-by: Hans J. Koch <hjk@hansjkoch.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:44 -07:00
Guenter Roeck 0117c3f245 hwmon: (pmbus) Replace strict_strtol with kstrtol
strict_strtol is deprecated and results in a checkpatch warning.
Replace it with kstrtol.

Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-18 18:26:43 -07:00
Frans Meulenbroeks b3789a0de2 hwmon: (lm83) fix checkpatch issues
resolved:
ERROR: trailing whitespace
WARNING: please, no spaces at the start of a line
WARNING: simple_strtol is obsolete, use kstrtol instead
ERROR: do not use assignment in if condition

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:43 -07:00
Frans Meulenbroeks 93092a644f hwmon: (k8temp) fix checkpatch issues
resolved:
WARNING: line over 80 characters
ERROR: do not use assignment in if condition

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:42 -07:00
Frans Meulenbroeks 96585f1ae4 hwmon: (lm80) reset device if error occurred
If an error occurs while updating (e.g. because the chip was
disconnected) the device needs to be reinitialized in order
to get back to 11 bit temperature and set the fan divider.

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:42 -07:00
Frans Meulenbroeks 6a9e7c4c03 hwmon: (lm80) fix checkpatch warnings
fix:
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
[guenter.roeck@ericsson.com: kstrtol->kstrtoul where appropriate]
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:41 -07:00
Frans Meulenbroeks 6b904b623a hwmon: (adt7470) fix checkpatch issues
fixed:
ERROR: that open brace { should be on the previous line
#1135: FILE: adt7470.c:1135:
+static struct attribute *adt7470_attr[] =
+{

ERROR: do not use assignment in if condition
#1279: FILE: adt7470.c:1279:
+	if ((err = sysfs_create_group(&client->dev.kobj, &data->attrs)))

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:40 -07:00
Frans Meulenbroeks e6a83dbec9 hwmon: (adt7411) fix checkpatch issues
fixed:
WARNING: please, no space before tabs
#11: FILE: adt7411.c:11:
+ * ^I  use power-down mode for suspend?, interrupt handling?$

not fixed as all other macros around it are the same structure and this one is only 2 chars longer:
WARNING: line over 80 characters
#229: FILE: adt7411.c:229:
+static ADT7411_BIT_ATTR(fast_sampling, ADT7411_REG_CFG3, ADT7411_CFG3_ADC_CLK_225);

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:40 -07:00
Frans Meulenbroeks 56c24af8de hwmon: (lm70) fix checkpatch issues
fixed:
ERROR: spaces required around that '=' (ctx:VxV)
#60: FILE: lm70.c:60:
+	s16 raw=0;
 	       ^

ERROR: do not use assignment in if condition
#168: FILE: lm70.c:168:
+	if ((status = device_create_file(&spi->dev, &dev_attr_temp1_input))

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:39 -07:00
Frans Meulenbroeks 1dc370899f hwmon: (f71882fg) fix checkpatch issues
fixed:
WARNING: static const char * array should probably be static const char * const
+static const char *f71882fg_names[] = {

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:38 -07:00
Frans Meulenbroeks c6e8ac0405 hwmon: (asus_atk0110) fix checkpatch issues
fixed:
WARNING: line over 80 characters
#1321: FILE: asus_atk0110.c:1321:
+	if (data->rtmp_handle && data->rvlt_handle && data->rfan_handle && !new_if)

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:38 -07:00
Frans Meulenbroeks 99b8c83a77 hwmon: (adt7475) fix checkpatch issues
fixed:
WARNING: static const char * array should probably be static const char * const
+	static const char *names[] = {

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:37 -07:00
Frans Meulenbroeks b2ae8f87f4 hwmon: (smm665) fix checkpatch issues
fixed:
WARNING: please, no spaces at the start of a line
#379: FILE: smm665.c:379:
+  static ssize_t smm665_show_##what(struct device *dev, \$

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:36 -07:00
Frans Meulenbroeks c9e1498a18 hwmon: (sht15) fix checkpatch issues
fixed:
WARNING: line over 80 characters
#809: FILE: sht15.c:809:
+		/* If still not occurred or another handler has been scheduled */

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:36 -07:00
Frans Meulenbroeks 0910b28ef4 hwmon: (ibmaem) fix checkpatch issues
fixed:
WARNING: please, no space before tabs
+{"power3_average", ^I  aem2_show_pcap_value,^IPOWER_AUX},$

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:35 -07:00
Frans Meulenbroeks dcb7cb97ba hwmon: (ad7414) fix checkpatch issues
fixed:
WARNING: simple_strtol is obsolete, use kstrtol instead
#133: FILE: ad7414.c:133:
+	long temp = simple_strtol(buf, NULL, 10);

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:35 -07:00
Frans Meulenbroeks e91aef22cd hwmon: (ad7418) fix checkpatch issues
fixed:
WARNING: simple_strtol is obsolete, use kstrtol instead
+	long temp = simple_strtol(buf, NULL, 10);

ERROR: do not use assignment in if condition
+	if (!(data = kzalloc(sizeof(struct ad7418_data), GFP_KERNEL))) {

ERROR: do not use assignment in if condition
+	if ((err = sysfs_create_group(&client->dev.kobj, &data->attrs)))

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:34 -07:00
Frans Meulenbroeks 599654255d hwmon: (w83l785ts) fix checkpatch issues
fixed:
ERROR: trailing whitespace
+ $

WARNING: please, no spaces at the start of a line
+ $

not fixed (did not want to break url):
WARNING: line over 80 characters
+ *   http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/W83L785TS-S.pdf

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:33 -07:00
Frans Meulenbroeks a6100f6b49 hwmon: (wm831x-hwmon) fix checkpatch issues
fixed:
WARNING: static const char * array should probably be static const char * const
+static const char *input_names[] = {

not fixed (will probably provide separate fix later)
ERROR: Macros with multiple statements should be enclosed in a do - while loop
+#define WM831X_NAMED_VOLTAGE(id, name) \
+	WM831X_VOLTAGE(id, name); \
+	static SENSOR_DEVICE_ATTR(in##id##_label, S_IRUGO, show_label,	\
+				  NULL, name)

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:33 -07:00
Frans Meulenbroeks 839a9eefc9 hwmon: fix checkpatch issues
fixed:
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
+EXPORT_SYMBOL_GPL(hwmon_device_register);

WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
+EXPORT_SYMBOL_GPL(hwmon_device_unregister);

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:32 -07:00
Frans Meulenbroeks 08f5090774 hwmon: (adm1029) fix checkpatch issues
fixed:
ERROR: space prohibited after that open parenthesis '('
+#define DIV_FROM_REG(val)	( 1 << (((val) >> 6) - 1))

WARNING: simple_strtol is obsolete, use kstrtol instead
+	long val = simple_strtol(buf, NULL, 10);

ERROR: do not use assignment in if condition
+	if ((err = sysfs_create_group(&client->dev.kobj, &adm1029_group)))

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:31 -07:00
Frans Meulenbroeks 4d7c5d4f40 hwmon: (g760a) fix checkpatch issues
fixed:
ERROR: code indent should use tabs where possible
+            fan speed PWM controller chip$

ERROR: trailing whitespace
+      http://www.gmt.com.tw/product/datasheet/EDS-760A.pdf $

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:31 -07:00
Frans Meulenbroeks 7b102ed660 hwmon: (i5k_amb) fix checkpatch issues
fixed:
WARNING: simple_strtoul is obsolete, use kstrtoul instead
+	unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;

WARNING: simple_strtoul is obsolete, use kstrtoul instead
+	unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;

WARNING: simple_strtoul is obsolete, use kstrtoul instead
+	unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:30 -07:00
Frans Meulenbroeks 600151b9de hwmon: use DEFINE_PCI_DEVICE_TABLE
fix all checkpatch warnings about DEFINE_PCI_DEVICE_TABLE

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:29 -07:00
Frans Meulenbroeks 7fe83ad877 hwmon: remove () used with return
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-03-18 18:26:29 -07:00
Frans Meulenbroeks a6bee4a557 hwmon: (amc6821) fix initialisation
fix checkpatch error:
ERROR: do not initialise statics to 0 or NULL

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:28 -07:00
Frans Meulenbroeks 2faaa9316c hwmon: (lm80) add error handling
The LM80 driver currently does not return errors after I2C access failures.
Add it.

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-18 18:26:27 -07:00
Guenter Roeck fecfb64422 hwmon: (zl6100) Enable interval between chip accesses for all chips
Intersil reports that all chips supported by the zl6100 driver require
an interval between chip accesses, even ZL2004 and ZL6105 which were thought
to be safe.

Reported-by: Vivek Gani <vgani@intersil.com>
Cc: stable@vger.kernel.org # 3.2+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-14 09:17:03 -07:00
Jean Delvare aacb6b0052 hwmon: (w83627ehf) Fix temp2 source for W83627UHG
Properly set the source of temp2 for the W83627UHG. Also fix a
comment right before that, and document the W83627UHG as reporting up
to 3 temperatures.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-13 03:30:56 -07:00
Guenter Roeck 32260d9440 hwmon: (w83627ehf) Fix memory leak in probe function
The driver probe function leaked memory if creating the cpu0_vid attribute file
failed. Fix by converting the driver to use devm_kzalloc.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Cc: stable@vger.kernel.org # 2.6.32+
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-12 12:41:44 -07:00
Guenter Roeck 33fa9b6204 hwmon: (w83627ehf) Fix writing into fan_stop_time for NCT6775F/NCT6776F
NCT6775F and NCT6776F have their own set of registers for FAN_STOP_TIME. The
correct registers were used to read FAN_STOP_TIME, but writes used the wrong
registers. Fix it.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Cc: stable@vger.kernel.org # 3.0+
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-12 10:40:30 -07:00
Guenter Roeck 1bd612a258 hwmon: (jc42) Add support for AT30TS00, TS3000GB2, TSE2002GB2, and MCP9804
Also update IDT datasheet locations.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Cc: stable@vger.kernel.org # 3.0+
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-07 09:48:44 -08:00
Guenter Roeck 7ad6307ad6 hwmon: (zl6100) Maintain delay parameter in driver instance data
A global delay parameter has the side effect of being overwritten with 0 if a
single ZL2004 or ZL6105 is instantiated. If other chips supported by the same
driver are in the system, this will result in access errors for those chips.

To solve the problem, keep a per-instance copy of the delay parameter, and do
not change the original parameter.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Cc: stable@vger.kernel.org # 3.1+
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-07 09:48:43 -08:00
Guenter Roeck 7cb3c44fb1 hwmon: (pmbus_core) Fix maximum number of POUT alarm attributes
There are up to three POUT alarm attributes, not two, since cap_alarm was added.

Reported-by: Michele Petracca <mi.petracca@gmail.com>
Cc: stable@vger.kernel.org # 3.0+ [3.0 will need backport]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-07 09:48:42 -08:00
Jean Delvare 4de86126a7 hwmon: (jc42) Add support for ST Microelectronics STTS2002 and STTS3000
These are fully compatible with Jedec JC 42.4 as far as I can see.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: stable@vger.kernel.org # 3.0+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-07 09:48:21 -08:00
Nikolaus Schulz 15d1ad0cc9 hwmon: (f75375s) Catch some attempts to write to r/o registers
It makes no sense to attempt to manually configure the fan in auto mode,
or set the duty cycle directly in closed loop mode.  The corresponding
registers are then read-only.  If the user tries it nonetheless, error out
with EINVAL instead of silently doing nothing.

Signed-off-by: Nikolaus Schulz <mail@microschulz.de>
[guenter.roeck@ericsson.com: Minor formatting cleanup]
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-02 12:02:23 -08:00
Nikolaus Schulz b17d6561ac hwmon: (f75375s) Properly map the F75387 automatic modes to pwm_enable
The F75387 supports automatic fan control using either PWM duty cycle or
RPM speed values.  Make the driver detect the latter mode, and expose the
different modes in sysfs as per pwm_enable, so that the user can switch
between them.

The interpretation of the pwm_enable attribute for the F75387 is adjusted
to be a superset of those values used for similar Fintek chips which do
not support automatic duty mode, with 2 mapping to automatic speed mode,
and moving automatic duty mode to the new value 4.

Toggling the duty mode via pwm_enable is currently denied for the F75387,
as the chip then simply reinterprets the fan configuration register values
according to the new mode, switching between RPM and PWM units, which
makes this a dangerous operation.

This patch introduces a new pwm mode into the driver. This is necessary
because the new mode (automatic pwm mode, 4) may already be enabled by the
BIOS, and the driver should not break existing functionality. This was seen
on at least one board.

Signed-off-by: Nikolaus Schulz <mail@microschulz.de>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-03-02 11:56:43 -08:00
Nikolaus Schulz edeea10285 hwmon: (f75375s) Make pwm*_mode writable for the F75387
Signed-off-by: Nikolaus Schulz <mail@microschulz.de>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-02-28 14:44:02 -08:00
Nikolaus Schulz 331255d35d hwmon: (f75375s) Fix writes to the pwm* attribute for the F75387
For the F75387, the register holding the current PWM duty cycle value is
r/o; changing it requires writing to the fan expect register instead.

Signed-off-by: Nikolaus Schulz <mail@microschulz.de>
[guenter.roeck@ericsson.com: Simplified function parameters]
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-02-28 14:39:47 -08:00
Guenter Roeck dc91ad8e84 hwmon: (max34440) Fix resetting temperature history
Temperature history is reset by writing 0x8000 into the peak temperature
register, not 0xffff.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-02-24 08:06:15 -08:00
Nikolaus Schulz c1c1a3d012 hwmon: (f75375s) Fix register write order when setting fans to full speed
By hwmon sysfs interface convention, setting pwm_enable to zero sets a fan
to full speed.  In the f75375s driver, this need be done by enabling
manual fan control, plus duty mode for the F875387 chip, and then setting
the maximum duty cycle.  Fix a bug where the two necessary register writes
were swapped, effectively discarding the setting to full-speed.

Signed-off-by: Nikolaus Schulz <mail@microschulz.de>
Cc: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-02-23 06:47:47 -08:00
Guenter Roeck 363434b5dc hwmon: (ads1015) Fix file leak in probe function
An error while creating sysfs attribute files in the driver's probe function
results in an error abort, but already created files are not removed. This patch
fixes the problem.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: stable@vger.kernel.org # 3.0+
Cc: Dirk Eibach <eibach@gdsys.de>
Acked-by: Jean Delvare <khali@linux-fr.org>
2012-02-23 06:47:41 -08:00