Skip to content

Commit 4d03390

Browse files
committed
Merge tag 'hwmon-for-v6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon updates from Guenter Roeck: "New drivers: - Driver for OneXPlayer mini AMD sensors - Ampere's Altra smpro-hwmon driver New chip and attribute support in existing drivers: - nct6775: Support for ASUS CROSSHAIR VIII/TUF/ProArt B550M - pmbus/ltc2978: Support for LTC7132 - aquacomputer_d5next: Support for temperature sensor offsets and flow sensor pulses - coretemp: Support for dynamic ttarget and tjmax Improvements: - Use devm_regulator_get_enable() where appropriate - Use sysfs_emit() instead of scnprintf() - Remove some useless #include <linux/hwmon-vid.h> - Include <linux/kstrtox.h> when appropriate - Use simple i2c probe - it87: Check for a valid chip before using force_id, and new new module parameter to ignore ACPI resource conflicts - jc42: Use regmap, and restore min/max/critical temperatures on resume - Add reporting power good and status to PMBus based regulators Last minute fixes: - emc2305: Fix probing of emc2301/2/3, and fix setting pwm values manually if THERMAL is enabled And various other minor fixes and improvements" * tag 'hwmon-for-v6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (37 commits) hwmon: (emc2305) fix pwm never being able to set lower hwmon: (emc2305) fix unable to probe emc2301/2/3 hwmon: (dell-smm) Move error message to make probing silent hwmon: use sysfs_emit() to instead of scnprintf() hwmon: (oxp-sensors) Fix pwm reading hwmon: (aquacomputer_d5next) Add support for Quadro flow sensor pulses hwmon: (pmbus/core) Implement regulator get_status hwmon: (oxp-sensors) Add AOK ZOE and Mini PRO hwmon: (gsc-hwmon) Switch to flexible array to simplify code hwmon: (pmbus) Add power good support hwmon: (nct6775) add ASUS CROSSHAIR VIII/TUF/ProArt B550M hwmon: (coretemp) Add support for dynamic ttarget hwmon: (coretemp) Add support for dynamic tjmax hwmon: (coretemp) rearrange tjmax handing code hwmon: Remove some useless #include <linux/hwmon-vid.h> hwmon: (coretemp) Remove obsolete temp_data->valid hwmon: add OneXPlayer mini AMD sensors driver hwmon: (aquacomputer_d5next) Clear up macros and comments hwmon: (it87) Add DMI table for future extensions hwmon: Include <linux/kstrtox.h> when appropriate ...
2 parents 361c89a + 364ffd2 commit 4d03390

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1611
-407
lines changed

Documentation/hwmon/aquacomputer_d5next.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ current.
3939

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

4444
The Farbwerk and Farbwerk 360 expose four temperature sensors. Additionally,
4545
sixteen virtual temperature sensors of the Farbwerk 360 are exposed.
@@ -62,7 +62,9 @@ Sysfs entries
6262

6363
================ ==============================================================
6464
temp[1-20]_input Physical/virtual temperature sensors (in millidegrees Celsius)
65+
temp[1-4]_offset Temperature sensor correction offset (in millidegrees Celsius)
6566
fan[1-8]_input Pump/fan speed (in RPM) / Flow speed (in dL/h)
67+
fan5_pulses Quadro flow sensor pulses
6668
power[1-8]_input Pump/fan power (in micro Watts)
6769
in[0-7]_input Pump/fan voltage (in milli Volts)
6870
curr[1-8]_input Pump/fan current (in milli Amperes)

Documentation/hwmon/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ Hardware Monitoring Kernel Drivers
160160
nzxt-kraken2
161161
nzxt-smart2
162162
occ
163+
oxp-sensors
163164
pc87360
164165
pc87427
165166
pcf8591
@@ -187,6 +188,7 @@ Hardware Monitoring Kernel Drivers
187188
sis5595
188189
sl28cpld
189190
smm665
191+
smpro-hwmon
190192
smsc47b397
191193
smsc47m192
192194
smsc47m1

