code:
Kernel driver ads7828
=====================

Supported chips:

  * Texas Instruments/Burr-Brown ADS7828

    Prefix: 'ads7828'

    Datasheet: Publicly available at the Texas Instruments website:

	       http://focus.ti.com/lit/ds/symlink/ads7828.pdf

  * Texas Instruments ADS7830

    Prefix: 'ads7830'

    Datasheet: Publicly available at the Texas Instruments website:

	       http://focus.ti.com/lit/ds/symlink/ads7830.pdf

Authors:
	- Steve Hardy <shardy@redhat.com>
	- Vivien Didelot <vivien.didelot@savoirfairelinux.com>
	- Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>

Platform data
-------------

The ads7828 driver accepts an optional ads7828_platform_data structure (defined
in include/linux/platform_data/ads7828.h). The structure fields are:

* diff_input: (bool) Differential operation
    set to true for differential mode, false for default single ended mode.

* ext_vref: (bool) External reference
    set to true if it operates with an external reference, false for default
    internal reference.

* vref_mv: (unsigned int) Voltage reference
    if using an external reference, set this to the reference voltage in mV,
    otherwise it will default to the internal value (2500mV). This value will be
    bounded with limits accepted by the chip, described in the datasheet.

 If no structure is provided, the configuration defaults to single ended
 operation and internal voltage reference (2.5V).

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

This driver implements support for the Texas Instruments ADS7828 and ADS7830.

The ADS7828 device is a 12-bit 8-channel A/D converter, while the ADS7830 does
8-bit sampling.

It can operate in single ended mode (8 +ve inputs) or in differential mode,
where 4 differential pairs can be measured.

The chip also has the facility to use an external voltage reference.  This
may be required if your hardware supplies the ADS7828 from a 5V supply, see
the datasheet for more details.

There is no reliable way to identify this chip, so the driver will not scan
some addresses to try to auto-detect it. That means that you will have to
statically declare the device in the platform support code.


code:
Kernel driver adt7410
=====================

Supported chips:

  * Analog Devices ADT7410

    Prefix: 'adt7410'

    Addresses scanned: None

    Datasheet: Publicly available at the Analog Devices website

	       https://www.analog.com/static/imported-files/data_sheets/ADT7410.pdf
  * Analog Devices ADT7420

    Prefix: 'adt7420'

    Addresses scanned: None

    Datasheet: Publicly available at the Analog Devices website

	       https://www.analog.com/static/imported-files/data_sheets/ADT7420.pdf

  * Analog Devices ADT7310

    Prefix: 'adt7310'

    Addresses scanned: None

    Datasheet: Publicly available at the Analog Devices website

	       https://www.analog.com/static/imported-files/data_sheets/ADT7310.pdf

  * Analog Devices ADT7320

    Prefix: 'adt7320'

    Addresses scanned: None

    Datasheet: Publicly available at the Analog Devices website

	       https://www.analog.com/static/imported-files/data_sheets/ADT7320.pdf

Author: Hartmut Knaack <knaack.h@gmx.de>

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

The ADT7310/ADT7410 is a temperature sensor with rated temperature range of
-55°C to +150°C. It has a high accuracy of +/-0.5°C and can be operated at a
resolution of 13 bits (0.0625°C) or 16 bits (0.0078°C). The sensor provides an
INT pin to indicate that a minimum or maximum temperature set point has been
exceeded, as well as a critical temperature (CT) pin to indicate that the
critical temperature set point has been exceeded. Both pins can be set up with a
common hysteresis of 0°C - 15°C and a fault queue, ranging from 1 to 4 events.
Both pins can individually set to be active-low or active-high, while the whole
device can either run in comparator mode or interrupt mode. The ADT7410 supports
continuous temperature sampling, as well as sampling one temperature value per
second or even just get one sample on demand for power saving. Besides, it can
completely power down its ADC, if power management is required.

The ADT7320/ADT7420 is register compatible, the only differences being the
package, a slightly narrower operating temperature range (-40°C to +150°C), and
a better accuracy (0.25°C instead of 0.50°C.)

The difference between the ADT7310/ADT7320 and ADT7410/ADT7420 is the control
interface, the ADT7310 and ADT7320 use SPI while the ADT7410 and ADT7420 use
I2C.

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

Since the device uses one hysteresis value, which is an offset to minimum,
maximum and critical temperature, it can only be set for temp#_max_hyst.
However, temp#_min_hyst and temp#_crit_hyst show their corresponding
hysteresis.
The device is set to 16 bit resolution and comparator mode.

sysfs-Interface
---------------

======================== ====================================================
temp#_input		 temperature input
temp#_min		 temperature minimum setpoint
temp#_max		 temperature maximum setpoint
temp#_crit		 critical temperature setpoint
temp#_min_hyst		 hysteresis for temperature minimum (read-only)
temp#_max_hyst		 hysteresis for temperature maximum (read/write)
temp#_crit_hyst		 hysteresis for critical temperature (read-only)
temp#_min_alarm		 temperature minimum alarm flag
temp#_max_alarm		 temperature maximum alarm flag
temp#_crit_alarm	 critical temperature alarm flag
======================== ====================================================

repo_name: angery/linux


code:
Kernel driver adt7411
=====================

Supported chips:

  * Analog Devices ADT7411

    Prefix: 'adt7411'

    Addresses scanned: 0x48, 0x4a, 0x4b

    Datasheet: Publicly available at the Analog Devices website

Author: Wolfram Sang (based on adt7470 by Darrick J. Wong)

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

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

The ADT7411 can use an I2C/SMBus compatible 2-wire interface or an
SPI-compatible 4-wire interface. It provides a 10-bit analog to digital
converter which measures 1 temperature, vdd and 8 input voltages. It has an
internal temperature sensor, but an external one can also be connected (one
loses 2 inputs then). There are high- and low-limit registers for all inputs.

Check the datasheet for details.

sysfs-Interface
---------------

================ =================
in0_input	 vdd voltage input
in[1-8]_input	 analog 1-8 input
temp1_input	 temperature input
================ =================

Besides standard interfaces, this driver adds (0 = off, 1 = on):

  ============== =======================================================
  adc_ref_vdd	 Use vdd as reference instead of 2.25 V
  fast_sampling	 Sample at 22.5 kHz instead of 1.4 kHz, but drop filters
  no_average	 Turn off averaging over 16 samples
  ============== =======================================================

Notes
-----

SPI, external temperature sensor and limit registers are not supported yet.


code:
Kernel driver adt7462
=====================

Supported chips:

  * Analog Devices ADT7462

    Prefix: 'adt7462'

    Addresses scanned: I2C 0x58, 0x5C

    Datasheet: Publicly available at the Analog Devices website

Author: Darrick J. Wong

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

This driver implements support for the Analog Devices ADT7462 chip family.

This chip is a bit of a beast.  It has 8 counters for measuring fan speed.  It
can also measure 13 voltages or 4 temperatures, or various combinations of the
two.  See the chip documentation for more details about the exact set of
configurations.  This driver does not allow one to configure the chip; that is
left to the system designer.

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

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

The ADT7462 samples all inputs continuously. The driver will not read
the registers more often than once every other second. Further,
configuration data is only read once per minute.

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

The ADT7462 have a 10-bit ADC and can therefore measure temperatures
with 0.25 degC resolution.

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

The driver will report sensor labels when it is able to determine that
information from the configuration registers.

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

Besides standard interfaces driver adds the following:

* PWM Control

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

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

The ADT7462 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 temp#_max.


code:
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 samples all inputs continuously.  A kernel thread is started up for
the purpose of periodically querying the temperature sensors, thus allowing the
automatic fan pwm control to set the fan speed.  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.

The driver also allows control of the PWM frequency:

* pwm1_freq

The PWM frequency is rounded to the nearest one of:

* 11.0 Hz
* 14.7 Hz
* 22.1 Hz
* 29.4 Hz
* 35.3 Hz
* 44.1 Hz
* 58.8 Hz
* 88.2 Hz
* 1.4 kHz
* 22.5 kHz

Notes
-----

The temperature inputs no longer need to be read periodically from userspace in
order for the automatic pwm algorithm to run.  This was the case for earlier
versions of the driver.


code:
Kernel driver adt7475
=====================

Supported chips:

  * Analog Devices ADT7473

    Prefix: 'adt7473'

    Addresses scanned: I2C 0x2C, 0x2D, 0x2E

    Datasheet: Publicly available at the On Semiconductors website

  * Analog Devices ADT7475

    Prefix: 'adt7475'

    Addresses scanned: I2C 0x2E

    Datasheet: Publicly available at the On Semiconductors website

  * Analog Devices ADT7476

    Prefix: 'adt7476'

    Addresses scanned: I2C 0x2C, 0x2D, 0x2E

    Datasheet: Publicly available at the On Semiconductors website

  * Analog Devices ADT7490

    Prefix: 'adt7490'

    Addresses scanned: I2C 0x2C, 0x2D, 0x2E

    Datasheet: Publicly available at the On Semiconductors website

Authors:
	- Jordan Crouse
	- Hans de Goede
	- Darrick J. Wong (documentation)
	- Jean Delvare

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

This driver implements support for the Analog Devices ADT7473, ADT7475,
ADT7476 and ADT7490 chip family. The ADT7473 and ADT7475 differ only in
minor details. The ADT7476 has additional features, including extra voltage
measurement inputs and VID support. The ADT7490 also has additional
features, including extra voltage measurement inputs and PECI support. All
the supported chips will be collectively designed by the name "ADT747x" in
the rest of this document.

The ADT747x uses the 2-wire interface compatible with the SMBus 2.0
specification. Using an analog to digital converter it measures three (3)
temperatures and two (2) or more voltages. It has four (4) 16-bit counters
for measuring fan speed. There are three (3) PWM outputs that can be used
to control fan speed.

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

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

The ADT747x samples all inputs continuously. The driver will not read
the registers more often than once every other second. Further,
configuration data is only read once per minute.

Chip Differences Summary
------------------------

ADT7473:
  * 2 voltage inputs
  * system acoustics optimizations (not implemented)

ADT7475:
  * 2 voltage inputs

ADT7476:
  * 5 voltage inputs
  * VID support

ADT7490:
  * 6 voltage inputs
  * 1 Imon input (not implemented)
  * PECI support (not implemented)
  * 2 GPIO pins (not implemented)
  * system acoustics optimizations (not implemented)

Sysfs Mapping
-------------

==== =========== =========== ========= ==========
in   ADT7490     ADT7476     ADT7475   ADT7473
==== =========== =========== ========= ==========
in0  2.5VIN (22) 2.5VIN (22) -         -
in1  VCCP   (23) VCCP   (23) VCCP (14) VCCP (14)
in2  VCC    (4)  VCC    (4)  VCC  (4)  VCC  (3)
in3  5VIN   (20) 5VIN   (20)
in4  12VIN  (21) 12VIN  (21)
in5  VTT    (8)
==== =========== =========== ========= ==========

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

The ADT747x has a 10-bit ADC and can therefore measure temperatures
with a resolution of 0.25 degree Celsius. Temperature readings can be
configured either for two's complement format or "Offset 64" format,
wherein 64 is subtracted from the raw value to get the temperature value.

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

Fan Speed Control
-----------------

The driver exposes two trip points per PWM channel.

- point1: Set the PWM speed at the lower temperature bound
- point2: Set the PWM speed at the higher temperature bound

