Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+29 -10
+3 -4
Documentation/devicetree/bindings/hwmon/ti,tmp421.yaml
··· 58 58 description: | 59 59 The value (two's complement) to be programmed in the channel specific N correction register. 60 60 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 65 64 66 65 required: 67 66 - reg
+2 -2
drivers/hwmon/adt7470.c
··· 19 19 #include <linux/log2.h> 20 20 #include <linux/kthread.h> 21 21 #include <linux/regmap.h> 22 + #include <linux/sched.h> 22 23 #include <linux/slab.h> 23 24 #include <linux/util_macros.h> 24 25 ··· 295 294 adt7470_read_temperatures(data); 296 295 mutex_unlock(&data->lock); 297 296 298 - set_current_state(TASK_INTERRUPTIBLE); 299 297 if (kthread_should_stop()) 300 298 break; 301 299 302 - schedule_timeout(msecs_to_jiffies(data->auto_update_interval)); 300 + schedule_timeout_interruptible(msecs_to_jiffies(data->auto_update_interval)); 303 301 } 304 302 305 303 return 0;
+1 -1
drivers/hwmon/asus_wmi_sensors.c
··· 71 71 DMI_EXACT_MATCH_ASUS_BOARD_NAME("PRIME X399-A"), 72 72 DMI_EXACT_MATCH_ASUS_BOARD_NAME("PRIME X470-PRO"), 73 73 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"), 75 75 DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR VI HERO (WI-FI AC)"), 76 76 DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR VII HERO"), 77 77 DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR VII HERO (WI-FI)"),
+3 -2
drivers/hwmon/f71882fg.c
··· 1578 1578 temp *= 125; 1579 1579 if (sign) 1580 1580 temp -= 128000; 1581 - } else 1582 - temp = data->temp[nr] * 1000; 1581 + } else { 1582 + temp = ((s8)data->temp[nr]) * 1000; 1583 + } 1583 1584 1584 1585 return sprintf(buf, "%d\n", temp); 1585 1586 }
+16
drivers/hwmon/pmbus/delta-ahe50dc-fan.c
··· 14 14 15 15 #define AHE50DC_PMBUS_READ_TEMP4 0xd0 16 16 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 + 17 32 static int ahe50dc_fan_read_word_data(struct i2c_client *client, int page, int phase, int reg) 18 33 { 19 34 /* temp1 in (virtual) page 1 is remapped to mfr-specific temp4 */ ··· 83 68 PMBUS_HAVE_VIN | PMBUS_HAVE_FAN12 | PMBUS_HAVE_FAN34 | 84 69 PMBUS_HAVE_STATUS_FAN12 | PMBUS_HAVE_STATUS_FAN34 | PMBUS_PAGE_VIRTUAL, 85 70 .func[1] = PMBUS_HAVE_TEMP | PMBUS_PAGE_VIRTUAL, 71 + .write_byte = ahe50dc_fan_write_byte, 86 72 .read_word_data = ahe50dc_fan_read_word_data, 87 73 }; 88 74
+3
drivers/hwmon/pmbus/pmbus_core.c
··· 2326 2326 data->has_status_word = true; 2327 2327 } 2328 2328 2329 + /* Make sure PEC is disabled, will be enabled later if needed */ 2330 + client->flags &= ~I2C_CLIENT_PEC; 2331 + 2329 2332 /* Enable PEC if the controller and bus supports it */ 2330 2333 if (!(data->flags & PMBUS_NO_CAPABILITY)) { 2331 2334 ret = i2c_smbus_read_byte_data(client, PMBUS_CAPABILITY);
+1 -1
drivers/hwmon/pmbus/xdpe12284.c
··· 124 124 return 0; 125 125 } 126 126 127 - static const struct regulator_desc xdpe122_reg_desc[] = { 127 + static const struct regulator_desc __maybe_unused xdpe122_reg_desc[] = { 128 128 PMBUS_REGULATOR("vout", 0), 129 129 PMBUS_REGULATOR("vout", 1), 130 130 };