Documentation/hwmon/oxp-sensors.rst

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
.. SPDX-License-Identifier: GPL-2.0-or-later
2+
3+
Kernel driver oxp-sensors
4+
=========================
5+
6+
Author:
7+
- Joaquín Ignacio Aramendía <[email protected]>
8+
9+
Description:
10+
------------
11+
12+
One X Player devices from One Netbook provide fan readings and fan control
13+
through its Embedded Controller.
14+
15+
Currently only supports AMD boards from the One X Player and AOK ZOE lineup.
16+
Intel boards could be supported if we could figure out the EC registers and
17+
values to write to since the EC layout and model is different.
18+
19+
Supported devices
20+
-----------------
21+
22+
Currently the driver supports the following handhelds:
23+
24+
- AOK ZOE A1
25+
- OneXPlayer AMD
26+
- OneXPlayer mini AMD
27+
- OneXPlayer mini AMD PRO
28+
29+
Sysfs entries
30+
-------------
31+
32+
The following attributes are supported:
33+
34+
fan1_input
35+
Read Only. Reads current fan RMP.
36+
37+
pwm1_enable
38+
Read Write. Enable manual fan control. Write "1" to set to manual, write "0"
39+
to let the EC control de fan speed. Read this attribute to see current status.
40+
41+
pwm1
42+
Read Write. Read this attribute to see current duty cycle in the range [0-255].
43+
When pwm1_enable is set to "1" (manual) write any value in the range [0-255]
44+
to set fan speed.

Documentation/hwmon/smpro-hwmon.rst

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
.. SPDX-License-Identifier: GPL-2.0-only
2+
3+
Kernel driver Ampere(R)'s Altra(R) SMpro hwmon
4+
==============================================
5+
6+
Supported chips:
7+
8+
* Ampere(R) Altra(R)
9+
10+
Prefix: ``smpro``
11+
12+
Reference: `Altra SoC BMC Interface Specification`
13+
14+
Author: Thu Nguyen <[email protected]>
15+
16+
Description
17+
-----------
18+
The smpro-hwmon driver supports hardware monitoring for Ampere(R) Altra(R)
19+
SoCs based on the SMpro co-processor (SMpro). The following sensor metrics
20+
are supported by the driver:
21+
22+
* temperature
23+
* voltage
24+
* current
25+
* power
26+
27+
The interface provides the registers to query the various sensors and
28+
their values which are then exported to userspace by this driver.
29+
30+
Usage Notes
31+
-----------
32+
33+
The driver creates at least two sysfs files for each sensor.
34+
35+
* ``<sensor_type><idx>_label`` reports the sensor label.
36+
* ``<sensor_type><idx>_input`` returns the sensor value.
37+
38+
The sysfs files are allocated in the SMpro rootfs folder, with one root
39+
directory for each instance.
40+
41+
When the SoC is turned off, the driver will fail to read registers and
42+
return ``-ENXIO``.
43+
44+
Sysfs entries
45+
-------------
46+
47+
The following sysfs files are supported:
48+
49+
* Ampere(R) Altra(R):
50+
51+
============ ============= ====== ===============================================
52+
Name Unit Perm Description
53+
============ ============= ====== ===============================================
54+
temp1_input millicelsius RO SoC temperature
55+
temp2_input millicelsius RO Max temperature reported among SoC VRDs
56+
temp2_crit millicelsius RO SoC VRD HOT Threshold temperature
57+
temp3_input millicelsius RO Max temperature reported among DIMM VRDs
58+
temp4_input millicelsius RO Max temperature reported among Core VRDs
59+
temp5_input millicelsius RO Temperature of DIMM0 on CH0
60+
temp5_crit millicelsius RO MEM HOT Threshold for all DIMMs
61+
temp6_input millicelsius RO Temperature of DIMM0 on CH1
62+
temp6_crit millicelsius RO MEM HOT Threshold for all DIMMs
63+
temp7_input millicelsius RO Temperature of DIMM0 on CH2
64+
temp7_crit millicelsius RO MEM HOT Threshold for all DIMMs
65+
temp8_input millicelsius RO Temperature of DIMM0 on CH3
66+
temp8_crit millicelsius RO MEM HOT Threshold for all DIMMs
67+
temp9_input millicelsius RO Temperature of DIMM0 on CH4
68+
temp9_crit millicelsius RO MEM HOT Threshold for all DIMMs
69+
temp10_input millicelsius RO Temperature of DIMM0 on CH5
70+
temp10_crit millicelsius RO MEM HOT Threshold for all DIMMs
71+
temp11_input millicelsius RO Temperature of DIMM0 on CH6
72+
temp11_crit millicelsius RO MEM HOT Threshold for all DIMMs
73+
temp12_input millicelsius RO Temperature of DIMM0 on CH7
74+
temp12_crit millicelsius RO MEM HOT Threshold for all DIMMs
75+
temp13_input millicelsius RO Max temperature reported among RCA VRDs
76+
in0_input millivolts RO Core voltage
77+
in1_input millivolts RO SoC voltage
78+
in2_input millivolts RO DIMM VRD1 voltage
79+
in3_input millivolts RO DIMM VRD2 voltage
80+
in4_input millivolts RO RCA VRD voltage
81+
cur1_input milliamperes RO Core VRD current
82+
cur2_input milliamperes RO SoC VRD current
83+
cur3_input milliamperes RO DIMM VRD1 current
84+
cur4_input milliamperes RO DIMM VRD2 current
85+
cur5_input milliamperes RO RCA VRD current
86+
power1_input microwatts RO Core VRD power
87+
power2_input microwatts RO SoC VRD power
88+
power3_input microwatts RO DIMM VRD1 power
89+
power4_input microwatts RO DIMM VRD2 power
90+
power5_input microwatts RO RCA VRD power
91+
============ ============= ====== ===============================================
92+
93+
Example::
94+
95+
# cat in0_input
96+
830
97+
# cat temp1_input
98+
37000
99+
# cat curr1_input
100+
9000
101+
# cat power5_input
102+
19500000

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15452,6 +15452,12 @@ S: Maintained
1545215452
F: drivers/mtd/nand/onenand/
1545315453
F: include/linux/mtd/onenand*.h
1545415454

