Skip to content

Commit 47d5cc5

Browse files
committed
Merge tag 'hwmon-for-linus-v4.16' of git://git.kernel.org/pub/scm/linux/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 ...
2 parents 0fc7e74 + 6fbc423 commit 47d5cc5

26 files changed

Lines changed: 1408 additions & 382 deletions

‎Documentation/devicetree/bindings/hwmon/aspeed-pwm-tacho.txt‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ Required properties for pwm-tacho node:
2222
- compatible : should be "aspeed,ast2400-pwm-tacho" for AST2400 and
2323
"aspeed,ast2500-pwm-tacho" for AST2500.
2424

25-
- clocks : a fixed clock providing input clock frequency(PWM
26-
and Fan Tach clock)
25+
- clocks : phandle to clock provider with the clock number in the second cell
26+
27+
- resets : phandle to reset controller with the reset number in the second cell
2728

2829
fan subnode format:
2930
===================
@@ -48,19 +49,14 @@ Required properties for each child node:
4849

4950
Examples:
5051

51-
pwm_tacho_fixed_clk: fixedclk {
52-
compatible = "fixed-clock";
53-
#clock-cells = <0>;
54-
clock-frequency = <24000000>;
55-
};
56-
5752
pwm_tacho: pwmtachocontroller@1e786000 {
5853
#address-cells = <1>;
5954
#size-cells = <1>;
6055
#cooling-cells = <2>;
6156
reg = <0x1E786000 0x1000>;
6257
compatible = "aspeed,ast2500-pwm-tacho";
63-
clocks = <&pwm_tacho_fixed_clk>;
58+
clocks = <&syscon ASPEED_CLK_APB>;
59+
resets = <&syscon ASPEED_RESET_PWM>;
6460
pinctrl-names = "default";
6561
pinctrl-0 = <&pinctrl_pwm0_default &pinctrl_pwm1_default>;
6662

‎Documentation/hwmon/lm25066‎

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ Supported chips:
88
Datasheets:
99
http://www.ti.com/lit/gpn/lm25056
1010
http://www.ti.com/lit/gpn/lm25056a
11-
* TI LM25063
12-
Prefix: 'lm25063'
13-
Addresses scanned: -
14-
Datasheet:
15-
To be announced
1611
* National Semiconductor LM25066
1712
Prefix: 'lm25066'
1813
Addresses scanned: -
@@ -42,7 +37,7 @@ Description
4237
-----------
4338

4439
This driver supports hardware monitoring for National Semiconductor / TI LM25056,
45-
LM25063, LM25066, LM5064, and LM5066/LM5066I Power Management, Monitoring,
40+
LM25066, LM5064, and LM5066/LM5066I Power Management, Monitoring,
4641
Control, and Protection ICs.
4742

4843
The driver is a client driver to the core PMBus driver. Please see
@@ -74,12 +69,8 @@ in1_input Measured input voltage.
7469
in1_average Average measured input voltage.
7570
in1_min Minimum input voltage.
7671
in1_max Maximum input voltage.
77-
in1_crit Critical high input voltage (LM25063 only).
78-
in1_lcrit Critical low input voltage (LM25063 only).
7972
in1_min_alarm Input voltage low alarm.
8073
in1_max_alarm Input voltage high alarm.
81-
in1_lcrit_alarm Input voltage critical low alarm (LM25063 only).
82-
in1_crit_alarm Input voltage critical high alarm. (LM25063 only).
8374

8475
in2_label "vmon"
8576
in2_input Measured voltage on VAUX pin
@@ -94,16 +85,12 @@ in3_input Measured output voltage.
9485
in3_average Average measured output voltage.
9586
in3_min Minimum output voltage.
9687
in3_min_alarm Output voltage low alarm.
97-
in3_highest Historical minimum output voltage (LM25063 only).
98-
in3_lowest Historical maximum output voltage (LM25063 only).
9988

10089
curr1_label "iin"
10190
curr1_input Measured input current.
10291
curr1_average Average measured input current.
10392
curr1_max Maximum input current.
104-
curr1_crit Critical input current (LM25063 only).
10593
curr1_max_alarm Input current high alarm.
106-
curr1_crit_alarm Input current critical high alarm (LM25063 only).
10794

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

116-
power2_label "pout". LM25063 only.
117-
power2_input Measured output power.
118-
power2_max Maximum output power limit.
119-
power2_crit Critical output power limit.
120-
121103
temp1_input Measured temperature.
122104
temp1_max Maximum temperature.
123105
temp1_crit Critical high temperature.

‎Documentation/hwmon/max31785‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ management with temperature and remote voltage sensing. Various fan control
1717
features are provided, including PWM frequency control, temperature hysteresis,
1818
dual tachometer measurements, and fan health monitoring.
1919

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

2324
Usage Notes
2425
-----------
@@ -31,7 +32,9 @@ Sysfs attributes
3132

3233
fan[1-4]_alarm Fan alarm.
3334
fan[1-4]_fault Fan fault.
34-
fan[1-4]_input Fan RPM.
35+
fan[1-8]_input Fan RPM. On the MAX31785A, inputs 5-8 correspond to the
36+
second rotor of fans 1-4
37+
fan[1-4]_target Fan input target
3538

3639
in[1-6]_crit Critical maximum output voltage
3740
in[1-6]_crit_alarm Output voltage critical high alarm
@@ -44,6 +47,12 @@ in[1-6]_max_alarm Output voltage high alarm
4447
in[1-6]_min Minimum output voltage
4548
in[1-6]_min_alarm Output voltage low alarm
4649

50+
pwm[1-4] Fan target duty cycle (0..255)
51+
pwm[1-4]_enable 0: Full-speed
52+
1: Manual PWM control
53+
2: Automatic PWM (tach-feedback RPM fan-control)
54+
3: Automatic closed-loop (temp-feedback fan-control)
55+
4756
temp[1-11]_crit Critical high temperature
4857
temp[1-11]_crit_alarm Chip temperature critical high alarm
4958
temp[1-11]_input Measured temperature

‎Documentation/hwmon/w83773g‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Kernel driver w83773g
2+
====================
3+
4+
Supported chips:
5+
* Nuvoton W83773G
6+
Prefix: 'w83773g'
7+
Addresses scanned: I2C 0x4c and 0x4d
8+
Datasheet: https://www.nuvoton.com/resource-files/W83773G_SG_DatasheetV1_2.pdf
9+
10+
Authors:
11+
Lei YU <mine260309@gmail.com>
12+
13+
Description
14+
-----------
15+
16+
This driver implements support for Nuvoton W83773G temperature sensor
17+
chip. This chip implements one local and two remote sensors.
18+
The chip also features offsets for the two remote sensors which get added to
19+
the input readings. The chip does all the scaling by itself and the driver
20+
therefore reports true temperatures that don't need any user-space adjustments.
21+
Temperature is measured in degrees Celsius.
22+
The chip is wired over I2C/SMBus and specified over a temperature
23+
range of -40 to +125 degrees Celsius (for local sensor) and -40 to +127
24+
degrees Celsius (for remote sensors).
25+
Resolution for both the local and remote channels is 0.125 degree C.
26+
27+
The chip supports only temperature measurement. The driver exports
28+
the temperature values via the following sysfs files:
29+
30+
temp[1-3]_input
31+
temp[2-3]_fault
32+
temp[2-3]_offset
33+
update_interval

‎drivers/hwmon/Kconfig‎

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ if HWMON
2626

2727
config HWMON_VID
2828
tristate
29-
default n
3029

3130
config HWMON_DEBUG_CHIP
3231
bool "Hardware Monitoring Chip debugging messages"
33-
default n
3432
help
3533
Say Y here if you want the I2C chip drivers to produce a bunch of
3634
debug messages to the system log. Select this if you are having
@@ -42,7 +40,6 @@ comment "Native drivers"
4240
config SENSORS_AB8500
4341
tristate "AB8500 thermal monitoring"
4442
depends on AB8500_GPADC && AB8500_BM
45-
default n
4643
help
4744
If you say yes here you get support for the thermal sensor part
4845
of the AB8500 chip. The driver includes thermal management for
@@ -302,7 +299,6 @@ config SENSORS_APPLESMC
302299
select NEW_LEDS
303300
select LEDS_CLASS
304301
select INPUT_POLLDEV
305-
default n
306302
help
307303
This driver provides support for the Apple System Management
308304
Controller, which provides an accelerometer (Apple Sudden Motion
@@ -678,7 +674,6 @@ config SENSORS_JC42
678674
config SENSORS_POWR1220
679675
tristate "Lattice POWR1220 Power Monitoring"
680676
depends on I2C
681-
default n
682677
help
683678
If you say yes here you get access to the hardware monitoring
684679
functions of the Lattice POWR1220 isp Power Supply Monitoring,
@@ -702,7 +697,6 @@ config SENSORS_LTC2945
702697
tristate "Linear Technology LTC2945"
703698
depends on I2C
704699
select REGMAP_I2C
705-
default n
706700
help
707701
If you say yes here you get support for Linear Technology LTC2945
708702
I2C System Monitor.
@@ -727,7 +721,6 @@ config SENSORS_LTC2990
727721
config SENSORS_LTC4151
728722
tristate "Linear Technology LTC4151"
729723
depends on I2C
730-
default n
731724
help
732725
If you say yes here you get support for Linear Technology LTC4151
733726
High Voltage I2C Current and Voltage Monitor interface.
@@ -738,7 +731,6 @@ config SENSORS_LTC4151
738731
config SENSORS_LTC4215
739732
tristate "Linear Technology LTC4215"
740733
depends on I2C
741-
default n
742734
help
743735
If you say yes here you get support for Linear Technology LTC4215
744736
Hot Swap Controller I2C interface.
@@ -750,7 +742,6 @@ config SENSORS_LTC4222
750742
tristate "Linear Technology LTC4222"
751743
depends on I2C
752744
select REGMAP_I2C
753-
default n
754745
help
755746
If you say yes here you get support for Linear Technology LTC4222
756747
Dual Hot Swap Controller I2C interface.
@@ -761,7 +752,6 @@ config SENSORS_LTC4222
761752
config SENSORS_LTC4245
762753
tristate "Linear Technology LTC4245"
763754
depends on I2C
764-
default n
765755
help
766756
If you say yes here you get support for Linear Technology LTC4245
767757
Multiple Supply Hot Swap Controller I2C interface.
@@ -773,7 +763,6 @@ config SENSORS_LTC4260
773763
tristate "Linear Technology LTC4260"
774764
depends on I2C
775765
select REGMAP_I2C
776-
default n
777766
help
778767
If you say yes here you get support for Linear Technology LTC4260
779768
Positive Voltage Hot Swap Controller I2C interface.
@@ -784,7 +773,6 @@ config SENSORS_LTC4260
784773
config SENSORS_LTC4261
785774
tristate "Linear Technology LTC4261"
786775
depends on I2C
787-
default n
788776
help
789777
If you say yes here you get support for Linear Technology LTC4261
790778
Negative Voltage Hot Swap Controller I2C interface.
@@ -1276,7 +1264,6 @@ config SENSORS_NSA320
12761264
config SENSORS_PCF8591
12771265
tristate "Philips PCF8591 ADC/DAC"
12781266
depends on I2C
1279-
default n
12801267
help
12811268
If you say yes here you get support for Philips PCF8591 4-channel
12821269
ADC, 1-channel DAC chips.
@@ -1459,7 +1446,6 @@ config SENSORS_SMSC47B397
14591446

14601447
config SENSORS_SCH56XX_COMMON
14611448
tristate
1462-
default n
14631449

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

1713+
config SENSORS_W83773G
1714+
tristate "Nuvoton W83773G"
1715+
depends on I2C
1716+
help
1717+
If you say yes here you get support for the Nuvoton W83773G hardware
1718+
monitoring chip.
1719+
1720+
This driver can also be built as a module. If so, the module
1721+
will be called w83773g.
1722+
17281723
config SENSORS_W83781D
17291724
tristate "Winbond W83781D, W83782D, W83783S, Asus AS99127F"
17301725
depends on I2C
@@ -1782,7 +1777,6 @@ config SENSORS_W83795
17821777
config SENSORS_W83795_FANCTRL
17831778
bool "Include automatic fan control support (DANGEROUS)"
17841779
depends on SENSORS_W83795
1785-
default n
17861780
help
17871781
If you say yes here, support for automatic fan speed control
17881782
will be included in the driver.

‎drivers/hwmon/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ obj-$(CONFIG_SENSORS_ATK0110) += asus_atk0110.o
1414
# asb100, then w83781d go first, as they can override other drivers' addresses.
1515
obj-$(CONFIG_SENSORS_ASB100) += asb100.o
1616
obj-$(CONFIG_SENSORS_W83627HF) += w83627hf.o
17+
obj-$(CONFIG_SENSORS_W83773G) += w83773g.o
1718
obj-$(CONFIG_SENSORS_W83792D) += w83792d.o
1819
obj-$(CONFIG_SENSORS_W83793) += w83793.o
1920
obj-$(CONFIG_SENSORS_W83795) += w83795.o

‎drivers/hwmon/aspeed-pwm-tacho.c‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <linux/of_platform.h>
2020
#include <linux/platform_device.h>
2121
#include <linux/regmap.h>
22+
#include <linux/reset.h>
2223
#include <linux/sysfs.h>
2324
#include <linux/thermal.h>
2425

@@ -181,6 +182,7 @@ struct aspeed_cooling_device {
181182

182183
struct aspeed_pwm_tacho_data {
183184
struct regmap *regmap;
185+
struct reset_control *rst;
184186
unsigned long clk_freq;
185187
bool pwm_present[8];
186188
bool fan_tach_present[16];
@@ -905,6 +907,13 @@ static int aspeed_create_fan(struct device *dev,
905907
return 0;
906908
}
907909

910+
static void aspeed_pwm_tacho_remove(void *data)
911+
{
912+
struct aspeed_pwm_tacho_data *priv = data;
913+
914+
reset_control_assert(priv->rst);
915+
}
916+
908917
static int aspeed_pwm_tacho_probe(struct platform_device *pdev)
909918
{
910919
struct device *dev = &pdev->dev;
@@ -931,6 +940,19 @@ static int aspeed_pwm_tacho_probe(struct platform_device *pdev)
931940
&aspeed_pwm_tacho_regmap_config);
932941
if (IS_ERR(priv->regmap))
933942
return PTR_ERR(priv->regmap);
943+
944+
priv->rst = devm_reset_control_get_exclusive(dev, NULL);
945+
if (IS_ERR(priv->rst)) {
946+
dev_err(dev,
947+
"missing or invalid reset controller device tree entry");
948+
return PTR_ERR(priv->rst);
949+
}
950+
reset_control_deassert(priv->rst);
951+
952+
ret = devm_add_action_or_reset(dev, aspeed_pwm_tacho_remove, priv);
953+
if (ret)
954+
return ret;
955+
934956
regmap_write(priv->regmap, ASPEED_PTCR_TACH_SOURCE, 0);
935957
regmap_write(priv->regmap, ASPEED_PTCR_TACH_SOURCE_EXT, 0);
936958

‎drivers/hwmon/coretemp.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
246246
int err;
247247
u32 eax, edx;
248248
int i;
249-
struct pci_dev *host_bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
249+
u16 devfn = PCI_DEVFN(0, 0);
250+
struct pci_dev *host_bridge = pci_get_domain_bus_and_slot(0, 0, devfn);
250251

251252
/*
252253
* Explicit tjmax table entries override heuristics.

0 commit comments

Comments
 (0)