The ADT747x will scale the PWM linearly between the lower and higher PWM
speed when the temperature is between the two temperature boundaries.
Temperature boundaries are associated to temperature channels rather than
PWM outputs, and a given PWM output can be controlled by several temperature
channels. As a result, the ADT747x may compute more than one PWM value
for a channel at a given time, in which case the maximum value (fastest
fan speed) is applied. PWM values range from 0 (off) to 255 (full speed).

Fan speed may be set to maximum when the temperature sensor associated with
the PWM control exceeds temp#_max.

At Tmin - hysteresis the PWM output can either be off (0% duty cycle) or at the
minimum (i.e. auto_point1_pwm). This behaviour can be configured using the
`pwm[1-*]_stall_disable sysfs attribute`. A value of 0 means the fans will shut
off. A value of 1 means the fans will run at auto_point1_pwm.

The responsiveness of the ADT747x to temperature changes can be configured.
This allows smoothing of the fan speed transition. To set the transition time
set the value in ms in the `temp[1-*]_smoothing` sysfs attribute.

Notes
-----

The nVidia binary driver presents an ADT7473 chip via an on-card i2c bus.
Unfortunately, they fail to set the i2c adapter class, so this driver may
fail to find the chip until the nvidia driver is patched.


code:
.. SPDX-License-Identifier: GPL-2.0

Kernel driver aht10
=====================

Supported chips:

  * Aosong AHT10

    Prefix: 'aht10'

    Addresses scanned: None

    Datasheet:

      Chinese: http://www.aosong.com/userfiles/files/media/AHT10%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C%20A3%2020201210.pdf
      English: https://server4.eca.ir/eshop/AHT10/Aosong_AHT10_en_draft_0c.pdf

Author: Johannes Cornelis Draaijer <jcdra1@gmail.com>

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

The AHT10 is a Temperature and Humidity sensor

The address of this i2c device may only be 0x38

Usage Notes
-----------

This driver does not probe for AHT10 devices, as there is no reliable
way to determine if an i2c chip is or isn't an AHT10. The device has
to be instantiated explicitly with the address 0x38. See
Documentation/i2c/instantiating-devices.rst for details.

Sysfs entries
-------------

=============== ============================================
temp1_input     Measured temperature in millidegrees Celcius
humidity1_input Measured humidity in %H
update_interval The minimum interval for polling the sensor,
                in milliseconds. Writable. Must be at
                least 2000.
=============== ============================================


code:
Kernel driver amc6821
=====================

Supported chips:

	Texas Instruments AMC6821

	Prefix: 'amc6821'

	Addresses scanned: 0x18, 0x19, 0x1a, 0x2c, 0x2d, 0x2e, 0x4c, 0x4d, 0x4e

	Datasheet: http://focus.ti.com/docs/prod/folders/print/amc6821.html

Authors:
	Tomaz Mertelj <tomaz.mertelj@guest.arnes.si>

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

This driver implements support for the Texas Instruments amc6821 chip.
The chip has one on-chip and one remote temperature sensor and one pwm fan
regulator.
The pwm can be controlled either from software or automatically.

The driver provides the following sensor accesses in sysfs:

======================= ==      ===============================================
temp1_input		ro	on-chip temperature
temp1_min		rw	"
temp1_max		rw	"
temp1_crit		rw	"
temp1_min_alarm		ro	"
temp1_max_alarm		ro	"
temp1_crit_alarm	ro	"

temp2_input		ro	remote temperature
temp2_min		rw	"
temp2_max		rw	"
temp2_crit		rw	"
temp2_min_alarm		ro	"
temp2_max_alarm		ro	"
temp2_crit_alarm	ro	"
temp2_fault		ro	"

fan1_input		ro	tachometer speed
fan1_min		rw	"
fan1_max		rw	"
fan1_fault		ro	"
fan1_div		rw	Fan divisor can be either 2 or 4.

pwm1			rw	pwm1
pwm1_enable		rw	regulator mode, 1=open loop, 2=fan controlled
				by remote temperature, 3=fan controlled by
				combination of the on-chip temperature and
				remote-sensor temperature,
pwm1_auto_channels_temp ro	1 if pwm_enable==2, 3 if pwm_enable==3
pwm1_auto_point1_pwm	ro	Hardwired to 0, shared for both
				temperature channels.
pwm1_auto_point2_pwm	rw	This value is shared for both temperature
				channels.
pwm1_auto_point3_pwm	rw	Hardwired to 255, shared for both
				temperature channels.

temp1_auto_point1_temp	ro	Hardwired to temp2_auto_point1_temp
				which is rw. Below this temperature fan stops.
temp1_auto_point2_temp	rw	The low-temperature limit of the proportional
				range. Below this temperature
				pwm1 = pwm1_auto_point2_pwm. It can go from
				0 degree C to 124 degree C in steps of
				4 degree C. Read it out after writing to get
				the actual value.
temp1_auto_point3_temp	rw	Above this temperature fan runs at maximum
				speed. It can go from temp1_auto_point2_temp.
				It can only have certain discrete values
				which depend on temp1_auto_point2_temp and
				pwm1_auto_point2_pwm. Read it out after
				writing to get the actual value.

temp2_auto_point1_temp	rw	Must be between 0 degree C and 63 degree C and
				it defines the passive cooling temperature.
				Below this temperature the fan stops in
				the closed loop mode.
temp2_auto_point2_temp	rw	The low-temperature limit of the proportional
				range. Below this temperature
				pwm1 = pwm1_auto_point2_pwm. It can go from
				0 degree C to 124 degree C in steps
				of 4 degree C.

temp2_auto_point3_temp	rw	Above this temperature fan runs at maximum
				speed. It can only have certain discrete
				values which depend on temp2_auto_point2_temp
				and pwm1_auto_point2_pwm. Read it out after
				writing to get actual value.
======================= ==      ===============================================

Module parameters
-----------------

If your board has a BIOS that initializes the amc6821 correctly, you should
load the module with: init=0.

If your board BIOS doesn't initialize the chip, or you want
different settings, you can set the following parameters:

- init=1,
- pwminv: 0 default pwm output, 1 inverts pwm output.


code:
.. SPDX-License-Identifier: GPL-2.0-or-later

Kernel driver aquacomputer-d5next
=================================

Supported devices:

* Aquacomputer D5 Next watercooling pump
* Aquacomputer Farbwerk RGB controller
* Aquacomputer Farbwerk 360 RGB controller
* Aquacomputer Octo fan controller
* Aquacomputer Quadro fan controller
* Aquacomputer High Flow Next sensor

Author: Aleksa Savic

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

This driver exposes hardware sensors of listed Aquacomputer devices, which
communicate through proprietary USB HID protocols.

For the D5 Next pump, available sensors are pump and fan speed, power, voltage
and current, as well as coolant temperature and eight virtual temp sensors. Also
available through debugfs are the serial number, firmware version and power-on
count. Attaching a fan to it is optional and allows it to be controlled using
temperature curves directly from the pump. If it's not connected, the fan-related
sensors will report zeroes.

The pump can be configured either through software or via its physical
interface. Configuring the pump through this driver is not implemented, as it
seems to require sending it a complete configuration. That includes addressable
RGB LEDs, for which there is no standard sysfs interface. Thus, that task is
better suited for userspace tools.

The Octo exposes four physical and sixteen virtual temperature sensors, as well as
eight PWM controllable fans, along with their speed (in RPM), power, voltage and
current.

The Quadro exposes four physical and sixteen virtual temperature sensors, a flow
sensor and four PWM controllable fans, along with their speed (in RPM), power,
voltage and current. Flow sensor pulses are also available.

The Farbwerk and Farbwerk 360 expose four temperature sensors. Additionally,
sixteen virtual temperature sensors of the Farbwerk 360 are exposed.

The High Flow Next exposes +5V voltages, water quality, conductivity and flow readings.
A temperature sensor can be connected to it, in which case it provides its reading
and an estimation of the dissipated/absorbed power in the liquid cooling loop.

Depending on the device, not all sysfs and debugfs entries will be available.
Writing to virtual temperature sensors is not currently supported.

Usage notes
-----------

The devices communicate via HID reports. The driver is loaded automatically by
the kernel and supports hotswapping.

Sysfs entries
-------------

================ ==============================================================
temp[1-20]_input Physical/virtual temperature sensors (in millidegrees Celsius)
temp[1-4]_offset Temperature sensor correction offset (in millidegrees Celsius)
fan[1-8]_input   Pump/fan speed (in RPM) / Flow speed (in dL/h)
fan5_pulses      Quadro flow sensor pulses
power[1-8]_input Pump/fan power (in micro Watts)
in[0-7]_input    Pump/fan voltage (in milli Volts)
curr[1-8]_input  Pump/fan current (in milli Amperes)
pwm[1-8]         Fan PWM (0 - 255)
================ ==============================================================

Debugfs entries
---------------

================ =================================================
serial_number    Serial number of the device
firmware_version Version of installed firmware
power_cycles     Count of how many times the device was powered on
================ =================================================


code:
Kernel driver asb100
====================

Supported Chips:

  * Asus ASB100 and ASB100-A "Bach"

    Prefix: 'asb100'

    Addresses scanned: I2C 0x2d

    Datasheet: none released

Author: Mark M. Hoffman <mhoffman@lightlink.com>

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

This driver implements support for the Asus ASB100 and ASB100-A "Bach".
These are custom ASICs available only on Asus mainboards. Asus refuses to
supply a datasheet for these chips. Thanks go to many people who helped
investigate their hardware, including:

Vitaly V. Bursov
Alexander van Kaam (author of MBM for Windows)
Bertrik Sikken

The ASB100 implements seven voltage sensors, three fan rotation speed
sensors, four temperature sensors, VID lines and alarms. In addition to
these, the ASB100-A also implements a single PWM controller for fans 2 and
3 (i.e. one setting controls both.) If you have a plain ASB100, the PWM
controller will simply not work (or maybe it will for you... it doesn't for
me).

Temperatures are measured and reported in degrees Celsius.

Fan speeds are reported in RPM (rotations per minute). An alarm is
triggered if the rotation speed has dropped below a programmable limit.

Voltage sensors (also known as IN sensors) report values in volts.

The VID lines encode the core voltage value: the voltage level your
processor should work with. This is hardcoded by the mainboard and/or
processor itself. It is a value in volts.

Alarms: (TODO question marks indicate may or may not work)

- 0x0001 => in0 (?)
- 0x0002 => in1 (?)
- 0x0004 => in2
- 0x0008 => in3
- 0x0010 => temp1 [1]_
- 0x0020 => temp2
- 0x0040 => fan1
- 0x0080 => fan2
- 0x0100 => in4
- 0x0200 => in5 (?) [2]_
- 0x0400 => in6 (?) [2]_
- 0x0800 => fan3
- 0x1000 => chassis switch
- 0x2000 => temp3

.. [1]	This alarm will only trigger if the hysteresis value is 127C.
	I.e. it behaves the same as w83781d.

.. [2]	The min and max registers for these values appear to
	be read-only or otherwise stuck at 0x00.

TODO:
  * Experiment with fan divisors > 8.
  * Experiment with temp. sensor types.
  * Are there really 13 voltage inputs? Probably not...
  * Cleanups, no doubt...


code:
=====================
Kernel driver asc7621
=====================

Supported chips:

    Andigilog aSC7621 and aSC7621a

    Prefix: 'asc7621'

    Addresses scanned: I2C 0x2c, 0x2d, 0x2e

    Datasheet: http://www.fairview5.com/linux/asc7621/asc7621.pdf

Author:
		George Joseph

Description provided by Dave Pivin @ Andigilog:

