hwmon: (i5k_amb) Convert to use devm_ functions

Convert to use devm_ functions to reduce code size and simplify the code.

Cc: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
hwmon: (ibmaem) Convert to use devm_ functions

Convert to use devm_ functions to reduce code size and simplify the code.

Cc: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
hwmon: (w83627ehf) Use fixed attributes for SYSTIN, CPUTIN, and AUXTIN on NCT6775/NCT6776

So far the code used dynamic temperature attributes for SYSTIN, CPUTIN, and
AUXTIN on NCT6775/NCT6776. That has the disadvantage that the mapping of
tempX_type and tempX_offset does not necessarily match reality, and code
complexity is increased.

To avoid mapping problems and simplify the code, use fixed mapping instead, and
use temp[4-9] for additional temperature sources.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
hwmon: (w83627ehf) Detect current and voltage mode for thermal diodes

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
hwmon: (w83627ehf) Add support for SmartFanIV mode on W83667HG-B

SmartFan IV mode is supported on W83667HG-B, but configured differently than
on other chips and not detected. As a result, changing the fan control mode
was impossible if SmartFan IV mode is selected.

Detect SmartFan IV mode and make it configurable if was configured at system
startup.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
hwmon: Driver for Nuvoton NCT6775F, NCT6776F, and NCT6779D

This driver will replace the w83627ehf driver for NCT6775F and NCT6776F,
and provides support for NCT6779D.

This patch provides support for voltage monitor attributes.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
hwmon: (nct6775) Add case open detection

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
hwmon: (nct6775) Add support for temperature sensors

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
hwmon: (nct6775) Add support for fan speed attributes

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
hwmon: (nct6775) Add support for fanX_pulses sysfs attribute

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
hwmon: (nct6775) Add support for fan debounce module parameter

If set, fan debounce is enabled when loading the driver.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
hwmon: (nct6775) Add power management support

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
hwmon: (nct6775) Add support for pwm, pwm_mode, and pwm_enable

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
hwmon: (nct6775) Add support for automatic fan control

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
hwmon: (nct6775) Add support for weighted fan control

The NCT677X series support weighted fan control. In this mode, a secondary
temperature source is used in addition to the primary temperature source to
control fan speed. Add support for this feature.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
hwmon: (nct6775) Detect and report additional temperature sources

Scan all temperature sources used for fan control and report if additional
monitoring registers are available.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
hwmon: (lm73) Add 'update_interval' attribute

The LM73 supports four A/D conversion resolutions.  The default used by
the existing lm73 driver is the chip's default, 11-bit (0.25 C/LSB).
This patch enables changing of this resolution from userspace via the
update_interval sysfs attribute.  Full details on usage are included in
Documentation/hwmon/lm73.

Signed-off-by: Chris Verges <kg4ysn@gmail.com>
[linux@roeck-us.net: cleanup]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
hwmon: (lm73) Add support for max/min alarms

Add support for temp1_min_alarm and temp1_max_alarm

Signed-off-by: Chris Verges <kg4ysn@gmail.com>
[linux@roeck-us.net: cleanup; dropped platform data and interrupt support]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
hwmon: (lm73) Fix lower and upper temperature limits

While the LM73 is only specified for temperatures from -40 to +150 degrees C,
its power-up minimum and maximum temperature limits are -256 and +255.75
degrees C. For better consistency and to avoid confusion, clamp limits to
the power-up limits and not to -40 / +150 degrees C.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
hwmon: (pmbus) Add support for additional voltage sensor

Some PMBus chips support monitoring an additional non-standard voltage. While
this voltage can in many cases be supported by simulating an additional sensor
page, this does not work in all cases. Specifically, it is problematic if the
data format is linear and the voltage is reported in LINEAR11 format. Since
output voltages use LINEAR16, and the exponent for LINEAR16 data is chip-wide
and fixed, this can result in overflows.

To solve this problem, add support for an additional virtual input voltage,
call it 'vmon', and treat this voltage as input voltage (which, when the chip
supports linear data format, uses LINEAR11).

Signed-off-by: Guenter Roeck <linux@roeck-us.net>