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

Merge tag 'hwmon-for-linus-v4.19-rc1' of...

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

Pull hwmon updates from Guenter Roeck:

 - new driver for NPCM7xx PWM and Fan controller

 - new driver for Mellanox FAN controller

 - add support for MAX34451 to max34440 driver

 - add support for new Threadripper variants to k10temp driver

 - add error handling to adt7475 driver

 - cleanup nct6775 and nct7904 drivers

 - document sensor enable ABI attributes

* tag 'hwmon-for-linus-v4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (adt7475) Change show functions to return error data correctly
  hwmon: (adt7475) Change update functions to add error handling
  hwmon: (adt7475) Change valid parameter to bool type
  hwmon: (adt7475) Split device update function to measure and limits
  hwmon: k10temp: Support Threadripper 2920X, 2970WX; simplify offset table
  hwmon: (k10temp) 27C Offset needed for Threadripper2
  hwmon: (iio_hwmon) Use devm functions
  hwmon: Add NPCM7xx PWM and Fan driver
  dt-binding: hwmon: Add NPCM7xx PWM and Fan controller documentation
  hwmon: (pmbus/max34440) Add support for MAX34451.
  hwmon: Document the sensor enable attribute
  hwmon: (mlxreg-fan) Add support for Mellanox FAN driver
  hwmon: Mark expected switch fall-throughs
  hwmon: (nct6775) Fix comment in the description of pwm_mode
  hwmon: (nct7904) Fix UNSPECIFIED_INT warning
  hwmon: (nct7904) Fix CODE_INDENT error
  hwmon: (nct7904) Fix SPACING errors
parents e5a32b5b 4afec79f
Loading
Loading
Loading
Loading
+84 −0
Original line number Diff line number Diff line
Nuvoton NPCM7xx PWM and Fan Tacho controller device

The Nuvoton BMC NPCM7XX supports 8 Pulse-width modulation (PWM)
controller outputs and 16 Fan tachometer controller inputs.

Required properties for pwm-fan node
- #address-cells : should be 1.
- #size-cells	: should be 0.
- compatible	: "nuvoton,npcm750-pwm-fan" for Poleg NPCM7XX.
- reg			: specifies physical base address and size of the registers.
- reg-names	: must contain:
					* "pwm" for the PWM registers.
					* "fan" for the Fan registers.
- clocks		: phandle of reference clocks.
- clock-names	: must contain
					* "pwm" for PWM controller operating clock.
					* "fan" for Fan controller operating clock.
- interrupts	: contain the Fan interrupts with flags for falling edge.
- pinctrl-names	: a pinctrl state named "default" must be defined.
- pinctrl-0	: phandle referencing pin configuration of the PWM and Fan
					controller ports.

fan subnode format:
===================
Under fan subnode can be upto 8 child nodes, each child node representing a fan.
Each fan subnode must have one PWM channel and atleast one Fan tach channel.

For PWM channel can be configured cooling-levels to create cooling device.
Cooling device could be bound to a thermal zone for the thermal control.

Required properties for each child node:
- reg : specify the PWM output channel.
	integer value in the range 0 through 7, that represent
	the PWM channel number that used.

- fan-tach-ch : specify the Fan tach input channel.
		integer value in the range 0 through 15, that represent
		the fan tach channel number that used.

		At least one Fan tach input channel is required

Optional property for each child node:
- cooling-levels: PWM duty cycle values in a range from 0 to 255
                  which correspond to thermal cooling states.

Examples:

pwm_fan:pwm-fan-controller@103000 {
	#address-cells = <1>;
	#size-cells = <0>;
	compatible = "nuvoton,npcm750-pwm-fan";
	reg = <0x103000 0x2000>,
		<0x180000 0x8000>;
	reg-names = "pwm", "fan";
	clocks = <&clk NPCM7XX_CLK_APB3>,
		<&clk NPCM7XX_CLK_APB4>;
	clock-names = "pwm","fan";
	interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>,
			<GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
			<GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
			<GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
			<GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
			<GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
			<GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
			<GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
	pinctrl-names = "default";
	pinctrl-0 = <&pwm0_pins &pwm1_pins &pwm2_pins
			&fanin0_pins &fanin1_pins &fanin2_pins
			&fanin3_pins &fanin4_pins>;
	fan@0 {
		reg = <0x00>;
		fan-tach-ch = /bits/ 8 <0x00 0x01>;
		cooling-levels = <127 255>;
	};
	fan@1 {
		reg = <0x01>;
		fan-tach-ch = /bits/ 8 <0x02 0x03>;
	};
	fan@2 {
		reg = <0x02>;
		fan-tach-ch = /bits/ 8 <0x04>;
	};

};
+12 −4
Original line number Diff line number Diff line
@@ -16,6 +16,11 @@ Supported chips:
    Prefixes: 'max34446'
    Addresses scanned: -
    Datasheet: http://datasheets.maximintegrated.com/en/ds/MAX34446.pdf
  * Maxim MAX34451
    PMBus 16-Channel V/I Monitor and 12-Channel Sequencer/Marginer
    Prefixes: 'max34451'
    Addresses scanned: -
    Datasheet: http://datasheets.maximintegrated.com/en/ds/MAX34451.pdf
  * Maxim MAX34460
    PMBus 12-Channel Voltage Monitor & Sequencer
    Prefix: 'max34460'
@@ -36,9 +41,10 @@ Description
This driver supports hardware monitoring for Maxim MAX34440 PMBus 6-Channel
Power-Supply Manager, MAX34441 PMBus 5-Channel Power-Supply Manager
and Intelligent Fan Controller, and MAX34446 PMBus Power-Supply Data Logger.
It also supports the MAX34460 and MAX34461 PMBus Voltage Monitor & Sequencers.
The MAX34460 supports 12 voltage channels, and the MAX34461 supports 16 voltage
channels.
It also supports the MAX34451, MAX34460, and MAX34461 PMBus Voltage Monitor &
Sequencers. The MAX34451 supports monitoring voltage or current of 12 channels
based on GIN pins. The MAX34460 supports 12 voltage channels, and the MAX34461
supports 16 voltage channels.

The driver is a client driver to the core PMBus driver. Please see
Documentation/hwmon/pmbus for details on PMBus client drivers.
@@ -93,7 +99,7 @@ curr[1-6]_max Maximum current. From IOUT_OC_WARN_LIMIT register.
curr[1-6]_crit		Critical maximum current. From IOUT_OC_FAULT_LIMIT register.
curr[1-6]_max_alarm	Current high alarm. From IOUT_OC_WARNING status.
curr[1-6]_crit_alarm	Current critical high alarm. From IOUT_OC_FAULT status.
curr[1-4]_average	Historical average current (MAX34446 only).
curr[1-4]_average	Historical average current (MAX34446/34451 only).
curr[1-6]_highest	Historical maximum current.
curr[1-6]_reset_history	Write any value to reset history.

@@ -123,5 +129,7 @@ temp[1-8]_reset_history Write any value to reset history.
			temp7 and temp8 attributes only exist for MAX34440.
			MAX34446 only supports temp[1-3].

MAX34451 supports attribute groups in[1-16] (or curr[1-16] based on input pins)
and temp[1-5].
MAX34460 supports attribute groups in[1-12] and temp[1-5].
MAX34461 supports attribute groups in[1-16] and temp[1-5].
+60 −0
Original line number Diff line number Diff line
Kernel driver mlxreg-fan
========================

Provides FAN control for the next Mellanox systems:
QMB700, equipped with 40x200GbE InfiniBand ports;
MSN3700, equipped with 32x200GbE or 16x400GbE Ethernet ports;
MSN3410, equipped with 6x400GbE plus 48x50GbE Ethernet ports;
MSN3800, equipped with 64x1000GbE Ethernet ports;
These are the Top of the Rack systems, equipped with Mellanox switch
board with Mellanox Quantum or Spectrume-2 devices.
FAN controller is implemented by the programmable device logic.

The default registers offsets set within the programmable device is as
following:
- pwm1			0xe3
- fan1 (tacho1)		0xe4
- fan2 (tacho2)		0xe5
- fan3 (tacho3)		0xe6
- fan4 (tacho4)		0xe7
- fan5 (tacho5)		0xe8
- fan6 (tacho6)		0xe9
- fan7 (tacho7)		0xea
- fan8 (tacho8)		0xeb
- fan9 (tacho9)		0xec
- fan10 (tacho10)	0xed
- fan11 (tacho11)	0xee
- fan12 (tacho12)	0xef
This setup can be re-programmed with other registers.