Andigilog has both the PECI and pre-PECI versions of the Heceta-6, as
Intel calls them. Heceta-6e has high frequency PWM and Heceta-6p has
added PECI and a 4th thermal zone. The Andigilog aSC7611 is the
Heceta-6e part and aSC7621 is the Heceta-6p part. They are both in
volume production, shipping to Intel and their subs.

We have enhanced both parts relative to the governing Intel
specification. First enhancement is temperature reading resolution. We
have used registers below 20h for vendor-specific functions in addition
to those in the Intel-specified vendor range.

Our conversion process produces a result that is reported as two bytes.
The fan speed control uses this finer value to produce a "step-less" fan
PWM output. These two bytes are "read-locked" to guarantee that once a
high or low byte is read, the other byte is locked-in until after the
next read of any register. So to get an atomic reading, read high or low
byte, then the very next read should be the opposite byte. Our data
sheet says 10-bits of resolution, although you may find the lower bits
are active, they are not necessarily reliable or useful externally. We
chose not to mask them.

We employ significant filtering that is user tunable as described in the
data sheet. Our temperature reports and fan PWM outputs are very smooth
when compared to the competition, in addition to the higher resolution
temperature reports. The smoother PWM output does not require user
intervention.

We offer GPIO features on the former VID pins. These are open-drain
outputs or inputs and may be used as general purpose I/O or as alarm
outputs that are based on temperature limits. These are in 19h and 1Ah.

We offer flexible mapping of temperature readings to thermal zones. Any
temperature may be mapped to any zone, which has a default assignment
that follows Intel's specs.

Since there is a fan to zone assignment that allows for the "hotter" of
a set of zones to control the PWM of an individual fan, but there is no
indication to the user, we have added an indicator that shows which zone
is currently controlling the PWM for a given fan. This is in register
00h.

Both remote diode temperature readings may be given an offset value such
that the reported reading as well as the temperature used to determine
PWM may be offset for system calibration purposes.

PECI Extended configuration allows for having more than two domains per
PECI address and also provides an enabling function for each PECI
address. One could use our flexible zone assignment to have a zone
assigned to up to 4 PECI addresses. This is not possible in the default
Intel configuration. This would be useful in multi-CPU systems with
individual fans on each that would benefit from individual fan control.
This is in register 0Eh.

The tachometer measurement system is flexible and able to adapt to many
fan types. We can also support pulse-stretched PWM so that 3-wire fans
may be used. These characteristics are in registers 04h to 07h.

Finally, we have added a tach disable function that turns off the tach
measurement system for individual tachs in order to save power. That is
in register 75h.

--------------------------------------------------------------------------

aSC7621 Product Description
===========================

The aSC7621 has a two wire digital interface compatible with SMBus 2.0.
Using a 10-bit ADC, the aSC7621 measures the temperature of two remote diode
connected transistors as well as its own die. Support for Platform
Environmental Control Interface (PECI) is included.

Using temperature information from these four zones, an automatic fan speed
control algorithm is employed to minimize acoustic impact while achieving
recommended CPU temperature under varying operational loads.

To set fan speed, the aSC7621 has three independent pulse width modulation
(PWM) outputs that are controlled by one, or a combination of three,
temperature zones. Both high- and low-frequency PWM ranges are supported.

The aSC7621 also includes a digital filter that can be invoked to smooth
temperature readings for better control of fan speed and minimum acoustic
impact.

The aSC7621 has tachometer inputs to measure fan speed on up to four fans.
Limit and status registers for all measured values are included to alert
the system host that any measurements are outside of programmed limits
via status registers.

System voltages of VCCP, 2.5V, 3.3V, 5.0V, and 12V motherboard power are
monitored efficiently with internal scaling resistors.

Features
--------

- Supports PECI interface and monitors internal and remote thermal diodes
- 2-wire, SMBus 2.0 compliant, serial interface
- 10-bit ADC
- Monitors VCCP, 2.5V, 3.3V, 5.0V, and 12V motherboard/processor supplies
- Programmable autonomous fan control based on temperature readings
- Noise filtering of temperature reading for fan speed control
- 0.25C digital temperature sensor resolution
- 3 PWM fan speed control outputs for 2-, 3- or 4-wire fans and up to 4 fan
  tachometer inputs
- Enhanced measured temperature to Temperature Zone assignment.
- Provides high and low PWM frequency ranges
- 3 GPIO pins for custom use
- 24-Lead QSOP package

Configuration Notes
===================

Except where noted below, the sysfs entries created by this driver follow
the standards defined in "sysfs-interface".

temp1_source
	=	===============================================
	0 	(default) peci_legacy = 0, Remote 1 Temperature
		peci_legacy = 1, PECI Processor Temperature 0
	1 	Remote 1 Temperature
	2 	Remote 2 Temperature
	3 	Internal Temperature
	4 	PECI Processor Temperature 0
	5 	PECI Processor Temperature 1
	6 	PECI Processor Temperature 2
	7	PECI Processor Temperature 3
	=	===============================================

temp2_source
	=	===============================================
	0 	(default) Internal Temperature
	1 	Remote 1 Temperature
	2 	Remote 2 Temperature
	3 	Internal Temperature
	4 	PECI Processor Temperature 0
	5 	PECI Processor Temperature 1
	6 	PECI Processor Temperature 2
	7 	PECI Processor Temperature 3
	=	===============================================

temp3_source
	=	===============================================
	0 	(default) Remote 2 Temperature
	1 	Remote 1 Temperature
	2 	Remote 2 Temperature
	3 	Internal Temperature
	4 	PECI Processor Temperature 0
	5 	PECI Processor Temperature 1
	6 	PECI Processor Temperature 2
	7 	PECI Processor Temperature 3
	=	===============================================

temp4_source
	=	===============================================
	0 	(default) peci_legacy = 0, PECI Processor Temperature 0
		peci_legacy = 1, Remote 1 Temperature
	1 	Remote 1 Temperature
	2 	Remote 2 Temperature
	3 	Internal Temperature
	4 	PECI Processor Temperature 0
	5 	PECI Processor Temperature 1
	6 	PECI Processor Temperature 2
	7 	PECI Processor Temperature 3
	=	===============================================

temp[1-4]_smoothing_enable / temp[1-4]_smoothing_time
	Smooths spikes in temp readings caused by noise.
	Valid values in milliseconds are:

	* 35000
	* 17600
	* 11800
	*  7000
	*  4400
	*  3000
	*  1600
	*   800

temp[1-4]_crit
	When the corresponding zone temperature reaches this value,
	ALL pwm outputs will got to 100%.

temp[5-8]_input / temp[5-8]_enable
	The aSC7621 can also read temperatures provided by the processor
	via the PECI bus.  Usually these are "core" temps and are relative
	to the point where the automatic thermal control circuit starts
	throttling.  This means that these are usually negative numbers.

pwm[1-3]_enable
	=============== ========================================================
	0		Fan off.
	1		Fan on manual control.
	2		Fan on automatic control and will run at the minimum pwm
			if the temperature for the zone is below the minimum.
	3		Fan on automatic control but will be off if the
			temperature for the zone is below the minimum.
	4-254		Ignored.
	255		Fan on full.
	=============== ========================================================

pwm[1-3]_auto_channels
	Bitmap as described in sysctl-interface with the following
	exceptions...

	Only the following combination of zones (and their corresponding masks)
	are valid:

	* 1
	* 2
	* 3
	* 2,3
	* 1,2,3
	* 4
	* 1,2,3,4

	* Special values:

	  ==		======================
	  0		Disabled.
	  16		Fan on manual control.
	  31		Fan on full.
	  ==		======================

pwm[1-3]_invert
	When set, inverts the meaning of pwm[1-3].
	i.e.  when pwm = 0, the fan will be on full and
	when pwm = 255 the fan will be off.

pwm[1-3]_freq
	PWM frequency in Hz
	Valid values in Hz are:

	* 10
	* 15
	* 23
	* 30  (default)
	* 38
	* 47
	* 62
	* 94
	* 23000
	* 24000
	* 25000
	* 26000
	* 27000
	* 28000
	* 29000
	* 30000

	Setting any other value will be ignored.

peci_enable
	Enables or disables PECI

peci_avg
	Input filter average time.

	* 0 	0 Sec. (no Smoothing) (default)
	* 1 	0.25 Sec.
	* 2 	0.5 Sec.
	* 3 	1.0 Sec.
	* 4 	2.0 Sec.
	* 5 	4.0 Sec.
	* 6 	8.0 Sec.
	* 7 	0.0 Sec.

peci_legacy
	=	============================================
	0	Standard Mode (default)
		Remote Diode 1 reading is associated with
		Temperature Zone 1, PECI is associated with
		Zone 4

	1	Legacy Mode
		PECI is associated with Temperature Zone 1,
		Remote Diode 1 is associated with Zone 4
	=	============================================

peci_diode
	Diode filter

	=	====================
	0	0.25 Sec.
	1 	1.1 Sec.
	2 	2.4 Sec.  (default)
	3 	3.4 Sec.
	4 	5.0 Sec.
	5 	6.8 Sec.
	6 	10.2 Sec.
	7 	16.4 Sec.
	=	====================

peci_4domain
	Four domain enable

	=	===============================================
	0 	1 or 2 Domains for enabled processors (default)
	1 	3 or 4 Domains for enabled processors
	=	===============================================

peci_domain
	Domain

	=	==================================================
	0 	Processor contains a single domain (0) 	 (default)
	1 	Processor contains two domains (0,1)
	=	==================================================


code:
Kernel driver aspeed-pwm-tacho
==============================

Supported chips:
	ASPEED AST2400/2500

Authors:
	<jaghu@google.com>

Description:
------------
This driver implements support for ASPEED AST2400/2500 PWM and Fan Tacho
controller. The PWM controller supports upto 8 PWM outputs. The Fan tacho
controller supports up to 16 tachometer inputs.

The driver provides the following sensor accesses in sysfs:

=============== ======= =====================================================
fanX_input	ro	provide current fan rotation value in RPM as reported
			by the fan to the device.

pwmX		rw	get or set PWM fan control value. This is an integer
			value between 0(off) and 255(full speed).
=============== ======= =====================================================


code:
.. SPDX-License-Identifier: GPL-2.0-or-later

Kernel driver asus_ec_sensors
=================================

Supported boards:
 * PRIME X470-PRO
 * PRIME X570-PRO
 * Pro WS X570-ACE
 * ProArt X570-CREATOR WIFI
 * ROG CROSSHAIR VIII DARK HERO
 * ROG CROSSHAIR VIII HERO (WI-FI)
 * ROG CROSSHAIR VIII FORMULA
 * ROG CROSSHAIR VIII HERO
 * ROG CROSSHAIR VIII IMPACT
 * ROG MAXIMUS XI HERO
 * ROG MAXIMUS XI HERO (WI-FI)
 * ROG STRIX B550-E GAMING
 * ROG STRIX B550-I GAMING
 * ROG STRIX X570-E GAMING
 * ROG STRIX X570-E GAMING WIFI II
 * ROG STRIX X570-F GAMING
 * ROG STRIX X570-I GAMING
 * ROG STRIX Z690-A GAMING WIFI D4
 * ROG ZENITH II EXTREME

Authors:
    - Eugene Shalygin <eugene.shalygin@gmail.com>

Description:
------------
ASUS mainboards publish hardware monitoring information via Super I/O
chip and the ACPI embedded controller (EC) registers. Some of the sensors
are only available via the EC.

The driver is aware of and reads the following sensors:

