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

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

Merge tag 'hwmon-for-linus-v4.7' of...

Merge tag 'hwmon-for-linus-v4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon updates from Guenter Roeck:

 - major rework of it87 driver: cleanup, added support for additional
   attributes, added support for two chips in the system, added support
   for IT8728E

 - fam17h_power driver now reports accumulated power consumption

 - new driver for MAX31722/MAX31723 temperature sensors

 - minor fixes to sch5636 and ads7828 drivers

* tag 'hwmon-for-linus-v4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (35 commits)
  hwmon: (sch5636) trivial fix of spelling mistake on revision
  hwmon: (it87) Add support for IT8628E
  hwmon: (it87) Fix pwm_temp_map for system with 6 pwm channels
  hwmon: (it87) Support automatic pwm control on newer chips
  hwmon: (it87) Enhance validation for fan4 and fan5
  hwmon: (it87) Support disabling fan control for all pwm control and chips
  hwmon: (it87) Formatting cleanup
  hwmon: (it87) Use defines for array sizes and sensor counts
  hwmon: (it87) Use BIT macro
  hwmon: (it87) Add support for VIN7 to VIN10 on IT8620E
  hwmon: (it87) Simplify reading voltage registers
  hwmon: (it87) Support up to 6 temperature sensors on IT8620E
  hwmon: (it87) Convert to use new hwmon API
  hwmon: (it87) Use single group and is_visible for miscellaneous attributes
  hwmon: (it87) Use is_visible for pwm attributes
  hwmon: (it87) Use is_visible for fan attributes
  hwmon: (it87) Use is_visible for temperature sensors
  hwmon: (it87) Use is_visible for voltage sensors
  hwmon: (it87) Rearrange code to avoid forward declarations
  hwmon: (it87) Add support for second Super-IO chip
  ...
parents 1cc3880a d6a442df
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ Required properties:
  * "lltc,ltc3886"
  * "lltc,ltc3887"
  * "lltc,ltm2987"
  * "lltc,ltm4675"
  * "lltc,ltm4676"
- reg: I2C slave address

+64 −1
Original line number Diff line number Diff line
@@ -10,14 +10,22 @@ Supported chips:
  Datasheets:
  BIOS and Kernel Developer's Guide (BKDG) For AMD Family 15h Processors
  BIOS and Kernel Developer's Guide (BKDG) For AMD Family 16h Processors
  AMD64 Architecture Programmer's Manual Volume 2: System Programming

Author: Andreas Herrmann <herrmann.der.user@googlemail.com>

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

1) Processor TDP (Thermal design power)

Given a fixed frequency and voltage, the power consumption of a
processor varies based on the workload being executed. Derated power
is the power consumed when running a specific application. Thermal
design power (TDP) is an example of derated power.

This driver permits reading of registers providing power information
of AMD Family 15h and 16h processors.
of AMD Family 15h and 16h processors via TDP algorithm.

For AMD Family 15h and 16h processors the following power values can
be calculated using different processor northbridge function
@@ -37,3 +45,58 @@ This driver provides ProcessorPwrWatts and CurrPwrWatts:
On multi-node processors the calculated value is for the entire
package and not for a single node. Thus the driver creates sysfs
attributes only for internal node0 of a multi-node processor.

2) Accumulated Power Mechanism

This driver also introduces an algorithm that should be used to
calculate the average power consumed by a processor during a
measurement interval Tm. The feature of accumulated power mechanism is
indicated by CPUID Fn8000_0007_EDX[12].

* Tsample: compute unit power accumulator sample period
* Tref: the PTSC counter period
* PTSC: performance timestamp counter
* N: the ratio of compute unit power accumulator sample period to the
  PTSC period
* Jmax: max compute unit accumulated power which is indicated by
  MaxCpuSwPwrAcc MSR C001007b
* Jx/Jy: compute unit accumulated power which is indicated by
  CpuSwPwrAcc MSR C001007a
* Tx/Ty: the value of performance timestamp counter which is indicated
  by CU_PTSC MSR C0010280
* PwrCPUave: CPU average power

i. Determine the ratio of Tsample to Tref by executing CPUID Fn8000_0007.
	N = value of CPUID Fn8000_0007_ECX[CpuPwrSampleTimeRatio[15:0]].

ii. Read the full range of the cumulative energy value from the new
MSR MaxCpuSwPwrAcc.
	Jmax = value returned.
iii. At time x, SW reads CpuSwPwrAcc MSR and samples the PTSC.
	Jx = value read from CpuSwPwrAcc and Tx = value read from
PTSC.

iv. At time y, SW reads CpuSwPwrAcc MSR and samples the PTSC.
	Jy = value read from CpuSwPwrAcc and Ty = value read from
PTSC.

v. Calculate the average power consumption for a compute unit over
time period (y-x). Unit of result is uWatt.
	if (Jy < Jx) // Rollover has occurred
		Jdelta = (Jy + Jmax) - Jx
	else
		Jdelta = Jy - Jx
	PwrCPUave = N * Jdelta * 1000 / (Ty - Tx)

This driver provides PwrCPUave and interval(default is 10 millisecond
and maximum is 1 second):
* power1_average (PwrCPUave)
* power1_average_interval (Interval)