15455+
ONEXPLAYER FAN DRIVER
15456+
M: Joaquín Ignacio Aramendía <[email protected]>
15457+
15458+
S: Maintained
15459+
F: drivers/hwmon/oxp-sensors.c
15460+
1545515461
ONION OMEGA2+ BOARD
1545615462
M: Harvey Hunt <[email protected]>
1545715463

drivers/hwmon/Kconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ config SENSORS_ABITUGURU3
6767
This driver can also be built as a module. If so, the module
6868
will be called abituguru3.
6969

70+
config SENSORS_SMPRO
71+
tristate "Ampere's Altra SMpro hardware monitoring driver"
72+
depends on MFD_SMPRO
73+
help
74+
If you say yes here you get support for the thermal, voltage,
75+
current and power sensors of Ampere's Altra processor family SoC
76+
with SMpro co-processor.
77+
7078
config SENSORS_AD7314
7179
tristate "Analog Devices AD7314 and compatibles"
7280
depends on SPI
@@ -799,6 +807,7 @@ config SENSORS_IT87
799807
config SENSORS_JC42
800808
tristate "JEDEC JC42.4 compliant memory module temperature sensors"
801809
depends on I2C
810+
select REGMAP_I2C
802811
help
803812
If you say yes here, you get support for JEDEC JC42.4 compliant
804813
temperature sensors, which are used on many DDR3 memory modules for
@@ -1607,6 +1616,17 @@ config SENSORS_NZXT_SMART2
16071616

16081617
source "drivers/hwmon/occ/Kconfig"
16091618

1619+
config SENSORS_OXP
1620+
tristate "OneXPlayer EC fan control"
1621+
depends on ACPI
1622+
depends on X86
1623+
help
1624+
If you say yes here you get support for fan readings and control over
1625+
OneXPlayer handheld devices. Only OneXPlayer mini AMD handheld variant
1626+
boards are supported.
1627+
1628+
Can also be built as a module. In that case it will be called oxp-sensors.
1629+
16101630
config SENSORS_PCF8591
16111631
tristate "Philips PCF8591 ADC/DAC"
16121632
depends on I2C