1. Chipset (PCH) temperature
2. CPU package temperature
3. Motherboard temperature
4. Readings from the T_Sensor header
5. VRM temperature
6. CPU_Opt fan RPM
7. VRM heatsink fan RPM
8. Chipset fan RPM
9. Readings from the "Water flow meter" header (RPM)
10. Readings from the "Water In" and "Water Out" temperature headers
11. CPU current
12. CPU core voltage

Sensor values are read from EC registers, and to avoid race with the board
firmware the driver acquires ACPI mutex, the one used by the WMI when its
methods access the EC.

Module Parameters
-----------------
 * mutex_path: string
		The driver holds path to the ACPI mutex for each board (actually,
		the path is mostly identical for them). If ASUS changes this path
		in a future BIOS update, this parameter can be used to override
		the stored in the driver value until it gets updated.
		A special string ":GLOBAL_LOCK" can be passed to use the ACPI
		global lock instead of a dedicated mutex.


code:
.. SPDX-License-Identifier: GPL-2.0-or-later

Kernel driver asus_wmi_sensors
=================================

Supported boards:
 * PRIME X399-A,
 * PRIME X470-PRO,
 * ROG CROSSHAIR VI EXTREME,
 * ROG CROSSHAIR VI HERO,
 * ROG CROSSHAIR VI HERO (WI-FI AC),
 * ROG CROSSHAIR VII HERO,
 * ROG CROSSHAIR VII HERO (WI-FI),
 * ROG STRIX B450-E GAMING,
 * ROG STRIX B450-F GAMING,
 * ROG STRIX B450-I GAMING,
 * ROG STRIX X399-E GAMING,
 * ROG STRIX X470-F GAMING,
 * ROG STRIX X470-I GAMING,
 * ROG ZENITH EXTREME,
 * ROG ZENITH EXTREME ALPHA.

Authors:
    - Ed Brindley <kernel@maidavale.org>

Description:
------------
ASUS mainboards publish hardware monitoring information via WMI interface.

ASUS WMI interface provides a methods to get list of sensors and values of
such, which is utilized by this driver to publish those sensor readings to the
HWMON system.

The driver is aware of and reads the following sensors:
 * CPU Core Voltage,
 * CPU SOC Voltage,
 * DRAM Voltage,
 * VDDP Voltage,
 * 1.8V PLL Voltage,
 * +12V Voltage,
 * +5V Voltage,
 * 3VSB Voltage,
 * VBAT Voltage,
 * AVCC3 Voltage,
 * SB 1.05V Voltage,
 * CPU Core Voltage,
 * CPU SOC Voltage,
 * DRAM Voltage,
 * CPU Fan RPM,
 * Chassis Fan 1 RPM,
 * Chassis Fan 2 RPM,
 * Chassis Fan 3 RPM,
 * HAMP Fan RPM,
 * Water Pump RPM,
 * CPU OPT RPM,
 * Water Flow RPM,
 * AIO Pump RPM,
 * CPU Temperature,
 * CPU Socket Temperature,
 * Motherboard Temperature,
 * Chipset Temperature,
 * Tsensor 1 Temperature,
 * CPU VRM Temperature,
 * Water In,
 * Water Out,
 * CPU VRM Output Current.

Known Issues:
 * The WMI implementation in some of Asus' BIOSes is buggy. This can result in
   fans stopping, fans getting stuck at max speed, or temperature readouts
   getting stuck. This is not an issue with the driver, but the BIOS. The Prime
   X470 Pro seems particularly bad for this. The more frequently the WMI
   interface is polled the greater the potential for this to happen. Until you
   have subjected your computer to an extended soak test while polling the
   sensors frequently, don't leave you computer unattended. Upgrading to new
   BIOS version with method version greater than or equal to two should
   rectify the issue.
 * A few boards report 12v voltages to be ~10v.


code:
.. SPDX-License-Identifier: GPL-2.0-only

Broadcom BCM54140 Quad SGMII/QSGMII PHY
=======================================

Supported chips:

   * Broadcom BCM54140

     Datasheet: not public

Author: Michael Walle <michael@walle.cc>

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

The Broadcom BCM54140 is a Quad SGMII/QSGMII PHY which supports monitoring
its die temperature as well as two analog voltages.

The AVDDL is a 1.0V analogue voltage, the AVDDH is a 3.3V analogue voltage.
Both voltages and the temperature are measured in a round-robin fashion.

Sysfs entries
-------------

The following attributes are supported.

======================= ========================================================
in0_label		"AVDDL"
in0_input		Measured AVDDL voltage.
in0_min			Minimum AVDDL voltage.
in0_max			Maximum AVDDL voltage.
in0_alarm		AVDDL voltage alarm.

in1_label		"AVDDH"
in1_input		Measured AVDDH voltage.
in1_min			Minimum AVDDH voltage.
in1_max			Maximum AVDDH voltage.
in1_alarm		AVDDH voltage alarm.

temp1_input		Die temperature.
temp1_min		Minimum die temperature.
temp1_max		Maximum die temperature.
temp1_alarm		Die temperature alarm.
======================= ========================================================


code:
Kernel driver bel-pfe
======================

Supported chips:

  * BEL PFE1100

    Prefixes: 'pfe1100'

    Addresses scanned: -

    Datasheet: https://www.belfuse.com/resources/datasheets/powersolutions/ds-bps-pfe1100-12-054xa.pdf

  * BEL PFE3000

    Prefixes: 'pfe3000'

    Addresses scanned: -

    Datasheet: https://www.belfuse.com/resources/datasheets/powersolutions/ds-bps-pfe3000-series.pdf

Author: Tao Ren <rentao.bupt@gmail.com>

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

This driver supports hardware monitoring for below power supply devices
which support PMBus Protocol:

  * BEL PFE1100

    1100 Watt AC to DC power-factor-corrected (PFC) power supply.
    PMBus Communication Manual is not publicly available.

  * BEL PFE3000

    3000 Watt AC/DC power-factor-corrected (PFC) and DC-DC power supply.
    PMBus Communication Manual is not publicly available.

The driver is a client driver to the core PMBus driver. Please see
Documentation/hwmon/pmbus.rst for details on PMBus client drivers.

Usage Notes
-----------

This driver does not auto-detect devices. You will have to instantiate the
devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for
details.

Example: the following will load the driver for an PFE3000 at address 0x20
on I2C bus #1::

	$ modprobe bel-pfe
	$ echo pfe3000 0x20 > /sys/bus/i2c/devices/i2c-1/new_device

Platform data support
---------------------

The driver supports standard PMBus driver platform data.

Sysfs entries
-------------

======================= =======================================================
curr1_label		"iin"
curr1_input		Measured input current
curr1_max               Input current max value
curr1_max_alarm         Input current max alarm

curr[2-3]_label		"iout[1-2]"
curr[2-3]_input		Measured output current
curr[2-3]_max           Output current max value
curr[2-3]_max_alarm     Output current max alarm

fan[1-2]_input          Fan 1 and 2 speed in RPM
fan1_target             Set fan speed reference for both fans

in1_label		"vin"
in1_input		Measured input voltage
in1_crit		Input voltage critical max value
in1_crit_alarm		Input voltage critical max alarm
in1_lcrit               Input voltage critical min value
in1_lcrit_alarm         Input voltage critical min alarm
in1_max                 Input voltage max value
in1_max_alarm           Input voltage max alarm

in2_label               "vcap"
in2_input               Hold up capacitor voltage

in[3-8]_label		"vout[1-3,5-7]"
in[3-8]_input		Measured output voltage
in[3-4]_alarm           vout[1-2] output voltage alarm

power[1-2]_label	"pin[1-2]"
power[1-2]_input        Measured input power
power[1-2]_alarm	Input power high alarm

power[3-4]_label	"pout[1-2]"
power[3-4]_input	Measured output power

temp[1-3]_input		Measured temperature
temp[1-3]_alarm         Temperature alarm
======================= =======================================================

.. note::

    - curr3, fan2, vout[2-7], vcap, pin2, pout2 and temp3 attributes only
      exist for PFE3000.


code:
.. SPDX-License-Identifier: GPL-2.0

Kernel driver bpa-rs600
=======================

Supported chips:

  * BPA-RS600-120

    Datasheet: Publicly available at the BluTek website
       http://blutekpower.com/wp-content/uploads/2019/01/BPA-RS600-120-07-19-2018.pdf

Authors:
      - Chris Packham <chris.packham@alliedtelesis.co.nz>

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

The BPA-RS600 is a compact 600W removable power supply module.

Usage Notes
-----------

This driver does not probe for PMBus devices. You will have to instantiate
devices explicitly.

Sysfs attributes
----------------

======================= ============================================
curr1_label             "iin"
curr1_input		Measured input current
curr1_max		Maximum input current
curr1_max_alarm		Input current high alarm

curr2_label		"iout1"
curr2_input		Measured output current
curr2_max		Maximum output current
curr2_max_alarm		Output current high alarm

fan1_input		Measured fan speed
fan1_alarm		Fan warning
fan1_fault		Fan fault

in1_label		"vin"
in1_input		Measured input voltage
in1_max			Maximum input voltage
in1_max_alarm		Input voltage high alarm
in1_min			Minimum input voltage
in1_min_alarm		Input voltage low alarm

in2_label		"vout1"
in2_input		Measured output voltage
in2_max			Maximum output voltage
in2_max_alarm		Output voltage high alarm
in2_min			Maximum output voltage
in2_min_alarm		Output voltage low alarm

power1_label		"pin"
power1_input		Measured input power
power1_alarm		Input power alarm
power1_max		Maximum input power

power2_label		"pout1"
power2_input		Measured output power
power2_max		Maximum output power
power2_max_alarm	Output power high alarm

temp1_input		Measured temperature around input connector
temp1_alarm		Temperature alarm

temp2_input		Measured temperature around output connector
temp2_alarm		Temperature alarm
======================= ============================================


code:
.. SPDX-License-Identifier: GPL-2.0-only

Kernel driver bt1-pvt
=====================

Supported chips:

  * Baikal-T1 PVT sensor (in SoC)

    Prefix: 'bt1-pvt'

    Addresses scanned: -

    Datasheet: Provided by BAIKAL ELECTRONICS upon request and under NDA

Authors:
    Maxim Kaurkin <maxim.kaurkin@baikalelectronics.ru>
    Serge Semin <Sergey.Semin@baikalelectronics.ru>

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

This driver implements support for the hardware monitoring capabilities of the
embedded into Baikal-T1 process, voltage and temperature sensors. PVT IP-core
consists of one temperature and four voltage sensors, which can be used to
monitor the chip internal environment like heating, supply voltage and
transistors performance. The driver can optionally provide the hwmon alarms
for each sensor the PVT controller supports. The alarms functionality is made
compile-time configurable due to the hardware interface implementation
peculiarity, which is connected with an ability to convert data from only one
sensor at a time. Additional limitation is that the controller performs the
thresholds checking synchronously with the data conversion procedure. Due to
these in order to have the hwmon alarms automatically detected the driver code
must switch from one sensor to another, read converted data and manually check
the threshold status bits. Depending on the measurements timeout settings
(update_interval sysfs node value) this design may cause additional burden on
the system performance. So in case if alarms are unnecessary in your system
design it's recommended to have them disabled to prevent the PVT IRQs being
periodically raised to get the data cache/alarms status up to date. By default
in alarm-less configuration the data conversion is performed by the driver
on demand when read operation is requested via corresponding _input-file.

Temperature Monitoring
----------------------