The power1_average_interval can be updated at /etc/sensors3.conf file
as below:

chip "fam15h_power-*"
	set power1_average_interval 0.01

Then save it with "sensors -s".
+9 −6
Original line number Diff line number Diff line
@@ -9,6 +9,9 @@ Supported chips:
  * IT8620E
    Prefix: 'it8620'
    Addresses scanned: from Super I/O config space (8 I/O ports)
  * IT8628E
    Prefix: 'it8628'
    Addresses scanned: from Super I/O config space (8 I/O ports)
    Datasheet: Not publicly available
  * IT8705F
    Prefix: 'it87'
@@ -114,8 +117,8 @@ motherboard models.
Description
-----------

This driver implements support for the IT8603E, IT8620E, IT8623E, IT8705F,
IT8712F, IT8716F, IT8718F, IT8720F, IT8721F, IT8726F, IT8728F, IT8732F,
This driver implements support for the IT8603E, IT8620E, IT8623E, IT8628E,
IT8705F, IT8712F, IT8716F, IT8718F, IT8720F, IT8721F, IT8726F, IT8728F, IT8732F,
IT8758E, IT8771E, IT8772E, IT8781F, IT8782F, IT8783E/F, IT8786E, IT8790E, and
SiS950 chips.

@@ -158,8 +161,8 @@ The IT8603E/IT8623E is a custom design, hardware monitoring part is similar to
IT8728F. It only supports 3 fans, 16-bit fan mode, and the full speed mode
of the fan is not supported (value 0 of pwmX_enable).

The IT8620E is another custom design, hardware monitoring part is similar to
IT8728F. It only supports 16-bit fan mode.
The IT8620E and IT8628E are custom designs, hardware monitoring part is similar
to IT8728F. It only supports 16-bit fan mode. Both chips support up to 6 fans.

The IT8790E supports up to 3 fans. 16-bit fan mode is always enabled.

@@ -187,8 +190,8 @@ of 0.016 volt. IT8603E, IT8721F/IT8758E and IT8728F can measure between 0 and
2.8 volts with a resolution of 0.0109 volt.  The battery voltage in8 does not
have limit registers.

On the IT8603E, IT8721F/IT8758E, IT8732F, IT8781F, IT8782F, and IT8783E/F, some
voltage inputs are internal and scaled inside the chip:
On the IT8603E, IT8620E, IT8628E, IT8721F/IT8758E, IT8732F, IT8781F, IT8782F,
and IT8783E/F, some voltage inputs are internal and scaled inside the chip:
* in3 (optional)
* in7 (optional for IT8781F, IT8782F, and IT8783E/F)
* in8 (always)
+34 −0
Original line number Diff line number Diff line
Kernel driver max31722
======================

Supported chips:
  * Maxim Integrated MAX31722
    Prefix: 'max31722'
    ACPI ID: MAX31722
    Addresses scanned: -
    Datasheet: https://datasheets.maximintegrated.com/en/ds/MAX31722-MAX31723.pdf
  * Maxim Integrated MAX31723
    Prefix: 'max31723'
    ACPI ID: MAX31723
    Addresses scanned: -
    Datasheet: https://datasheets.maximintegrated.com/en/ds/MAX31722-MAX31723.pdf

Author: Tiberiu Breana <tiberiu.a.breana@intel.com>

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

This driver adds support for the Maxim Integrated MAX31722/MAX31723 thermometers
and thermostats running over an SPI interface.

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

This driver uses ACPI to auto-detect devices. See ACPI IDs in the above section.

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

The following attribute is supported:

temp1_input		Measured temperature. Read-only.
+13 −2
Original line number Diff line number Diff line
@@ -288,7 +288,7 @@ config SENSORS_K10TEMP

config SENSORS_FAM15H_POWER
	tristate "AMD Family 15h processor power"
	depends on X86 && PCI
	depends on X86 && PCI && CPU_SUP_AMD
	help
	  If you say yes here you get support for processor power
	  information of your AMD family 15h CPU.
@@ -621,7 +621,8 @@ config SENSORS_IT87
	  If you say yes here you get support for ITE IT8705F, IT8712F, IT8716F,
	  IT8718F, IT8720F, IT8721F, IT8726F, IT8728F, IT8732F, IT8758E,
	  IT8771E, IT8772E, IT8781F, IT8782F, IT8783E/F, IT8786E, IT8790E,
	  IT8603E, IT8620E, and IT8623E sensor chips, and the SiS950 clone.
	  IT8603E, IT8620E, IT8623E, and IT8628E sensor chips, and the SiS950
	  clone.

	  This driver can also be built as a module.  If so, the module
	  will be called it87.
@@ -821,6 +822,16 @@ config SENSORS_MAX197
	  This driver can also be built as a module. If so, the module
	  will be called max197.

config SENSORS_MAX31722
tristate "MAX31722 temperature sensor"
	depends on SPI
	help
	  Support for the Maxim Integrated MAX31722/MAX31723 digital
	  thermometers/thermostats operating over an SPI interface.

	  This driver can also be built as a module. If so, the module
	  will be called max31722.

config SENSORS_MAX6639
	tristate "Maxim MAX6639 sensor chip"
	depends on I2C
Loading