Author: Vadim Pasternak <vadimp@mellanox.com>

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

The driver implements a simple interface for driving a fan connected to
a PWM output and tachometer inputs.
This driver obtains PWM and tachometers registers location according to
the system configuration and creates FAN/PWM hwmon objects and a cooling
device. PWM and tachometers are sensed through the on-board programmable
device, which exports its register map. This device could be attached to
any bus type, for which register mapping is supported.
Single instance is created with one PWM control, up to 12 tachometers and
one cooling device. It could be as many instances as programmable device
supports.
The driver exposes the fan to the user space through the hwmon's and
thermal's sysfs interfaces.

/sys files in hwmon subsystem
-----------------------------

fan[1-12]_fault - RO files for tachometers TACH1-TACH12 fault indication
fan[1-12]_input - RO files for tachometers TACH1-TACH12 input (in RPM)
pwm1		- RW file for fan[1-12] target duty cycle (0..255)

/sys files in thermal subsystem
-------------------------------

cur_state	- RW file for current cooling state of the cooling device
		  (0..max_state)
max_state	- RO file for maximum cooling state of the cooling device
+22 −0
Original line number Diff line number Diff line
Kernel driver npcm750-pwm-fan
=============================

Supported chips:
	NUVOTON NPCM750/730/715/705

Authors:
	<tomer.maimon@nuvoton.com>

Description:
------------
This driver implements support for NUVOTON NPCM7XX PWM and Fan Tacho
controller. The PWM controller supports up to 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).
+48 −0
Original line number Diff line number Diff line
@@ -171,6 +171,13 @@ in[0-*]_label Suggested voltage channel label.
		user-space.
		RO

in[0-*]_enable
		Enable or disable the sensors.
		When disabled the sensor read will return -ENODATA.
		1: Enable
		0: Disable
		RW

cpu[0-*]_vid	CPU core reference voltage.
		Unit: millivolt
		RO
@@ -236,6 +243,13 @@ fan[1-*]_label Suggested fan channel label.
		In all other cases, the label is provided by user-space.
		RO

fan[1-*]_enable
		Enable or disable the sensors.
		When disabled the sensor read will return -ENODATA.
		1: Enable
		0: Disable
		RW

Also see the Alarms section for status flags associated with fans.


@@ -409,6 +423,13 @@ temp_reset_history
		Reset temp_lowest and temp_highest for all sensors
		WO

temp[1-*]_enable
		Enable or disable the sensors.
		When disabled the sensor read will return -ENODATA.
		1: Enable
		0: Disable
		RW

Some chips measure temperature using external thermistors and an ADC, and
report the temperature measurement as a voltage. Converting this voltage
back to a temperature (or the other way around for limits) requires
@@ -468,6 +489,13 @@ curr_reset_history
		Reset currX_lowest and currX_highest for all sensors
		WO

curr[1-*]_enable
		Enable or disable the sensors.
		When disabled the sensor read will return -ENODATA.
		1: Enable
		0: Disable
		RW

Also see the Alarms section for status flags associated with currents.

*********
@@ -566,6 +594,13 @@ power[1-*]_crit Critical maximum power.
				Unit: microWatt
				RW

power[1-*]_enable		Enable or disable the sensors.
				When disabled the sensor read will return
				-ENODATA.
				1: Enable
				0: Disable
				RW

Also see the Alarms section for status flags associated with power readings.

**********
@@ -576,6 +611,12 @@ energy[1-*]_input Cumulative energy use
				Unit: microJoule
				RO

energy[1-*]_enable		Enable or disable the sensors.
				When disabled the sensor read will return
				-ENODATA.
				1: Enable
				0: Disable
				RW

************
* Humidity *
@@ -586,6 +627,13 @@ humidity[1-*]_input Humidity
				RO


humidity[1-*]_enable		Enable or disable the sensors
				When disabled the sensor read will return
				-ENODATA.
				1: Enable
				0: Disable
				RW

**********
* Alarms *
**********
Loading