Temperature is measured with 10-bit resolution and reported in millidegree
Celsius. The driver performs all the scaling by itself therefore reports true
temperatures that don't need any user-space adjustments. While the data
translation formulae isn't linear, which gives us non-linear discreteness,
it's close to one, but giving a bit better accuracy for higher temperatures.
The temperature input is mapped as follows (the last column indicates the input
ranges)::

	temp1: CPU embedded diode	-48.38C - +147.438C

In case if the alarms kernel config is enabled in the driver the temperature input
has associated min and max limits which trigger an alarm when crossed.

Voltage Monitoring
------------------

The voltage inputs are also sampled with 10-bit resolution and reported in
millivolts. But in this case the data translation formulae is linear, which
provides a constant measurements discreteness. The data scaling is also
performed by the driver, so returning true millivolts. The voltage inputs are
mapped as follows (the last column indicates the input ranges)::

	in0: VDD		(processor core)		0.62V - 1.168V
	in1: Low-Vt		(low voltage threshold)		0.62V - 1.168V
	in2: High-Vt		(high voltage threshold)	0.62V - 1.168V
	in3: Standard-Vt	(standard voltage threshold)	0.62V - 1.168V

In case if the alarms config is enabled in the driver the voltage inputs
have associated min and max limits which trigger an alarm when crossed.

Sysfs Attributes
----------------

Following is a list of all sysfs attributes that the driver provides, their
permissions and a short description:

=============================== ======= =======================================
Name				Perm	Description
=============================== ======= =======================================
update_interval			RW	Measurements update interval per
					sensor.
temp1_type			RO	Sensor type (always 1 as CPU embedded
					diode).
temp1_label			RO	CPU Core Temperature sensor.
temp1_input			RO	Measured temperature in millidegree
					Celsius.
temp1_min			RW	Low limit for temp input.
temp1_max			RW	High limit for temp input.
temp1_min_alarm			RO	Temperature input alarm. Returns 1 if
					temperature input went below min limit,
					0 otherwise.
temp1_max_alarm			RO	Temperature input alarm. Returns 1 if
					temperature input went above max limit,
					0 otherwise.
temp1_offset			RW	Temperature offset in millidegree
					Celsius which is added to the
					temperature reading by the chip. It can
					be used to manually adjust the
					temperature measurements within 7.130
					degrees Celsius.
in[0-3]_label			RO	CPU Voltage sensor (either core or
					low/high/standard thresholds).
in[0-3]_input			RO	Measured voltage in millivolts.
in[0-3]_min			RW	Low limit for voltage input.
in[0-3]_max			RW	High limit for voltage input.
in[0-3]_min_alarm		RO	Voltage input alarm. Returns 1 if
					voltage input went below min limit,
					0 otherwise.
in[0-3]_max_alarm		RO	Voltage input alarm. Returns 1 if
					voltage input went above max limit,
					0 otherwise.
=============================== ======= =======================================


code:
Kernel driver coretemp
======================

Supported chips:
  * All Intel Core family

    Prefix: 'coretemp'

    CPUID: family 0x6, models

			    - 0xe (Pentium M DC), 0xf (Core 2 DC 65nm),
			    - 0x16 (Core 2 SC 65nm), 0x17 (Penryn 45nm),
			    - 0x1a (Nehalem), 0x1c (Atom), 0x1e (Lynnfield),
			    - 0x26 (Tunnel Creek Atom), 0x27 (Medfield Atom),
			    - 0x36 (Cedar Trail Atom)

    Datasheet:

	       Intel 64 and IA-32 Architectures Software Developer's Manual
	       Volume 3A: System Programming Guide

	       http://softwarecommunity.intel.com/Wiki/Mobility/720.htm

Author: Rudolf Marek

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

This driver permits reading the DTS (Digital Temperature Sensor) embedded
inside Intel CPUs. This driver can read both the per-core and per-package
temperature using the appropriate sensors. The per-package sensor is new;
as of now, it is present only in the SandyBridge platform. The driver will
show the temperature of all cores inside a package under a single device
directory inside hwmon.

Temperature is measured in degrees Celsius and measurement resolution is
1 degree C. Valid temperatures are from 0 to TjMax degrees C, because
the actual value of temperature register is in fact a delta from TjMax.

Temperature known as TjMax is the maximum junction temperature of processor,
which depends on the CPU model. See table below. At this temperature, protection
mechanism will perform actions to forcibly cool down the processor. Alarm
may be raised, if the temperature grows enough (more than TjMax) to trigger
the Out-Of-Spec bit. Following table summarizes the exported sysfs files:

All Sysfs entries are named with their core_id (represented here by 'X').

================= ========================================================
tempX_input	  Core temperature (in millidegrees Celsius).
tempX_max	  All cooling devices should be turned on (on Core2).
tempX_crit	  Maximum junction temperature (in millidegrees Celsius).
tempX_crit_alarm  Set when Out-of-spec bit is set, never clears.
		  Correct CPU operation is no longer guaranteed.
tempX_label	  Contains string "Core X", where X is processor
		  number. For Package temp, this will be "Physical id Y",
		  where Y is the package number.
================= ========================================================

On CPU models which support it, TjMax is read from a model-specific register.
On other models, it is set to an arbitrary value based on weak heuristics.
If these heuristics don't work for you, you can pass the correct TjMax value
as a module parameter (tjmax).

Appendix A. Known TjMax lists (TBD):
Some information comes from ark.intel.com

=============== =============================================== ================
Process		Processor					TjMax(C)

22nm		Core i5/i7 Processors
		i7 3920XM, 3820QM, 3720QM, 3667U, 3520M		105
		i5 3427U, 3360M/3320M				105
		i7 3770/3770K					105
		i5 3570/3570K, 3550, 3470/3450			105
		i7 3770S					103
		i5 3570S/3550S, 3475S/3470S/3450S		103
		i7 3770T					94
		i5 3570T					94
		i5 3470T					91

32nm		Core i3/i5/i7 Processors
		i7 2600						98
		i7 660UM/640/620, 640LM/620, 620M, 610E		105
		i5 540UM/520/430, 540M/520/450/430		105
		i3 330E, 370M/350/330				90 rPGA, 105 BGA
		i3 330UM					105

32nm		Core i7 Extreme Processors
		980X						100

32nm		Celeron Processors
		U3400						105
		P4505/P4500 					90

32nm		Atom Processors
		S1260/1220					95
		S1240						102
		Z2460						90
		Z2760						90
		D2700/2550/2500					100
		N2850/2800/2650/2600				100

45nm		Xeon Processors 5400 Quad-Core
		X5492, X5482, X5472, X5470, X5460, X5450	85
		E5472, E5462, E5450/40/30/20/10/05		85
		L5408						95
		L5430, L5420, L5410				70

45nm		Xeon Processors 5200 Dual-Core
		X5282, X5272, X5270, X5260			90
		E5240						90
		E5205, E5220					70, 90
		L5240						70
		L5238, L5215					95

45nm		Atom Processors
		D525/510/425/410				100
		K525/510/425/410				100
		Z670/650					90
		Z560/550/540/530P/530/520PT/520/515/510PT/510P	90
		Z510/500					90
		N570/550					100
		N475/470/455/450				100
		N280/270					90
		330/230						125
		E680/660/640/620				90
		E680T/660T/640T/620T				110
		E665C/645C					90
		E665CT/645CT					110
		CE4170/4150/4110				110
		CE4200 series					unknown
		CE5300 series					unknown

45nm		Core2 Processors
		Solo ULV SU3500/3300				100
		T9900/9800/9600/9550/9500/9400/9300/8300/8100	105
		T6670/6500/6400					105
		T6600						90
		SU9600/9400/9300				105
		SP9600/9400					105
		SL9600/9400/9380/9300				105
		P9700/9600/9500/8800/8700/8600/8400/7570	105
		P7550/7450					90

45nm		Core2 Quad Processors
		Q9100/9000					100

45nm		Core2 Extreme Processors
		X9100/9000					105
		QX9300						100

45nm		Core i3/i5/i7 Processors
		i7 940XM/920					100
		i7 840QM/820/740/720				100

45nm		Celeron Processors
		SU2300						100
		900 						105

65nm		Core2 Duo Processors
		Solo U2200, U2100				100
		U7700/7600/7500					100
		T7800/7700/7600/7500/7400/7300/7250/7200/7100	100
		T5870/5670/5600/5550/5500/5470/5450/5300/5270	100
		T5250						100
		T5800/5750/5200					85
		L7700/7500/7400/7300/7200			100

65nm		Core2 Extreme Processors
		X7900/7800					100

65nm		Core Duo Processors
		U2500/2400					100
		T2700/2600/2450/2400/2350/2300E/2300/2250/2050	100
		L2500/2400/2300					100

65nm		Core Solo Processors
		U1500/1400/1300					100
		T1400/1350/1300/1250				100

65nm		Xeon Processors 5000 Quad-Core
		X5000						90-95
		E5000						80
		L5000						70
		L5318						95

65nm		Xeon Processors 5000 Dual-Core
		5080, 5063, 5060, 5050, 5030			80-90
		5160, 5150, 5148, 5140, 5130, 5120, 5110	80
		L5138						100

65nm		Celeron Processors
		T1700/1600					100
		560/550/540/530					100
=============== =============================================== ================


code:
.. SPDX-License-Identifier: GPL-2.0-or-later

Kernel driver corsair-cpro
==========================

Supported devices:

  * Corsair Commander Pro
  * Corsair Commander Pro (1000D)

Author: Marius Zachmann

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

This driver implements the sysfs interface for the Corsair Commander Pro.
The Corsair Commander Pro is a USB device with 6 fan connectors,
4 temperature sensor connectors and 2 Corsair LED connectors.
It can read the voltage levels on the SATA power connector.

Usage Notes
-----------

Since it is a USB device, hotswapping is possible. The device is autodetected.

Sysfs entries
-------------

======================= =====================================================================
in0_input		Voltage on SATA 12v
in1_input		Voltage on SATA 5v
in2_input		Voltage on SATA 3.3v
temp[1-4]_input		Temperature on connected temperature sensors
fan[1-6]_input		Connected fan rpm.
fan[1-6]_label		Shows fan type as detected by the device.
fan[1-6]_target		Sets fan speed target rpm.
			When reading, it reports the last value if it was set by the driver.
			Otherwise returns an error.
pwm[1-6]		Sets the fan speed. Values from 0-255. Can only be read if pwm
			was set directly.
======================= =====================================================================


code:
.. SPDX-License-Identifier: GPL-2.0-or-later

Kernel driver corsair-psu
=========================

Supported devices:

* Corsair Power Supplies

  Corsair HX550i

  Corsair HX650i

  Corsair HX750i

  Corsair HX850i

  Corsair HX1000i (revision 1 and 2)

  Corsair HX1200i

  Corsair HX1500i

  Corsair RM550i

  Corsair RM650i

  Corsair RM750i

  Corsair RM850i

  Corsair RM1000i

Author: Wilken Gottwalt

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

This driver implements the sysfs interface for the Corsair PSUs with a HID protocol
interface of the HXi and RMi series.
These power supplies provide access to a micro-controller with 2 attached
temperature sensors, 1 fan rpm sensor, 4 sensors for volt levels, 4 sensors for
power usage and 4 sensors for current levels and addtional non-sensor information
like uptimes.

Sysfs entries
-------------

