Skip to content

Commit

Permalink
Merge tag 'hwmon-for-linus-v4.16' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/kernel/git/groeck/linux-staging

Pull hwmon updates from Guenter Roeck:

 - New driver for W83773G

 - Fan control support for PMBus drivers

 - Improvements and minor fixes in several drivers

* tag 'hwmon-for-linus-v4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (32 commits)
  hwmon: (dell-smm) Disable fan support for Dell Vostro 3360
  hwmon: (dell-smm) Disable fan support for Dell Inspiron 7720
  hwmon: (dell-smm) Enable broken functionality via "force" module param
  hwmon: (k10temp) Add temperature offset for Ryzen 1900X
  hwmon: (lm75) Fix trailing semicolon
  hwmon: (ina2xx) Fix access to uninitialized mutex
  hwmon: (pmbus/ir35221) Remove unnecessary scaling
  hwmon: (sht3x) wait predefined limits loading complete before access
  hwmon: (pmbus/ibm-cffps) Add dependency on LEDS_CLASS
  hwmon: (pmbus/cffps) Add led class device for power supply fault led
  hwmon: (pmbus) cffps: Add PMBUS_SKIP_STATUS_CHECK
  hwmon: (aspeed-pwm-tacho) Deassert reset in probe
  dt-bindings: hwmon: aspeed-pwm-tacho: Add reset node
  hwmon: (pmbus) cffps: Add debugfs entries
  hwmon: (pmbus) Export pmbus device debugfs directory entry
  hwmon: (w83773g) Fix fault detection and reporting
  hwmon: (hih6130) Fix documentation of struct hih6130
  hwmon: (iio_hwmon) Fix documentation of struct iio_hwmon_state
  hwmon: (sht15) Fix parameter documentation of sht15_crc8()
  hwmon: (sht21) Fix documentation of struct sht21
  ...
  • Loading branch information
Linus Torvalds committed Jan 29, 2018
2 parents 0fc7e74 + 6fbc423 commit 47d5cc5
Show file tree
Hide file tree
Showing 26 changed files with 1,408 additions and 382 deletions.
14 changes: 5 additions & 9 deletions Documentation/devicetree/bindings/hwmon/aspeed-pwm-tacho.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ Required properties for pwm-tacho node:
- compatible : should be "aspeed,ast2400-pwm-tacho" for AST2400 and
"aspeed,ast2500-pwm-tacho" for AST2500.

- clocks : a fixed clock providing input clock frequency(PWM
and Fan Tach clock)
- clocks : phandle to clock provider with the clock number in the second cell

- resets : phandle to reset controller with the reset number in the second cell

fan subnode format:
===================
Expand All @@ -48,19 +49,14 @@ Required properties for each child node:

Examples:

pwm_tacho_fixed_clk: fixedclk {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <24000000>;
};

