Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bdbf0ac7 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6

* 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: (47 commits)
  hwmon: (adm1026) Prevent log spamming
  hwmon: (adm1026) Fix debug messages
  hwmon: (adm1029) Use mask for fan_div value
  hwmon: (adt7470) Add documentation
  hwmon: (ibmaem) Automatically load on IBM systems via DMI
  hwmon: (ibmpex) Automatically load on IBM systems via DMI
  hwmon: (w83781d) Use new style driver binding
  hwmon: (w83781d) Stop abusing struct i2c_client for ISA devices
  hwmon: (w83781d) Make ISA interface depend on CONFIG_ISA
  hwmon: (w83781d) Additional information about AS99127F PWM
  hwmon: (w83781d) Detect alias chips
  hwmon: (w83781d) Refactor beep enable handling
  hwmon: Drop dead links to old National Semiconductor chip datasheets
  hwmon: (w83791d) add support for thermal cruise mode
  hwmon: (w83791d) add pwm_enable support
  hwmon: (w83791d) add manual PWM support
  hwmon: (w83791d) fan 4/5 pins can also be used for gpio
  hwmon: (max1619) Use inline functions instead of macros
  hwmon: (it87) Fix thermal sensor type values
  hwmon: (lm78) Convert to a new-style i2c driver
  ...
parents 8eb88c80 a0cf354a
Loading
Loading
Loading
Loading
+76 −0
Original line number Diff line number Diff line
Kernel driver adt7470
=====================

Supported chips:
  * Analog Devices ADT7470
    Prefix: 'adt7470'
    Addresses scanned: I2C 0x2C, 0x2E, 0x2F
    Datasheet: Publicly available at the Analog Devices website

Author: Darrick J. Wong

Description
-----------

This driver implements support for the Analog Devices ADT7470 chip.  There may
be other chips that implement this interface.

The ADT7470 uses the 2-wire interface compatible with the SMBus 2.0
specification. Using an analog to digital converter it measures up to ten (10)
external temperatures. It has four (4) 16-bit counters for measuring fan speed.
There are four (4) PWM outputs that can be used to control fan speed.

A sophisticated control system for the PWM outputs is designed into the ADT7470
that allows fan speed to be adjusted automatically based on any of the ten
temperature sensors. Each PWM output is individually adjustable and
programmable. Once configured, the ADT7470 will adjust the PWM outputs in
response to the measured temperatures with further host intervention.  This
feature can also be disabled for manual control of the PWM's.

Each of the measured inputs (temperature, fan speed) has corresponding high/low
limit values. The ADT7470 will signal an ALARM if any measured value exceeds
either limit.

The ADT7470 DOES NOT sample all inputs continuously.  A single pin on the
ADT7470 is connected to a multitude of thermal diodes, but the chip must be
instructed explicitly to read the multitude of diodes.  If you want to use
automatic fan control mode, you must manually read any of the temperature
sensors or the fan control algorithm will not run.  The chip WILL NOT DO THIS
AUTOMATICALLY; this must be done from userspace.  This may be a bug in the chip
design, given that many other AD chips take care of this.  The driver will not
read the registers more often than once every 5 seconds.  Further,
configuration data is only read once per minute.

Special Features
----------------

The ADT7470 has a 8-bit ADC and is capable of measuring temperatures with 1
degC resolution.

The Analog Devices datasheet is very detailed and describes a procedure for
determining an optimal configuration for the automatic PWM control.

Configuration Notes
-------------------

Besides standard interfaces driver adds the following:

* PWM Control

* pwm#_auto_point1_pwm and pwm#_auto_point1_temp and
* pwm#_auto_point2_pwm and pwm#_auto_point2_temp -

point1: Set the pwm speed at a lower temperature bound.
point2: Set the pwm speed at a higher temperature bound.

The ADT7470 will scale the pwm between the lower and higher pwm speed when
the temperature is between the two temperature boundaries.  PWM values range
from 0 (off) to 255 (full speed).  Fan speed will be set to maximum when the
temperature sensor associated with the PWM control exceeds
pwm#_auto_point2_temp.

Notes
-----

As stated above, the temperature inputs must be read periodically from
userspace in order for the automatic pwm algorithm to run.
+2 −2
Original line number Diff line number Diff line
@@ -136,10 +136,10 @@ once-only alarms.
The IT87xx only updates its values each 1.5 seconds; reading it more often
will do no harm, but will return 'old' values.

To change sensor N to a thermistor, 'echo 2 > tempN_type' where N is 1, 2,
To change sensor N to a thermistor, 'echo 4 > tempN_type' where N is 1, 2,
or 3. To change sensor N to a thermal diode, 'echo 3 > tempN_type'.
Give 0 for unused sensor. Any other value is invalid. To configure this at
startup, consult lm_sensors's /etc/sensors.conf. (2 = thermistor;
startup, consult lm_sensors's /etc/sensors.conf. (4 = thermistor;
3 = thermal diode)


+0 −10
Original line number Diff line number Diff line
@@ -163,16 +163,6 @@ configured individually according to the following options.
* pwm#_auto_pwm_min - this specifies the PWM value for temp#_auto_temp_off
                      temperature. (PWM value from 0 to 255)

* pwm#_auto_pwm_freq - select base frequency of PWM output. You can select
                       in range of 10.0 to 94.0 Hz in .1 Hz units.
		       (Values 100 to 940).