=======================	========================================================
curr1_input		Total current usage
curr2_input		Current on the 12v psu rail
curr2_crit		Current max critical value on the 12v psu rail
curr3_input		Current on the 5v psu rail
curr3_crit		Current max critical value on the 5v psu rail
curr4_input		Current on the 3.3v psu rail
curr4_crit		Current max critical value on the 3.3v psu rail
fan1_input		RPM of psu fan
in0_input		Voltage of the psu ac input
in1_input		Voltage of the 12v psu rail
in1_crit		Voltage max critical value on the 12v psu rail
in1_lcrit		Voltage min critical value on the 12v psu rail
in2_input		Voltage of the 5v psu rail
in2_crit		Voltage max critical value on the 5v psu rail
in2_lcrit		Voltage min critical value on the 5v psu rail
in3_input		Voltage of the 3.3v psu rail
in3_crit		Voltage max critical value on the 3.3v psu rail
in3_lcrit		Voltage min critical value on the 3.3v psu rail
power1_input		Total power usage
power2_input		Power usage of the 12v psu rail
power3_input		Power usage of the 5v psu rail
power4_input		Power usage of the 3.3v psu rail
temp1_input		Temperature of the psu vrm component
temp1_crit		Temperature max cirtical value of the psu vrm component
temp2_input		Temperature of the psu case
temp2_crit		Temperature max critical value of psu case
=======================	========================================================

Usage Notes
-----------

It is an USB HID device, so it is auto-detected and supports hot-swapping.

Flickering values in the rail voltage levels can be an indicator for a failing
PSU. The driver also provides some additional useful values via debugfs, which
do not fit into the hwmon class.

Debugfs entries
---------------

=======================	========================================================
ocpmode                 Single or multi rail mode of the PCIe power connectors
product                 Product name of the psu
uptime			Session uptime of the psu
uptime_total		Total uptime of the psu
vendor			Vendor name of the psu
=======================	========================================================


code:
Kernel driver da9052
====================

Supported chips:

  * Dialog Semiconductors DA9052-BC and DA9053-AA/Bx PMICs

    Prefix: 'da9052'

    Datasheet: Datasheet is not publicly available.

Authors: David Dajun Chen <dchen@diasemi.com>

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

The DA9052/53 provides an Analogue to Digital Converter (ADC) with 10 bits
resolution and track and hold circuitry combined with an analogue input
multiplexer. The analogue input multiplexer will allow conversion of up to 10
different inputs. The track and hold circuit ensures stable input voltages at
the input of the ADC during the conversion.

The ADC is used to measure the following inputs:

========= ===================================================================
Channel 0 VDDOUT - measurement of the system voltage
Channel 1 ICH - internal battery charger current measurement
Channel 2 TBAT - output from the battery NTC
Channel 3 VBAT - measurement of the battery voltage
Channel 4 ADC_IN4 - high impedance input (0 - 2.5V)
Channel 5 ADC_IN5 - high impedance input (0 - 2.5V)
Channel 6 ADC_IN6 - high impedance input (0 - 2.5V)
Channel 7 XY - TSI interface to measure the X and Y voltage of the touch
	  screen resistive potentiometers
Channel 8 Internal Tjunc. - sense (internal temp. sensor)
Channel 9 VBBAT - measurement of the backup battery voltage
========= ===================================================================

By using sysfs attributes we can measure the system voltage VDDOUT, the battery
charging current ICH, battery temperature TBAT, battery junction temperature
TJUNC, battery voltage VBAT and the back up battery voltage VBBAT.

Voltage Monitoring
------------------

Voltages are sampled by a 10 bit ADC.

The battery voltage is calculated as:

	Milli volt = ((ADC value * 1000) / 512) + 2500

The backup battery voltage is calculated as:

	Milli volt = (ADC value * 2500) / 512;

The voltages on ADC channels 4, 5 and 6 are calculated as:

	Milli volt = (ADC value * 2500) / 1023

Temperature Monitoring
----------------------

Temperatures are sampled by a 10 bit ADC.  Junction and battery temperatures
are monitored by the ADC channels.

The junction temperature is calculated:

	Degrees celsius = 1.708 * (TJUNC_RES - T_OFFSET) - 108.8

The junction temperature attribute is supported by the driver.

The battery temperature is calculated:

	Degree Celsius = 1 / (t1 + 1/298) - 273

where t1 = (1/B)* ln(( ADCval * 2.5)/(R25*ITBAT*255))

Default values of R25, B, ITBAT are 10e3, 3380 and 50e-6 respectively.


code:
Kernel driver da9055
====================

Supported chips:
  * Dialog Semiconductors DA9055 PMIC

    Prefix: 'da9055'

    Datasheet: Datasheet is not publicly available.

Authors: David Dajun Chen <dchen@diasemi.com>

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

The DA9055 provides an Analogue to Digital Converter (ADC) with 10 bits
resolution and track and hold circuitry combined with an analogue input
multiplexer. The analogue input multiplexer will allow conversion of up to 5
different inputs. The track and hold circuit ensures stable input voltages at
the input of the ADC during the conversion.

The ADC is used to measure the following inputs:

- Channel 0: VDDOUT - measurement of the system voltage
- Channel 1: ADC_IN1 - high impedance input (0 - 2.5V)
- Channel 2: ADC_IN2 - high impedance input (0 - 2.5V)
- Channel 3: ADC_IN3 - high impedance input (0 - 2.5V)
- Channel 4: Internal Tjunc. - sense (internal temp. sensor)

By using sysfs attributes we can measure the system voltage VDDOUT,
chip junction temperature and auxiliary channels voltages.

Voltage Monitoring
------------------

Voltages are sampled in a AUTO mode it can be manually sampled too and results
are stored in a 10 bit ADC.

The system voltage is calculated as:

	Milli volt = ((ADC value * 1000) / 85) + 2500

The voltages on ADC channels 1, 2 and 3 are calculated as:

	Milli volt = (ADC value * 1000) / 102

Temperature Monitoring
----------------------

Temperatures are sampled by a 10 bit ADC.  Junction temperatures
are monitored by the ADC channels.

The junction temperature is calculated:

	Degrees celsius = -0.4084 * (ADC_RES - T_OFFSET) + 307.6332

The junction temperature attribute is supported by the driver.


code:
.. SPDX-License-Identifier: GPL-2.0-or-later

.. include:: <isonum.txt>

Kernel driver dell-smm-hwmon
============================

:Copyright: |copy| 2002-2005 Massimo Dal Zotto <dz@debian.org>
:Copyright: |copy| 2019 Giovanni Mascellani <gio@debian.org>

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

On many Dell laptops the System Management Mode (SMM) BIOS can be
queried for the status of fans and temperature sensors.  Userspace
utilities like ``sensors`` can be used to return the readings. The
userspace suite `i8kutils`__ can also be used to read the sensors and
automatically adjust fan speed (please notice that it currently uses
the deprecated ``/proc/i8k`` interface).

 __ https://github.com/vitorafsr/i8kutils

``sysfs`` interface
-------------------

Temperature sensors and fans can be queried and set via the standard
``hwmon`` interface on ``sysfs``, under the directory
``/sys/class/hwmon/hwmonX`` for some value of ``X`` (search for the
``X`` such that ``/sys/class/hwmon/hwmonX/name`` has content
``dell_smm``). A number of other attributes can be read or written:

=============================== ======= =======================================
Name				Perm	Description
=============================== ======= =======================================
fan[1-3]_input                  RO      Fan speed in RPM.
fan[1-3]_label                  RO      Fan label.
fan[1-3]_min                    RO      Minimal Fan speed in RPM
fan[1-3]_max                    RO      Maximal Fan speed in RPM
fan[1-3]_target                 RO      Expected Fan speed in RPM
pwm[1-3]                        RW      Control the fan PWM duty-cycle.
pwm1_enable                     WO      Enable or disable automatic BIOS fan
                                        control (not supported on all laptops,
                                        see below for details).
temp[1-10]_input                RO      Temperature reading in milli-degrees
                                        Celsius.
temp[1-10]_label                RO      Temperature sensor label.
=============================== ======= =======================================

Due to the nature of the SMM interface, each pwmX attribute controls
fan number X.

Disabling automatic BIOS fan control
------------------------------------

On some laptops the BIOS automatically sets fan speed every few
seconds. Therefore the fan speed set by mean of this driver is quickly
overwritten.

There is experimental support for disabling automatic BIOS fan
control, at least on laptops where the corresponding SMM command is
known, by writing the value ``1`` in the attribute ``pwm1_enable``
(writing ``2`` enables automatic BIOS control again). Even if you have
more than one fan, all of them are set to either enabled or disabled
automatic fan control at the same time and, notwithstanding the name,
``pwm1_enable`` sets automatic control for all fans.

If ``pwm1_enable`` is not available, then it means that SMM codes for
enabling and disabling automatic BIOS fan control are not whitelisted
for your hardware. It is possible that codes that work for other
laptops actually work for yours as well, or that you have to discover
new codes.

Check the list ``i8k_whitelist_fan_control`` in file
``drivers/hwmon/dell-smm-hwmon.c`` in the kernel tree: as a first
attempt you can try to add your machine and use an already-known code
pair. If, after recompiling the kernel, you see that ``pwm1_enable``
is present and works (i.e., you can manually control the fan speed),
then please submit your finding as a kernel patch, so that other users
can benefit from it. Please see
:ref:`Documentation/process/submitting-patches.rst <submittingpatches>`
for information on submitting patches.

If no known code works on your machine, you need to resort to do some
probing, because unfortunately Dell does not publish datasheets for
its SMM. You can experiment with the code in `this repository`__ to
probe the BIOS on your machine and discover the appropriate codes.

 __ https://github.com/clopez/dellfan/

Again, when you find new codes, we'd be happy to have your patches!

``thermal`` interface
---------------------------

The driver also exports the fans as thermal cooling devices with
``type`` set to ``dell-smm-fan[1-3]``. This allows for easy fan control
using one of the thermal governors.

Module parameters
-----------------

* force:bool
                   Force loading without checking for supported
                   models. (default: 0)

* ignore_dmi:bool
                   Continue probing hardware even if DMI data does not
                   match. (default: 0)

* restricted:bool
                   Allow fan control only to processes with the
                   ``CAP_SYS_ADMIN`` capability set or processes run
                   as root when using the legacy ``/proc/i8k``
                   interface. In this case normal users will be able
                   to read temperature and fan status but not to
                   control the fan.  If your notebook is shared with
                   other users and you don't trust them you may want
                   to use this option. (default: 1, only available
                   with ``CONFIG_I8K``)

* power_status:bool
                   Report AC status in ``/proc/i8k``. (default: 0,
                   only available with ``CONFIG_I8K``)

* fan_mult:uint
                   Factor to multiply fan speed with. (default:
                   autodetect)

* fan_max:uint
                   Maximum configurable fan speed. (default:
                   autodetect)

Legacy ``/proc`` interface
--------------------------

.. warning:: This interface is obsolete and deprecated and should not
             used in new applications. This interface is only
             available when kernel is compiled with option
             ``CONFIG_I8K``.

The information provided by the kernel driver can be accessed by
simply reading the ``/proc/i8k`` file. For example::

    $ cat /proc/i8k
    1.0 A17 2J59L02 52 2 1 8040 6420 1 2