drivers/hwmon/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ obj-$(CONFIG_SENSORS_NSA320) += nsa320-hwmon.o
167167
obj-$(CONFIG_SENSORS_NTC_THERMISTOR) += ntc_thermistor.o
168168
obj-$(CONFIG_SENSORS_NZXT_KRAKEN2) += nzxt-kraken2.o
169169
obj-$(CONFIG_SENSORS_NZXT_SMART2) += nzxt-smart2.o
170+
obj-$(CONFIG_SENSORS_OXP) += oxp-sensors.o
170171
obj-$(CONFIG_SENSORS_PC87360) += pc87360.o
171172
obj-$(CONFIG_SENSORS_PC87427) += pc87427.o
172173
obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o
@@ -187,6 +188,7 @@ obj-$(CONFIG_SENSORS_SHT4x) += sht4x.o
187188
obj-$(CONFIG_SENSORS_SHTC1) += shtc1.o
188189
obj-$(CONFIG_SENSORS_SIS5595) += sis5595.o
189190
obj-$(CONFIG_SENSORS_SMM665) += smm665.o
191+
obj-$(CONFIG_SENSORS_SMPRO) += smpro-hwmon.o
190192
obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o
191193
obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47m1.o
192194
obj-$(CONFIG_SENSORS_SMSC47M192)+= smsc47m192.o

drivers/hwmon/adm1177.c

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,12 @@
2626
/**
2727
* struct adm1177_state - driver instance specific data
2828
* @client: pointer to i2c client
29-
* @reg: regulator info for the power supply of the device
3029
* @r_sense_uohm: current sense resistor value
3130
* @alert_threshold_ua: current limit for shutdown
3231
* @vrange_high: internal voltage divider
3332
*/
3433
struct adm1177_state {
3534
struct i2c_client *client;
36-
struct regulator *reg;
3735
u32 r_sense_uohm;
3836
u32 alert_threshold_ua;
3937
bool vrange_high;
@@ -189,13 +187,6 @@ static const struct hwmon_chip_info adm1177_chip_info = {
189187
.info = adm1177_info,
190188
};
191189

192-
static void adm1177_remove(void *data)
193-
{
194-
struct adm1177_state *st = data;
195-
196-
regulator_disable(st->reg);
197-
}
198-
199190
static int adm1177_probe(struct i2c_client *client)
200191
{
201192
struct device *dev = &client->dev;
@@ -210,21 +201,9 @@ static int adm1177_probe(struct i2c_client *client)
210201

211202
st->client = client;
212203

213-
st->reg = devm_regulator_get_optional(&client->dev, "vref");
214-
if (IS_ERR(st->reg)) {
215-
if (PTR_ERR(st->reg) == -EPROBE_DEFER)
216-
return -EPROBE_DEFER;
217-
218-
st->reg = NULL;
219-
} else {
220-
ret = regulator_enable(st->reg);
221-
if (ret)
222-
return ret;
223-
ret = devm_add_action_or_reset(&client->dev, adm1177_remove,
224-
st);
225-
if (ret)
226-
return ret;
227-
}
204+
ret = devm_regulator_get_enable_optional(&client->dev, "vref");
205+
if (ret == -EPROBE_DEFER)
206+
return -EPROBE_DEFER;
228207

229208
if (device_property_read_u32(dev, "shunt-resistor-micro-ohms",
230209
&st->r_sense_uohm))

drivers/hwmon/aht10.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,7 @@ static const struct hwmon_chip_info aht10_chip_info = {
289289
.info = aht10_info,
290290
};
291291

292-
static int aht10_probe(struct i2c_client *client,
293-
const struct i2c_device_id *aht10_id)
292+
static int aht10_probe(struct i2c_client *client)
294293
{
295294
struct device *device = &client->dev;
296295
struct device *hwmon_dev;
@@ -336,7 +335,7 @@ static struct i2c_driver aht10_driver = {
336335
.driver = {
337336
.name = "aht10",
338337
},
339-
.probe = aht10_probe,
338+
.probe_new = aht10_probe,
340339
.id_table = aht10_id,
341340
};
342341

0 commit comments

Comments
 (0)