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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'hwmon-for-v5.6-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fixes from Guenter Roeck:
"Fix an error return in the adt7462 driver, bad voltage limits reported
by the xdpe12284 driver, and a broken documentation reference in the
adm1177 driver documentation"

* tag 'hwmon-for-v5.6-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
hwmon: (adt7462) Fix an error return in ADT7462_REG_VOLT()
hwmon: (pmbus/xdpe12284) Add callback for vout limits conversion
docs: adm1177: fix a broken reference

+56 -3
+1 -2
Documentation/hwmon/adm1177.rst
··· 20 20 ----------- 21 21 22 22 This driver does not auto-detect devices. You will have to instantiate the 23 - devices explicitly. Please see Documentation/i2c/instantiating-devices for 24 - details. 23 + devices explicitly. Please see :doc:`/i2c/instantiating-devices` for details. 25 24 26 25 27 26 Sysfs entries
+1 -1
drivers/hwmon/adt7462.c
··· 413 413 return 0x95; 414 414 break; 415 415 } 416 - return -ENODEV; 416 + return 0; 417 417 } 418 418 419 419 /* Provide labels for sysfs */
+54
drivers/hwmon/pmbus/xdpe12284.c
··· 18 18 #define XDPE122_AMD_625MV 0x10 /* AMD mode 6.25mV */ 19 19 #define XDPE122_PAGE_NUM 2 20 20 21 + static int xdpe122_read_word_data(struct i2c_client *client, int page, int reg) 22 + { 23 + const struct pmbus_driver_info *info = pmbus_get_driver_info(client); 24 + long val; 25 + s16 exponent; 26 + s32 mantissa; 27 + int ret; 28 + 29 + switch (reg) { 30 + case PMBUS_VOUT_OV_FAULT_LIMIT: 31 + case PMBUS_VOUT_UV_FAULT_LIMIT: 32 + ret = pmbus_read_word_data(client, page, reg); 33 + if (ret < 0) 34 + return ret; 35 + 36 + /* Convert register value to LINEAR11 data. */ 37 + exponent = ((s16)ret) >> 11; 38 + mantissa = ((s16)((ret & GENMASK(10, 0)) << 5)) >> 5; 39 + val = mantissa * 1000L; 40 + if (exponent >= 0) 41 + val <<= exponent; 42 + else 43 + val >>= -exponent; 44 + 45 + /* Convert data to VID register. */ 46 + switch (info->vrm_version[page]) { 47 + case vr13: 48 + if (val >= 500) 49 + return 1 + DIV_ROUND_CLOSEST(val - 500, 10); 50 + return 0; 51 + case vr12: 52 + if (val >= 250) 53 + return 1 + DIV_ROUND_CLOSEST(val - 250, 5); 54 + return 0; 55 + case imvp9: 56 + if (val >= 200) 57 + return 1 + DIV_ROUND_CLOSEST(val - 200, 10); 58 + return 0; 59 + case amd625mv: 60 + if (val >= 200 && val <= 1550) 61 + return DIV_ROUND_CLOSEST((1550 - val) * 100, 62 + 625); 63 + return 0; 64 + default: 65 + return -EINVAL; 66 + } 67 + default: 68 + return -ENODATA; 69 + } 70 + 71 + return 0; 72 + } 73 + 21 74 static int xdpe122_identify(struct i2c_client *client, 22 75 struct pmbus_driver_info *info) 23 76 { ··· 123 70 PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP | 124 71 PMBUS_HAVE_POUT | PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT, 125 72 .identify = xdpe122_identify, 73 + .read_word_data = xdpe122_read_word_data, 126 74 }; 127 75 128 76 static int xdpe122_probe(struct i2c_client *client,