The fields read from ``/proc/i8k`` are::

    1.0 A17 2J59L02 52 2 1 8040 6420 1 2
    |   |   |       |  | | |    |    | |
    |   |   |       |  | | |    |    | +------- 10. buttons status
    |   |   |       |  | | |    |    +--------- 9.  AC status
    |   |   |       |  | | |    +-------------- 8.  fan0 RPM
    |   |   |       |  | | +------------------- 7.  fan1 RPM
    |   |   |       |  | +--------------------- 6.  fan0 status
    |   |   |       |  +----------------------- 5.  fan1 status
    |   |   |       +-------------------------- 4.  temp0 reading (Celsius)
    |   |   +---------------------------------- 3.  Dell service tag (later known as 'serial number')
    |   +-------------------------------------- 2.  BIOS version
    +------------------------------------------ 1.  /proc/i8k format version

A negative value, for example -22, indicates that the BIOS doesn't
return the corresponding information. This is normal on some
models/BIOSes.

For performance reasons the ``/proc/i8k`` doesn't report by default
the AC status since this SMM call takes a long time to execute and is
not really needed.  If you want to see the ac status in ``/proc/i8k``
you must explictitly enable this option by passing the
``power_status=1`` parameter to insmod. If AC status is not
available -1 is printed instead.

The driver provides also an ioctl interface which can be used to
obtain the same information and to control the fan status. The ioctl
interface can be accessed from C programs or from shell using the
i8kctl utility. See the source file of ``i8kutils`` for more
information on how to use the ioctl interface.

SMM Interface
-------------

.. warning:: The SMM interface was reverse-engineered by trial-and-error
             since Dell did not provide any Documentation,
             please keep that in mind.

The driver uses the SMM interface to send commands to the system BIOS.
This interface is normally used by Dell's 32-bit diagnostic program or
on newer notebook models by the buildin BIOS diagnostics.
The SMM is triggered by writing to the special ioports ``0xb2`` and ``0x84``,
and may cause short hangs when the BIOS code is taking too long to
execute.

The SMM handler inside the system BIOS looks at the contents of the
``eax``, ``ebx``, ``ecx``, ``edx``, ``esi`` and ``edi`` registers.
Each register has a special purpose:

=============== ==================================
Register        Purpose
=============== ==================================
eax             Holds the command code before SMM,
                holds the first result after SMM.
ebx             Holds the arguments.
ecx             Unknown, set to 0.
edx             Holds the second result after SMM.
esi             Unknown, set to 0.
edi             Unknown, set to 0.
=============== ==================================

The SMM handler can signal a failure by either:

- setting the lower sixteen bits of ``eax`` to ``0xffff``
- not modifying ``eax`` at all
- setting the carry flag

SMM command codes
-----------------

=============== ======================= ================================================
Command Code    Command Name            Description
=============== ======================= ================================================
``0x0025``      Get Fn key status       Returns the Fn key pressed after SMM:

                                        - 9th bit in ``eax`` indicates Volume up
                                        - 10th bit in ``eax`` indicates Volume down
                                        - both bits indicate Volume mute

``0xa069``      Get power status        Returns current power status after SMM:

                                        - 1st bit in ``eax`` indicates Battery connected
                                        - 3th bit in ``eax`` indicates AC connected

``0x00a3``      Get fan state           Returns current fan state after SMM:

                                        - 1st byte in ``eax`` holds the current
                                          fan state (0 - 2 or 3)

``0x01a3``      Set fan state           Sets the fan speed:

                                        - 1st byte in ``ebx`` holds the fan number
                                        - 2nd byte in ``ebx`` holds the desired
                                          fan state (0 - 2 or 3)

``0x02a3``      Get fan speed           Returns the current fan speed in RPM:

                                        - 1st byte in ``ebx`` holds the fan number
                                        - 1st word in ``eax`` holds the current
                                          fan speed in RPM (after SMM)

``0x03a3``      Get fan type            Returns the fan type:

                                        - 1st byte in ``ebx`` holds the fan number
                                        - 1st byte in ``eax`` holds the
                                          fan type (after SMM):

                                          - 5th bit indicates docking fan
                                          - 1 indicates Processor fan
                                          - 2 indicates Motherboard fan
                                          - 3 indicates Video fan
                                          - 4 indicates Power supply fan
                                          - 5 indicates Chipset fan
                                          - 6 indicates other fan type

``0x04a3``      Get nominal fan speed   Returns the nominal RPM in each fan state:

                                        - 1st byte in ``ebx`` holds the fan number
                                        - 2nd byte in ``ebx`` holds the fan state
                                          in question (0 - 2 or 3)
                                        - 1st word in ``eax`` holds the nominal
                                          fan speed in RPM (after SMM)

``0x05a3``      Get fan speed tolerance Returns the speed tolerance for each fan state:

                                        - 1st byte in ``ebx`` holds the fan number
                                        - 2nd byte in ``ebx`` holds the fan state
                                          in question (0 - 2 or 3)
                                        - 1st byte in ``eax`` returns the speed
                                          tolerance

``0x10a3``      Get sensor temperature  Returns the measured temperature:

                                        - 1st byte in ``ebx`` holds the sensor number
                                        - 1st byte in ``eax`` holds the measured
                                          temperature (after SMM)

``0x11a3``      Get sensor type         Returns the sensor type:

                                        - 1st byte in ``ebx`` holds the sensor number
                                        - 1st byte in ``eax`` holds the
                                          temperature type (after SMM):

                                          - 1 indicates CPU sensor
                                          - 2 indicates GPU sensor
                                          - 3 indicates SODIMM sensor
                                          - 4 indicates other sensor type
                                          - 5 indicates Ambient sensor
                                          - 6 indicates other sensor type

``0xfea3``      Get SMM signature       Returns Dell signature if interface
                                        is supported (after SMM):

                                        - ``eax`` holds 1145651527
                                          (0x44494147 or "DIAG")
                                        - ``edx`` holds 1145392204
                                          (0x44454c4c or "DELL")

``0xffa3``      Get SMM signature       Same as ``0xfea3``, check both.
=============== ======================= ================================================

There are additional commands for enabling (``0x31a3`` or ``0x35a3``) and
disabling (``0x30a3`` or ``0x34a3``) automatic fan speed control.
The commands are however causing severe sideeffects on many machines, so
they are not used by default.

On several machines (Inspiron 3505, Precision 490, Vostro 1720, ...), the
fans supports a 4th "magic" state, which signals the BIOS that automatic
fan control should be enabled for a specific fan.
However there are also some machines who do support a 4th regular fan state too,
but in case of the "magic" state, the nominal RPM reported for this state is a
placeholder value, which however is not always detectable.

Firmware Bugs
-------------

The SMM calls can behave erratic on some machines:

======================================================= =================
Firmware Bug                                            Affected Machines
======================================================= =================
Reading of fan states return spurious errors.           Precision 490

Reading of fan types causes erratic fan behaviour.      Studio XPS 8000

                                                        Studio XPS 8100

                                                        Inspiron 580

                                                        Inspiron 3505

Fan-related SMM calls take too long (about 500ms).      Inspiron 7720

                                                        Vostro 3360

                                                        XPS 13 9333

                                                        XPS 15 L502X
======================================================= =================

In case you experience similar issues on your Dell machine, please
submit a bugreport on bugzilla to we can apply workarounds.

Limitations
-----------

The SMM calls can take too long to execute on some machines, causing
short hangs and/or audio glitches.
Also the fan state needs to be restored after suspend, as well as
the automatic mode settings.
When reading a temperature sensor, values above 127 degrees indicate
a BIOS read error or a deactivated sensor.


code:
Kernel driver dme1737
=====================

Supported chips:

  * SMSC DME1737 and compatibles (like Asus A8000)

    Prefix: 'dme1737'

    Addresses scanned: I2C 0x2c, 0x2d, 0x2e

    Datasheet: Provided by SMSC upon request and under NDA

  * SMSC SCH3112, SCH3114, SCH3116

    Prefix: 'sch311x'

    Addresses scanned: none, address read from Super-I/O config space

    Datasheet: Available on the Internet

  * SMSC SCH5027

    Prefix: 'sch5027'

    Addresses scanned: I2C 0x2c, 0x2d, 0x2e

    Datasheet: Provided by SMSC upon request and under NDA

  * SMSC SCH5127

    Prefix: 'sch5127'

    Addresses scanned: none, address read from Super-I/O config space

    Datasheet: Provided by SMSC upon request and under NDA

Authors:
    Juerg Haefliger <juergh@gmail.com>

Module Parameters
-----------------

* force_start: bool
			Enables the monitoring of voltage, fan and temp inputs
			and PWM output control functions. Using this parameter
			shouldn't be required since the BIOS usually takes care
			of this.

* probe_all_addr: bool
			Include non-standard LPC addresses 0x162e and 0x164e
			when probing for ISA devices. This is required for the
			following boards:
			- VIA EPIA SN18000

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

This driver implements support for the hardware monitoring capabilities of the
SMSC DME1737 and Asus A8000 (which are the same), SMSC SCH5027, SCH311x,
and SCH5127 Super-I/O chips. These chips feature monitoring of 3 temp sensors
temp[1-3] (2 remote diodes and 1 internal), 8 voltages in[0-7] (7 external and
1 internal) and up to 6 fan speeds fan[1-6]. Additionally, the chips implement
up to 5 PWM outputs pwm[1-3,5-6] for controlling fan speeds both manually and
automatically.

For the DME1737, A8000 and SCH5027, fan[1-2] and pwm[1-2] are always present.
Fan[3-6] and pwm[3,5-6] are optional features and their availability depends on
the configuration of the chip. The driver will detect which features are
present during initialization and create the sysfs attributes accordingly.

For the SCH311x and SCH5127, fan[1-3] and pwm[1-3] are always present and
fan[4-6] and pwm[5-6] don't exist.

The hardware monitoring features of the DME1737, A8000, and SCH5027 are only
accessible via SMBus, while the SCH311x and SCH5127 only provide access via
the ISA bus. The driver will therefore register itself as an I2C client driver
if it detects a DME1737, A8000, or SCH5027 and as a platform driver if it
detects a SCH311x or SCH5127 chip.

Voltage Monitoring
------------------

The voltage inputs are sampled with 12-bit resolution and have internal
scaling resistors. The values returned by the driver therefore reflect true
millivolts and don't need scaling. The voltage inputs are mapped as follows
(the last column indicates the input ranges):

DME1737, A8000::

	in0: +5VTR	(+5V standby)		0V - 6.64V
	in1: Vccp	(processor core)	0V - 3V
	in2: VCC	(internal +3.3V)	0V - 4.38V
	in3: +5V				0V - 6.64V
	in4: +12V				0V - 16V
	in5: VTR	(+3.3V standby)		0V - 4.38V
	in6: Vbat	(+3.0V)			0V - 4.38V

SCH311x::

	in0: +2.5V				0V - 3.32V
	in1: Vccp	(processor core)	0V - 2V
	in2: VCC	(internal +3.3V)	0V - 4.38V
	in3: +5V				0V - 6.64V
	in4: +12V				0V - 16V
	in5: VTR	(+3.3V standby)		0V - 4.38V
	in6: Vbat	(+3.0V)			0V - 4.38V

SCH5027::

	in0: +5VTR	(+5V standby)		0V - 6.64V
	in1: Vccp	(processor core)	0V - 3V
	in2: VCC	(internal +3.3V)	0V - 4.38V
	in3: V2_IN				0V - 1.5V
	in4: V1_IN				0V - 1.5V
	in5: VTR	(+3.3V standby)		0V - 4.38V
	in6: Vbat	(+3.0V)			0V - 4.38V