The pwm#_auto_pwm_freq can be set to one of the following 8 values. Setting the
frequency to a value not on this list, will result in the next higher frequency
being selected. The actual device frequency may vary slightly from this
specification as designed by the manufacturer. Consult the datasheet for more
details. (PWM Frequency values:  100, 150, 230, 300, 380, 470, 620, 940)

* pwm#_auto_pwm_minctl - this flags selects for temp#_auto_temp_off temperature
                         the bahaviour of fans. Write 1 to let fans spinning at
			 pwm#_auto_pwm_min or write 0 to let them off.
+4 −5
Original line number Diff line number Diff line
@@ -65,11 +65,10 @@ The LM87 has four pins which can serve one of two possible functions,
depending on the hardware configuration.

Some functions share pins, so not all functions are available at the same
time. Which are depends on the hardware setup. This driver assumes that
the BIOS configured the chip correctly. In that respect, it differs from
the original driver (from lm_sensors for Linux 2.4), which would force the
LM87 to an arbitrary, compile-time chosen mode, regardless of the actual
chipset wiring.
time. Which are depends on the hardware setup. This driver normally
assumes that firmware configured the chip correctly. Where this is not
the case, platform code must set the I2C client's platform_data to point
to a u8 value to be written to the channel register.

For reference, here is the list of exclusive functions:
 - in0+in5 (default) or temp3
+29 −16
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ Supported chips:
    Prefix: 'lm99'
    Addresses scanned: I2C 0x4c and 0x4d
    Datasheet: Publicly available at the National Semiconductor website
               http://www.national.com/pf/LM/LM89.html
               http://www.national.com/mpf/LM/LM89.html
  * National Semiconductor LM99
    Prefix: 'lm99'
    Addresses scanned: I2C 0x4c and 0x4d
@@ -21,18 +21,32 @@ Supported chips:
    Prefix: 'lm86'
    Addresses scanned: I2C 0x4c
    Datasheet: Publicly available at the National Semiconductor website
               http://www.national.com/pf/LM/LM86.html
               http://www.national.com/mpf/LM/LM86.html
  * Analog Devices ADM1032
    Prefix: 'adm1032'
    Addresses scanned: I2C 0x4c and 0x4d
    Datasheet: Publicly available at the Analog Devices website
               http://www.analog.com/en/prod/0,2877,ADM1032,00.html
    Datasheet: Publicly available at the ON Semiconductor website
               http://www.onsemi.com/PowerSolutions/product.do?id=ADM1032
  * Analog Devices ADT7461
    Prefix: 'adt7461'
    Addresses scanned: I2C 0x4c and 0x4d
    Datasheet: Publicly available at the Analog Devices website
               http://www.analog.com/en/prod/0,2877,ADT7461,00.html
    Note: Only if in ADM1032 compatibility mode
    Datasheet: Publicly available at the ON Semiconductor website
               http://www.onsemi.com/PowerSolutions/product.do?id=ADT7461
  * Maxim MAX6646
    Prefix: 'max6646'
    Addresses scanned: I2C 0x4d
    Datasheet: Publicly available at the Maxim website
               http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3497
  * Maxim MAX6647
    Prefix: 'max6646'
    Addresses scanned: I2C 0x4e
    Datasheet: Publicly available at the Maxim website
               http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3497
  * Maxim MAX6649
    Prefix: 'max6646'
    Addresses scanned: I2C 0x4c
    Datasheet: Publicly available at the Maxim website
               http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3497
  * Maxim MAX6657
    Prefix: 'max6657'
    Addresses scanned: I2C 0x4c
@@ -70,25 +84,21 @@ Description

The LM90 is a digital temperature sensor. It senses its own temperature as
well as the temperature of up to one external diode. It is compatible
with many other devices such as the LM86, the LM89, the LM99, the ADM1032,
the MAX6657, MAX6658, MAX6659, MAX6680 and the MAX6681 all of which are
supported by this driver.
with many other devices, many of which are supported by this driver.

Note that there is no easy way to differentiate between the MAX6657,
MAX6658 and MAX6659 variants. The extra address and features of the
MAX6659 are not supported by this driver. The MAX6680 and MAX6681 only
differ in their pinout, therefore they obviously can't (and don't need to)
be distinguished. Additionally, the ADT7461 is supported if found in
ADM1032 compatibility mode.
be distinguished.

The specificity of this family of chipsets over the ADM1021/LM84
family is that it features critical limits with hysteresis, and an
increased resolution of the remote temperature measurement.

The different chipsets of the family are not strictly identical, although
very similar. This driver doesn't handle any specific feature for now,
with the exception of SMBus PEC. For reference, here comes a non-exhaustive
list of specific features:
very similar. For reference, here comes a non-exhaustive list of specific
features:

LM90:
  * Filter and alert configuration register at 0xBF.
@@ -114,9 +124,11 @@ ADT7461:
  * Lower resolution for remote temperature

MAX6657 and MAX6658:
  * Better local resolution
  * Remote sensor type selection

MAX6659:
  * Better local resolution
  * Selectable address
  * Second critical temperature limit
  * Remote sensor type selection
@@ -127,7 +139,8 @@ MAX6680 and MAX6681:

All temperature values are given in degrees Celsius. Resolution
is 1.0 degree for the local temperature, 0.125 degree for the remote
temperature.
temperature, except for the MAX6657, MAX6658 and MAX6659 which have a
resolution of 0.125 degree for both temperatures.

Each sensor has its own high and low limits, plus a critical limit.
Additionally, there is a relative hysteresis value common to both critical
Loading