Skip to content

Commit ef8e4d3

Browse files
committed
Merge tag 'hwmon-for-v5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon fixes from Guenter Roeck: - Work around a hardware problem in the delta-ahe50dc-fan driver - Explicitly disable PEC in PMBus core if not enabled - Fix negative temperature values in f71882fg driver - Fix warning on removal of adt7470 driver - Fix CROSSHAIR VI HERO name in asus_wmi_sensors driver - Fix build warning seen in xdpe12284 driver if CONFIG_SENSORS_XDPE122_REGULATOR is disabled - Fix type of 'ti,n-factor' in ti,tmp421 driver bindings * tag 'hwmon-for-v5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (pmbus) delta-ahe50dc-fan: work around hardware quirk hwmon: (pmbus) disable PEC if not enabled hwmon: (f71882fg) Fix negative temperature dt-bindings: hwmon: ti,tmp421: Fix type for 'ti,n-factor' hwmon: (adt7470) Fix warning on module removal hwmon: (asus_wmi_sensors) Fix CROSSHAIR VI HERO name hwmon: (xdpe12284) Fix build warning seen if CONFIG_SENSORS_XDPE122_REGULATOR is disabled
2 parents 9050ba3 + 08da09f commit ef8e4d3

File tree

7 files changed

+29
-10
lines changed

7 files changed

+29
-10
lines changed

Documentation/devicetree/bindings/hwmon/ti,tmp421.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,9 @@ patternProperties:
5858
description: |
5959
The value (two's complement) to be programmed in the channel specific N correction register.
6060
For remote channels only.
61-
$ref: /schemas/types.yaml#/definitions/uint32
62-
items:
63-
minimum: 0
64-
maximum: 255
61+
$ref: /schemas/types.yaml#/definitions/int32
62+
minimum: -128
63+
maximum: 127
6564

6665
required:
6766
- reg

drivers/hwmon/adt7470.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <linux/log2.h>
2020
#include <linux/kthread.h>
2121
#include <linux/regmap.h>
22+
#include <linux/sched.h>
2223
#include <linux/slab.h>
2324
#include <linux/util_macros.h>
2425

@@ -294,11 +295,10 @@ static int adt7470_update_thread(void *p)
294295
adt7470_read_temperatures(data);
295296
mutex_unlock(&data->lock);
296297

297-
set_current_state(TASK_INTERRUPTIBLE);
298298
if (kthread_should_stop())
299299
break;
300300

301-
schedule_timeout(msecs_to_jiffies(data->auto_update_interval));
301+
schedule_timeout_interruptible(msecs_to_jiffies(data->auto_update_interval));
302302
}
303303

304304
return 0;

drivers/hwmon/asus_wmi_sensors.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static const struct dmi_system_id asus_wmi_dmi_table[] = {
7171
DMI_EXACT_MATCH_ASUS_BOARD_NAME("PRIME X399-A"),
7272
DMI_EXACT_MATCH_ASUS_BOARD_NAME("PRIME X470-PRO"),
7373
DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR VI EXTREME"),
74-
DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR VI HERO"),
74+
DMI_EXACT_MATCH_ASUS_BOARD_NAME("CROSSHAIR VI HERO"),
7575
DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR VI HERO (WI-FI AC)"),
7676
DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR VII HERO"),
7777
DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR VII HERO (WI-FI)"),

drivers/hwmon/f71882fg.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,8 +1578,9 @@ static ssize_t show_temp(struct device *dev, struct device_attribute *devattr,
15781578
temp *= 125;
15791579
if (sign)
15801580
temp -= 128000;
1581-
} else
1582-
temp = data->temp[nr] * 1000;
1581+
} else {
1582+
temp = ((s8)data->temp[nr]) * 1000;
1583+
}
15831584

15841585
return sprintf(buf, "%d\n", temp);
15851586
}

drivers/hwmon/pmbus/delta-ahe50dc-fan.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@
1414

1515
#define AHE50DC_PMBUS_READ_TEMP4 0xd0
1616

17+
static int ahe50dc_fan_write_byte(struct i2c_client *client, int page, u8 value)
18+
{
19+
/*
20+
* The CLEAR_FAULTS operation seems to sometimes (unpredictably, perhaps
21+
* 5% of the time or so) trigger a problematic phenomenon in which the
22+
* fan speeds surge momentarily and at least some (perhaps all?) of the
23+
* system's power outputs experience a glitch.
24+
*
25+
* However, according to Delta it should be OK to simply not send any
26+
* CLEAR_FAULTS commands (the device doesn't seem to be capable of
27+
* reporting any faults anyway), so just blackhole them unconditionally.
28+
*/
29+
return value == PMBUS_CLEAR_FAULTS ? -EOPNOTSUPP : -ENODATA;
30+
}
31+
1732
static int ahe50dc_fan_read_word_data(struct i2c_client *client, int page, int phase, int reg)
1833
{
1934
/* temp1 in (virtual) page 1 is remapped to mfr-specific temp4 */
@@ -68,6 +83,7 @@ static struct pmbus_driver_info ahe50dc_fan_info = {
6883
PMBUS_HAVE_VIN | PMBUS_HAVE_FAN12 | PMBUS_HAVE_FAN34 |
6984
PMBUS_HAVE_STATUS_FAN12 | PMBUS_HAVE_STATUS_FAN34 | PMBUS_PAGE_VIRTUAL,
7085
.func[1] = PMBUS_HAVE_TEMP | PMBUS_PAGE_VIRTUAL,
86+
.write_byte = ahe50dc_fan_write_byte,
7187
.read_word_data = ahe50dc_fan_read_word_data,
7288
};
7389

drivers/hwmon/pmbus/pmbus_core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2326,6 +2326,9 @@ static int pmbus_init_common(struct i2c_client *client, struct pmbus_data *data,
23262326
data->has_status_word = true;
23272327
}
23282328

2329+
/* Make sure PEC is disabled, will be enabled later if needed */
2330+
client->flags &= ~I2C_CLIENT_PEC;
2331+
23292332
/* Enable PEC if the controller and bus supports it */
23302333
if (!(data->flags & PMBUS_NO_CAPABILITY)) {
23312334
ret = i2c_smbus_read_byte_data(client, PMBUS_CAPABILITY);

drivers/hwmon/pmbus/xdpe12284.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static int xdpe122_identify(struct i2c_client *client,
124124
return 0;
125125
}
126126

127-
static const struct regulator_desc xdpe122_reg_desc[] = {
127+
static const struct regulator_desc __maybe_unused xdpe122_reg_desc[] = {
128128
PMBUS_REGULATOR("vout", 0),
129129
PMBUS_REGULATOR("vout", 1),
130130
};

0 commit comments

Comments
 (0)