SCH5127::

	in0: +2.5				0V - 3.32V
	in1: Vccp	(processor core)	0V - 3V
	in2: VCC	(internal +3.3V)	0V - 4.38V
	in3: V2_IN				0V - 1.5V
	in4: V1_IN				0V - 1.5V
	in5: VTR	(+3.3V standby)		0V - 4.38V
	in6: Vbat	(+3.0V)			0V - 4.38V
	in7: Vtrip	(+1.5V)			0V - 1.99V

Each voltage input has associated min and max limits which trigger an alarm
when crossed.

Temperature Monitoring
----------------------

Temperatures are measured with 12-bit resolution and reported in millidegree
Celsius. The chip also features offsets for all 3 temperature inputs which -
when programmed - get added to the input readings. The chip does all the
scaling by itself and the driver therefore reports true temperatures that don't
need any user-space adjustments. The temperature inputs are mapped as follows
(the last column indicates the input ranges)::

	temp1: Remote diode 1 (3904 type) temperature	-127C - +127C
	temp2: DME1737 internal temperature		-127C - +127C
	temp3: Remote diode 2 (3904 type) temperature	-127C - +127C

Each temperature input has associated min and max limits which trigger an alarm
when crossed. Additionally, each temperature input has a fault attribute that
returns 1 when a faulty diode or an unconnected input is detected and 0
otherwise.

Fan Monitoring
--------------

Fan RPMs are measured with 16-bit resolution. The chip provides inputs for 6
fan tachometers. All 6 inputs have an associated min limit which triggers an
alarm when crossed. Fan inputs 1-4 provide type attributes that need to be set
to the number of pulses per fan revolution that the connected tachometer
generates. Supported values are 1, 2, and 4. Fan inputs 5-6 only support fans
that generate 2 pulses per revolution. Fan inputs 5-6 also provide a max
attribute that needs to be set to the maximum attainable RPM (fan at 100% duty-
cycle) of the input. The chip adjusts the sampling rate based on this value.

PWM Output Control
------------------

This chip features 5 PWM outputs. PWM outputs 1-3 are associated with fan
inputs 1-3 and PWM outputs 5-6 are associated with fan inputs 5-6. PWM outputs
1-3 can be configured to operate either in manual or automatic mode by setting
the appropriate enable attribute accordingly. PWM outputs 5-6 can only operate
in manual mode, their enable attributes are therefore read-only. When set to
manual mode, the fan speed is set by writing the duty-cycle value to the
appropriate PWM attribute. In automatic mode, the PWM attribute returns the
current duty-cycle as set by the fan controller in the chip. All PWM outputs
support the setting of the output frequency via the freq attribute.

In automatic mode, the chip supports the setting of the PWM ramp rate which
defines how fast the PWM output is adjusting to changes of the associated
temperature input. Associating PWM outputs to temperature inputs is done via
temperature zones. The chip features 3 zones whose assignments to temperature
inputs is static and determined during initialization. These assignments can
be retrieved via the zone[1-3]_auto_channels_temp attributes. Each PWM output
is assigned to one (or hottest of multiple) temperature zone(s) through the
pwm[1-3]_auto_channels_zone attributes. Each PWM output has 3 distinct output
duty-cycles: full, low, and min. Full is internally hard-wired to 255 (100%)
and low and min can be programmed via pwm[1-3]_auto_point1_pwm and
pwm[1-3]_auto_pwm_min, respectively. The thermal thresholds of the zones are
programmed via zone[1-3]_auto_point[1-3]_temp and
zone[1-3]_auto_point1_temp_hyst:

	=============================== =======================================
	pwm[1-3]_auto_point2_pwm	full-speed duty-cycle (255, i.e., 100%)
	pwm[1-3]_auto_point1_pwm	low-speed duty-cycle
	pwm[1-3]_auto_pwm_min		min-speed duty-cycle

	zone[1-3]_auto_point3_temp	full-speed temp (all outputs)
	zone[1-3]_auto_point2_temp	full-speed temp
	zone[1-3]_auto_point1_temp	low-speed temp
	zone[1-3]_auto_point1_temp_hyst	min-speed temp
	=============================== =======================================

The chip adjusts the output duty-cycle linearly in the range of auto_point1_pwm
to auto_point2_pwm if the temperature of the associated zone is between
auto_point1_temp and auto_point2_temp. If the temperature drops below the
auto_point1_temp_hyst value, the output duty-cycle is set to the auto_pwm_min
value which only supports two values: 0 or auto_point1_pwm. That means that the
fan either turns completely off or keeps spinning with the low-speed
duty-cycle. If any of the temperatures rise above the auto_point3_temp value,
all PWM outputs are set to 100% duty-cycle.

Following is another representation of how the chip sets the output duty-cycle
based on the temperature of the associated thermal zone:

	=============== =============== =================
	Temperature	Duty-Cycle	Duty-Cycle
			Rising Temp	Falling Temp
	=============== =============== =================
	full-speed	full-speed	full-speed

	-		< linearly	-
			adjusted
			duty-cycle >

	low-speed	low-speed	low-speed
	-		min-speed	low-speed
	min-speed	min-speed	min-speed
	-		min-speed	min-speed
	=============== =============== =================

Sysfs Attributes
----------------

Following is a list of all sysfs attributes that the driver provides, their
permissions and a short description:

=============================== ======= =======================================
Name				Perm	Description
=============================== ======= =======================================
cpu0_vid			RO	CPU core reference voltage in
					millivolts.
vrm				RW	Voltage regulator module version
					number.

in[0-7]_input			RO	Measured voltage in millivolts.
in[0-7]_min			RW	Low limit for voltage input.
in[0-7]_max			RW	High limit for voltage input.
in[0-7]_alarm			RO	Voltage input alarm. Returns 1 if
					voltage input is or went outside the
					associated min-max range, 0 otherwise.

temp[1-3]_input			RO	Measured temperature in millidegree
					Celsius.
temp[1-3]_min			RW	Low limit for temp input.
temp[1-3]_max			RW	High limit for temp input.
temp[1-3]_offset		RW	Offset for temp input. This value will
					be added by the chip to the measured
					temperature.
temp[1-3]_alarm			RO	Alarm for temp input. Returns 1 if temp
					input is or went outside the associated
					min-max range, 0 otherwise.
temp[1-3]_fault			RO	Temp input fault. Returns 1 if the chip
					detects a faulty thermal diode or an
					unconnected temp input, 0 otherwise.

zone[1-3]_auto_channels_temp	RO	Temperature zone to temperature input
					mapping. This attribute is a bitfield
					and supports the following values:

						- 1: temp1
						- 2: temp2
						- 4: temp3
zone[1-3]_auto_point1_temp_hyst	RW	Auto PWM temp point1 hysteresis. The
					output of the corresponding PWM is set
					to the pwm_auto_min value if the temp
					falls below the auto_point1_temp_hyst
					value.
zone[1-3]_auto_point[1-3]_temp	RW	Auto PWM temp points. Auto_point1 is
					the low-speed temp, auto_point2 is the
					full-speed temp, and auto_point3 is the
					temp at which all PWM outputs are set
					to full-speed (100% duty-cycle).

fan[1-6]_input			RO	Measured fan speed in RPM.
fan[1-6]_min			RW	Low limit for fan input.
fan[1-6]_alarm			RO	Alarm for fan input. Returns 1 if fan
					input is or went below the associated
					min value, 0 otherwise.
fan[1-4]_type			RW	Type of attached fan. Expressed in
					number of pulses per revolution that
					the fan generates. Supported values are
					1, 2, and 4.
fan[5-6]_max			RW	Max attainable RPM at 100% duty-cycle.
					Required for chip to adjust the
					sampling rate accordingly.

pmw[1-3,5-6]			RO/RW	Duty-cycle of PWM output. Supported
					values are 0-255 (0%-100%). Only
					writeable if the associated PWM is in
					manual mode.
pwm[1-3]_enable			RW	Enable of PWM outputs 1-3. Supported
					values are:

						- 0: turned off (output @ 100%)
						- 1: manual mode
						- 2: automatic mode
pwm[5-6]_enable			RO	Enable of PWM outputs 5-6. Always
					returns 1 since these 2 outputs are
					hard-wired to manual mode.
pmw[1-3,5-6]_freq		RW	Frequency of PWM output. Supported
					values are in the range 11Hz-30000Hz
					(default is 25000Hz).
pmw[1-3]_ramp_rate		RW	Ramp rate of PWM output. Determines how
					fast the PWM duty-cycle will change
					when the PWM is in automatic mode.
					Expressed in ms per PWM step. Supported
					values are in the range 0ms-206ms
					(default is 0, which means the duty-
					cycle changes instantly).
pwm[1-3]_auto_channels_zone	RW	PWM output to temperature zone mapping.
					This attribute is a bitfield and
					supports the following values:

						- 1: zone1
						- 2: zone2
						- 4: zone3
						- 6: highest of zone[2-3]
						- 7: highest of zone[1-3]
pwm[1-3]_auto_pwm_min		RW	Auto PWM min pwm. Minimum PWM duty-
					cycle. Supported values are 0 or
					auto_point1_pwm.
pwm[1-3]_auto_point1_pwm	RW	Auto PWM pwm point. Auto_point1 is the
					low-speed duty-cycle.
pwm[1-3]_auto_point2_pwm	RO	Auto PWM pwm point. Auto_point2 is the
					full-speed duty-cycle which is hard-
					wired to 255 (100% duty-cycle).
=============================== ======= =======================================

Chip Differences
----------------

======================= ======= ======= ======= =======
Feature			dme1737	sch311x	sch5027	sch5127
======================= ======= ======= ======= =======
temp[1-3]_offset	yes	yes
vid			yes
zone3			yes	yes	yes
zone[1-3]_hyst		yes	yes
pwm min/off		yes	yes
fan3			opt	yes	opt	yes
pwm3			opt	yes	opt	yes
fan4			opt		opt
fan5			opt		opt
pwm5			opt		opt
fan6			opt		opt
pwm6			opt		opt
in7						yes
======================= ======= ======= ======= =======


code:
.. SPDX-License-Identifier: GPL-2.0-or-later

Kernel driver dps920ab
========================

Supported chips:

  * Delta DPS920AB

    Prefix: 'dps920ab'

    Addresses scanned: -

Authors:
    Robert Marko <robert.marko@sartura.hr>

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

This driver implements support for Delta DPS920AB 920W 54V DC single output
power supply with PMBus support.

The driver is a client driver to the core PMBus driver.
Please see Documentation/hwmon/pmbus.rst for details on PMBus client drivers.

Usage Notes
-----------

This driver does not auto-detect devices. You will have to instantiate the
devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for
details.

Sysfs entries
-------------

======================= ======================================================
curr1_label		"iin"
curr1_input		Measured input current
curr1_alarm		Input current high alarm

curr2_label		"iout1"
curr2_input		Measured output current
curr2_max		Maximum output current
curr2_rated_max		Maximum rated output current

in1_label		"vin"
in1_input		Measured input voltage
in1_alarm		Input voltage alarm

in2_label		"vout1"
in2_input		Measured output voltage
in2_rated_min		Minimum rated output voltage
in2_rated_max		Maximum rated output voltage
in2_alarm		Output voltage alarm

power1_label		"pin"
power1_input		Measured input power
power1_alarm		Input power high alarm

power2_label		"pout1"
power2_input		Measured output power
power2_rated_max	Maximum rated output power

temp[1-3]_input		Measured temperature
temp[1-3]_alarm		Temperature alarm

fan1_alarm		Fan 1 warning.
fan1_fault		Fan 1 fault.
fan1_input		Fan 1 speed in RPM.
======================= ======================================================