hwmon fixes for v5.18-rc6

- 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
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEiHPvMQj9QTOCiqgVyx8mb86fmYEFAmJwxIkACgkQyx8mb86f
 mYFsTQ/8D4atoNJP1PAyOe6nFfZmmZzsRyVxKuypPOMtZQSn1xDfYSAi7m/1YNz5
 e2nSMQuA1SFNcnbPOmoSNKmVUAASN/55cDAo7pPs76mIf4vjbk8AhNdegSVNXE0q
 Xw/LfIdd6skJx3tK3tED4E7lwl7vUJHKND8L11R/meZQEClDvWUp6M/9rSvNdRf7
 nGtBgs63VA8dI8y06xyqUR2clQgFw70wjwePQty4wlAsDAa7gIX/GuwmeHwpfVHi
 EQihvp58gtZga6GlKTGHxqCCwzEL1FlNrRf5+vQhOorWLot9ltht1Uqp2Jy8NCEK
 Omg85jSZzqRzl8DVc3+25gxt5ClLLicljpYJ/esabpUwC2IdT4/dX95sJScFYa6Q
 UbsqU367TVQX2zF5J9Z6+coSK6eIXPRiQmT5PUbIjhzy/2CwkYoY6V8QSifvCiU1
 AFYug5Ditf/d/dU8W9HvpI8jCCZ0FhQ7lwQ9JqxdOTzVNlIRunHMZSTJOwod6c3C
 Fn+54HGwZU8ik9uc05QWBBaV99K0iya/Zo7Y0uQBNGDXISNI7rj3xICNhRafAkE0
 eRRpGIb2wq3bhBJhwl/aB/nSiY9JIAgERXB8k5o8YxlvVUYiktcRpXc7IEOkTQJg
 WZlP4aHXiv6RShO7Q2s+SQwH8jNmK+WeufX4Z0RYWRLr4a8JpII=
 =NgTE
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2022-05-03 09:51:52 -07:00
commit ef8e4d3c2a
7 changed files with 29 additions and 10 deletions

View File

@ -58,10 +58,9 @@ patternProperties:
description: |
The value (two's complement) to be programmed in the channel specific N correction register.
For remote channels only.
$ref: /schemas/types.yaml#/definitions/uint32
items:
minimum: 0
maximum: 255
$ref: /schemas/types.yaml#/definitions/int32
minimum: -128
maximum: 127
required:
- reg

View File

@ -19,6 +19,7 @@
#include <linux/log2.h>
#include <linux/kthread.h>
#include <linux/regmap.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/util_macros.h>
@ -294,11 +295,10 @@ static int adt7470_update_thread(void *p)
adt7470_read_temperatures(data);
mutex_unlock(&data->lock);
set_current_state(TASK_INTERRUPTIBLE);
if (kthread_should_stop())
break;
schedule_timeout(msecs_to_jiffies(data->auto_update_interval));
schedule_timeout_interruptible(msecs_to_jiffies(data->auto_update_interval));
}
return 0;

View File

@ -71,7 +71,7 @@ static const struct dmi_system_id asus_wmi_dmi_table[] = {
DMI_EXACT_MATCH_ASUS_BOARD_NAME("PRIME X399-A"),
DMI_EXACT_MATCH_ASUS_BOARD_NAME("PRIME X470-PRO"),
DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR VI EXTREME"),
DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR VI HERO"),
DMI_EXACT_MATCH_ASUS_BOARD_NAME("CROSSHAIR VI HERO"),
DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR VI HERO (WI-FI AC)"),
DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR VII HERO"),
DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR VII HERO (WI-FI)"),

View File

@ -1578,8 +1578,9 @@ static ssize_t show_temp(struct device *dev, struct device_attribute *devattr,
temp *= 125;
if (sign)
temp -= 128000;
} else
temp = data->temp[nr] * 1000;
} else {
temp = ((s8)data->temp[nr]) * 1000;
}
return sprintf(buf, "%d\n", temp);
}

View File

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

View File

@ -2326,6 +2326,9 @@ static int pmbus_init_common(struct i2c_client *client, struct pmbus_data *data,
data->has_status_word = true;
}
/* Make sure PEC is disabled, will be enabled later if needed */
client->flags &= ~I2C_CLIENT_PEC;
/* Enable PEC if the controller and bus supports it */
if (!(data->flags & PMBUS_NO_CAPABILITY)) {
ret = i2c_smbus_read_byte_data(client, PMBUS_CAPABILITY);

View File

@ -124,7 +124,7 @@ static int xdpe122_identify(struct i2c_client *client,
return 0;
}
static const struct regulator_desc xdpe122_reg_desc[] = {
static const struct regulator_desc __maybe_unused xdpe122_reg_desc[] = {
PMBUS_REGULATOR("vout", 0),
PMBUS_REGULATOR("vout", 1),
};