pwm_tacho: pwmtachocontroller@1e786000 {
#address-cells = <1>;
#size-cells = <1>;
#cooling-cells = <2>;
reg = <0x1E786000 0x1000>;
compatible = "aspeed,ast2500-pwm-tacho";
clocks = <&pwm_tacho_fixed_clk>;
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_PWM>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pwm0_default &pinctrl_pwm1_default>;

Expand Down
20 changes: 1 addition & 19 deletions Documentation/hwmon/lm25066
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ Supported chips:
Datasheets:
http://www.ti.com/lit/gpn/lm25056
http://www.ti.com/lit/gpn/lm25056a
* TI LM25063
Prefix: 'lm25063'
Addresses scanned: -
Datasheet:
To be announced
* National Semiconductor LM25066
Prefix: 'lm25066'
Addresses scanned: -
Expand Down Expand Up @@ -42,7 +37,7 @@ Description
-----------

This driver supports hardware monitoring for National Semiconductor / TI LM25056,
LM25063, LM25066, LM5064, and LM5066/LM5066I Power Management, Monitoring,
LM25066, LM5064, and LM5066/LM5066I Power Management, Monitoring,
Control, and Protection ICs.

The driver is a client driver to the core PMBus driver. Please see
Expand Down Expand Up @@ -74,12 +69,8 @@ in1_input Measured input voltage.
in1_average Average measured input voltage.
in1_min Minimum input voltage.
in1_max Maximum input voltage.
in1_crit Critical high input voltage (LM25063 only).
in1_lcrit Critical low input voltage (LM25063 only).
in1_min_alarm Input voltage low alarm.
in1_max_alarm Input voltage high alarm.
in1_lcrit_alarm Input voltage critical low alarm (LM25063 only).
in1_crit_alarm Input voltage critical high alarm. (LM25063 only).

in2_label "vmon"
in2_input Measured voltage on VAUX pin
Expand All @@ -94,16 +85,12 @@ in3_input Measured output voltage.
in3_average Average measured output voltage.
in3_min Minimum output voltage.
in3_min_alarm Output voltage low alarm.
in3_highest Historical minimum output voltage (LM25063 only).
in3_lowest Historical maximum output voltage (LM25063 only).

curr1_label "iin"
curr1_input Measured input current.
curr1_average Average measured input current.
curr1_max Maximum input current.
curr1_crit Critical input current (LM25063 only).
curr1_max_alarm Input current high alarm.
curr1_crit_alarm Input current critical high alarm (LM25063 only).

power1_label "pin"
power1_input Measured input power.
Expand All @@ -113,11 +100,6 @@ power1_alarm Input power alarm
power1_input_highest Historical maximum power.
power1_reset_history Write any value to reset maximum power history.

power2_label "pout". LM25063 only.
power2_input Measured output power.
power2_max Maximum output power limit.
power2_crit Critical output power limit.

temp1_input Measured temperature.
temp1_max Maximum temperature.
temp1_crit Critical high temperature.
Expand Down
15 changes: 12 additions & 3 deletions Documentation/hwmon/max31785
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ management with temperature and remote voltage sensing. Various fan control
features are provided, including PWM frequency control, temperature hysteresis,
dual tachometer measurements, and fan health monitoring.

For dual rotor fan configuration, the MAX31785 exposes the slowest rotor of the
two in the fan[1-4]_input attributes.
For dual-rotor configurations the MAX31785A exposes the second rotor tachometer
readings in attributes fan[5-8]_input. By contrast the MAX31785 only exposes
the slowest rotor measurement, and does so in the fan[1-4]_input attributes.

Usage Notes
-----------
Expand All @@ -31,7 +32,9 @@ Sysfs attributes

fan[1-4]_alarm Fan alarm.
fan[1-4]_fault Fan fault.
fan[1-4]_input Fan RPM.
fan[1-8]_input Fan RPM. On the MAX31785A, inputs 5-8 correspond to the
second rotor of fans 1-4
fan[1-4]_target Fan input target

in[1-6]_crit Critical maximum output voltage
in[1-6]_crit_alarm Output voltage critical high alarm
Expand All @@ -44,6 +47,12 @@ in[1-6]_max_alarm Output voltage high alarm
in[1-6]_min Minimum output voltage
in[1-6]_min_alarm Output voltage low alarm

pwm[1-4] Fan target duty cycle (0..255)
pwm[1-4]_enable 0: Full-speed
1: Manual PWM control
2: Automatic PWM (tach-feedback RPM fan-control)
3: Automatic closed-loop (temp-feedback fan-control)

temp[1-11]_crit Critical high temperature
temp[1-11]_crit_alarm Chip temperature critical high alarm
temp[1-11]_input Measured temperature
Expand Down
33 changes: 33 additions & 0 deletions Documentation/hwmon/w83773g
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Kernel driver w83773g
====================

Supported chips:
* Nuvoton W83773G
Prefix: 'w83773g'
Addresses scanned: I2C 0x4c and 0x4d
Datasheet: https://www.nuvoton.com/resource-files/W83773G_SG_DatasheetV1_2.pdf

Authors:
Lei YU <mine260309@gmail.com>

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

This driver implements support for Nuvoton W83773G temperature sensor
chip. This chip implements one local and two remote sensors.
The chip also features offsets for the two remote sensors which 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.
Temperature is measured in degrees Celsius.
The chip is wired over I2C/SMBus and specified over a temperature
range of -40 to +125 degrees Celsius (for local sensor) and -40 to +127
degrees Celsius (for remote sensors).
Resolution for both the local and remote channels is 0.125 degree C.

The chip supports only temperature measurement. The driver exports
the temperature values via the following sysfs files:

temp[1-3]_input
temp[2-3]_fault
temp[2-3]_offset
update_interval
26 changes: 10 additions & 16 deletions drivers/hwmon/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ if HWMON

config HWMON_VID
tristate
default n

config HWMON_DEBUG_CHIP
bool "Hardware Monitoring Chip debugging messages"
default n
help
Say Y here if you want the I2C chip drivers to produce a bunch of
debug messages to the system log. Select this if you are having
Expand All @@ -42,7 +40,6 @@ comment "Native drivers"
config SENSORS_AB8500
tristate "AB8500 thermal monitoring"
depends on AB8500_GPADC && AB8500_BM
default n
help
If you say yes here you get support for the thermal sensor part
of the AB8500 chip. The driver includes thermal management for
Expand Down Expand Up @@ -302,7 +299,6 @@ config SENSORS_APPLESMC
select NEW_LEDS
select LEDS_CLASS
select INPUT_POLLDEV
default n
help
This driver provides support for the Apple System Management
Controller, which provides an accelerometer (Apple Sudden Motion
Expand Down Expand Up @@ -678,7 +674,6 @@ config SENSORS_JC42
config SENSORS_POWR1220
tristate "Lattice POWR1220 Power Monitoring"
depends on I2C
default n
help
If you say yes here you get access to the hardware monitoring
functions of the Lattice POWR1220 isp Power Supply Monitoring,
Expand All @@ -702,7 +697,6 @@ config SENSORS_LTC2945
tristate "Linear Technology LTC2945"
depends on I2C
select REGMAP_I2C
default n
help
If you say yes here you get support for Linear Technology LTC2945
I2C System Monitor.
Expand All @@ -727,7 +721,6 @@ config SENSORS_LTC2990
config SENSORS_LTC4151
tristate "Linear Technology LTC4151"
depends on I2C
default n
help
If you say yes here you get support for Linear Technology LTC4151
High Voltage I2C Current and Voltage Monitor interface.
Expand All @@ -738,7 +731,6 @@ config SENSORS_LTC4151
config SENSORS_LTC4215
tristate "Linear Technology LTC4215"
depends on I2C
default n
help
If you say yes here you get support for Linear Technology LTC4215
Hot Swap Controller I2C interface.
Expand All @@ -750,7 +742,6 @@ config SENSORS_LTC4222
tristate "Linear Technology LTC4222"
depends on I2C
select REGMAP_I2C
default n
help
If you say yes here you get support for Linear Technology LTC4222
Dual Hot Swap Controller I2C interface.
Expand All @@ -761,7 +752,6 @@ config SENSORS_LTC4222
config SENSORS_LTC4245
tristate "Linear Technology LTC4245"
depends on I2C
default n
help
If you say yes here you get support for Linear Technology LTC4245
Multiple Supply Hot Swap Controller I2C interface.
Expand All @@ -773,7 +763,6 @@ config SENSORS_LTC4260
tristate "Linear Technology LTC4260"
depends on I2C
select REGMAP_I2C
default n
help
If you say yes here you get support for Linear Technology LTC4260
Positive Voltage Hot Swap Controller I2C interface.
Expand All @@ -784,7 +773,6 @@ config SENSORS_LTC4260
config SENSORS_LTC4261
tristate "Linear Technology LTC4261"
depends on I2C
default n
help
If you say yes here you get support for Linear Technology LTC4261
Negative Voltage Hot Swap Controller I2C interface.
Expand Down Expand Up @@ -1276,7 +1264,6 @@ config SENSORS_NSA320
config SENSORS_PCF8591
tristate "Philips PCF8591 ADC/DAC"
depends on I2C
default n
help
If you say yes here you get support for Philips PCF8591 4-channel
ADC, 1-channel DAC chips.
Expand Down Expand Up @@ -1459,7 +1446,6 @@ config SENSORS_SMSC47B397

config SENSORS_SCH56XX_COMMON
tristate
default n

config SENSORS_SCH5627
tristate "SMSC SCH5627"
Expand Down Expand Up @@ -1505,7 +1491,6 @@ config SENSORS_STTS751
config SENSORS_SMM665
tristate "Summit Microelectronics SMM665"
depends on I2C
default n
help
If you say yes here you get support for the hardware monitoring
features of the Summit Microelectronics SMM665/SMM665B Six-Channel
Expand Down Expand Up @@ -1725,6 +1710,16 @@ config SENSORS_VT8231
This driver can also be built as a module. If so, the module
will be called vt8231.

config SENSORS_W83773G
tristate "Nuvoton W83773G"
depends on I2C
help
If you say yes here you get support for the Nuvoton W83773G hardware
monitoring chip.

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

config SENSORS_W83781D
tristate "Winbond W83781D, W83782D, W83783S, Asus AS99127F"
depends on I2C
Expand Down Expand Up @@ -1782,7 +1777,6 @@ config SENSORS_W83795
config SENSORS_W83795_FANCTRL
bool "Include automatic fan control support (DANGEROUS)"
depends on SENSORS_W83795
default n
help
If you say yes here, support for automatic fan speed control
will be included in the driver.
Expand Down
1 change: 1 addition & 0 deletions drivers/hwmon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ obj-$(CONFIG_SENSORS_ATK0110) += asus_atk0110.o
# asb100, then w83781d go first, as they can override other drivers' addresses.
obj-$(CONFIG_SENSORS_ASB100) += asb100.o
obj-$(CONFIG_SENSORS_W83627HF) += w83627hf.o
obj-$(CONFIG_SENSORS_W83773G) += w83773g.o
obj-$(CONFIG_SENSORS_W83792D) += w83792d.o
obj-$(CONFIG_SENSORS_W83793) += w83793.o
obj-$(CONFIG_SENSORS_W83795) += w83795.o
Expand Down
22 changes: 22 additions & 0 deletions drivers/hwmon/aspeed-pwm-tacho.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/reset.h>
#include <linux/sysfs.h>
#include <linux/thermal.h>

Expand Down Expand Up @@ -181,6 +182,7 @@ struct aspeed_cooling_device {

struct aspeed_pwm_tacho_data {
struct regmap *regmap;
struct reset_control *rst;
unsigned long clk_freq;
bool pwm_present[8];
bool fan_tach_present[16];
Expand Down Expand Up @@ -905,6 +907,13 @@ static int aspeed_create_fan(struct device *dev,
return 0;
}

static void aspeed_pwm_tacho_remove(void *data)
{
struct aspeed_pwm_tacho_data *priv = data;

reset_control_assert(priv->rst);
}

static int aspeed_pwm_tacho_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
Expand All @@ -931,6 +940,19 @@ static int aspeed_pwm_tacho_probe(struct platform_device *pdev)
&aspeed_pwm_tacho_regmap_config);
if (IS_ERR(priv->regmap))
return PTR_ERR(priv->regmap);

priv->rst = devm_reset_control_get_exclusive(dev, NULL);
if (IS_ERR(priv->rst)) {
dev_err(dev,
"missing or invalid reset controller device tree entry");
return PTR_ERR(priv->rst);
}
reset_control_deassert(priv->rst);

ret = devm_add_action_or_reset(dev, aspeed_pwm_tacho_remove, priv);
if (ret)
return ret;

regmap_write(priv->regmap, ASPEED_PTCR_TACH_SOURCE, 0);
regmap_write(priv->regmap, ASPEED_PTCR_TACH_SOURCE_EXT, 0);

Expand Down
3 changes: 2 additions & 1 deletion drivers/hwmon/coretemp.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
int err;
u32 eax, edx;
int i;
struct pci_dev *host_bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
u16 devfn = PCI_DEVFN(0, 0);
struct pci_dev *host_bridge = pci_get_domain_bus_and_slot(0, 0, devfn);

/*
* Explicit tjmax table entries override heuristics.
Expand Down
Loading

0 comments on commit 47d5cc5

Please sign in to comment.