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

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

Pull hwmon fixes from Guenter Roeck:
"The most notable fix is for the q54sj108a2 driver to let it actually
instantiate.

Also attribute fixes for pmbus/isl68137, pmbus/fsp-3y, and
dell-smm-hwmon drivers"

* tag 'hwmon-for-v5.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
hwmon/pmbus: (q54sj108a2) The PMBUS_MFR_ID is actually 6 chars instead of 5
hwmon: (pmbus/isl68137) remove READ_TEMPERATURE_3 for RAA228228
hwmon: (pmbus/fsp-3y) Fix FSP-3Y YH-5151E VOUT
hwmon: (dell-smm-hwmon) Fix index values

+30 -12
+2 -2
drivers/hwmon/dell-smm-hwmon.c
··· 838 838 static umode_t i8k_is_visible(struct kobject *kobj, struct attribute *attr, 839 839 int index) 840 840 { 841 - if (disallow_fan_support && index >= 8) 841 + if (disallow_fan_support && index >= 20) 842 842 return 0; 843 843 if (disallow_fan_type_call && 844 - (index == 9 || index == 12 || index == 15)) 844 + (index == 21 || index == 25 || index == 28)) 845 845 return 0; 846 846 if (index >= 0 && index <= 1 && 847 847 !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP1))
+25 -7
drivers/hwmon/pmbus/fsp-3y.c
··· 37 37 struct pmbus_driver_info info; 38 38 int chip; 39 39 int page; 40 + 41 + bool vout_linear_11; 40 42 }; 41 43 42 44 #define to_fsp3y_data(x) container_of(x, struct fsp3y_data, info) ··· 110 108 int rv; 111 109 112 110 /* 113 - * YH5151-E outputs vout in linear11. The conversion is done when 114 - * reading. Here, we have to inject pmbus_core with the correct 115 - * exponent (it is -6). 111 + * Inject an exponent for non-compliant YH5151-E. 116 112 */ 117 - if (data->chip == yh5151e && reg == PMBUS_VOUT_MODE) 113 + if (data->vout_linear_11 && reg == PMBUS_VOUT_MODE) 118 114 return 0x1A; 119 115 120 116 rv = set_page(client, page); ··· 161 161 return rv; 162 162 163 163 /* 164 - * YH-5151E is non-compliant and outputs output voltages in linear11 165 - * instead of linear16. 164 + * Handle YH-5151E non-compliant linear11 vout voltage. 166 165 */ 167 - if (data->chip == yh5151e && reg == PMBUS_READ_VOUT) 166 + if (data->vout_linear_11 && reg == PMBUS_READ_VOUT) 168 167 rv = sign_extend32(rv, 10) & 0xffff; 169 168 170 169 return rv; ··· 254 255 data->page = rv; 255 256 256 257 data->info = fsp3y_info[data->chip]; 258 + 259 + /* 260 + * YH-5151E sometimes reports vout in linear11 and sometimes in 261 + * linear16. This depends on the exact individual piece of hardware. One 262 + * YH-5151E can use linear16 and another might use linear11 instead. 263 + * 264 + * The format can be recognized by reading VOUT_MODE - if it doesn't 265 + * report a valid exponent, then vout uses linear11. Otherwise, the 266 + * device is compliant and uses linear16. 267 + */ 268 + data->vout_linear_11 = false; 269 + if (data->chip == yh5151e) { 270 + rv = i2c_smbus_read_byte_data(client, PMBUS_VOUT_MODE); 271 + if (rv < 0) 272 + return rv; 273 + 274 + if (rv == 0xFF) 275 + data->vout_linear_11 = true; 276 + } 257 277 258 278 return pmbus_do_probe(client, &data->info); 259 279 }
+2 -2
drivers/hwmon/pmbus/isl68137.c
··· 244 244 info->read_word_data = raa_dmpvr2_read_word_data; 245 245 break; 246 246 case raa_dmpvr2_2rail_nontc: 247 - info->func[0] &= ~PMBUS_HAVE_TEMP; 248 - info->func[1] &= ~PMBUS_HAVE_TEMP; 247 + info->func[0] &= ~PMBUS_HAVE_TEMP3; 248 + info->func[1] &= ~PMBUS_HAVE_TEMP3; 249 249 fallthrough; 250 250 case raa_dmpvr2_2rail: 251 251 info->pages = 2;
+1 -1
drivers/hwmon/pmbus/q54sj108a2.c
··· 299 299 dev_err(&client->dev, "Failed to read Manufacturer ID\n"); 300 300 return ret; 301 301 } 302 - if (ret != 5 || strncmp(buf, "DELTA", 5)) { 302 + if (ret != 6 || strncmp(buf, "DELTA", 5)) { 303 303 buf[ret] = '\0'; 304 304 dev_err(dev, "Unsupported Manufacturer ID '%s'\n", buf); 305 305 return -ENODEV;