Skip to content

Commit 3bfc6ff

Browse files
committed
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
2 parents 231bc53 + f0fb26c commit 3bfc6ff

File tree

4 files changed

+30
-12
lines changed

4 files changed

+30
-12
lines changed

drivers/hwmon/dell-smm-hwmon.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,10 +838,10 @@ static struct attribute *i8k_attrs[] = {
838838
static umode_t i8k_is_visible(struct kobject *kobj, struct attribute *attr,
839839
int index)
840840
{
841-
if (disallow_fan_support && index >= 8)
841+
if (disallow_fan_support && index >= 20)
842842
return 0;
843843
if (disallow_fan_type_call &&
844-
(index == 9 || index == 12 || index == 15))
844+
(index == 21 || index == 25 || index == 28))
845845
return 0;
846846
if (index >= 0 && index <= 1 &&
847847
!(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP1))

drivers/hwmon/pmbus/fsp-3y.c

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ struct fsp3y_data {
3737
struct pmbus_driver_info info;
3838
int chip;
3939
int page;
40+
41+
bool vout_linear_11;
4042
};
4143

4244
#define to_fsp3y_data(x) container_of(x, struct fsp3y_data, info)
@@ -108,11 +110,9 @@ static int fsp3y_read_byte_data(struct i2c_client *client, int page, int reg)
108110
int rv;
109111

110112
/*
111-
* YH5151-E outputs vout in linear11. The conversion is done when
112-
* reading. Here, we have to inject pmbus_core with the correct
113-
* exponent (it is -6).
113+
* Inject an exponent for non-compliant YH5151-E.
114114
*/
115-
if (data->chip == yh5151e && reg == PMBUS_VOUT_MODE)
115+
if (data->vout_linear_11 && reg == PMBUS_VOUT_MODE)
116116
return 0x1A;
117117

118118
rv = set_page(client, page);
@@ -161,10 +161,9 @@ static int fsp3y_read_word_data(struct i2c_client *client, int page, int phase,
161161
return rv;
162162

163163
/*
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.
166165
*/
167-
if (data->chip == yh5151e && reg == PMBUS_READ_VOUT)
166+
if (data->vout_linear_11 && reg == PMBUS_READ_VOUT)
168167
rv = sign_extend32(rv, 10) & 0xffff;
169168

170169
return rv;
@@ -256,6 +255,25 @@ static int fsp3y_probe(struct i2c_client *client)
256255

257256
data->info = fsp3y_info[data->chip];
258257

258+
/*
259+
* YH-5151E sometimes reports vout in linear11 and sometimes in
260+
* linear16. This depends on the exact individual piece of hardware. One
261+
* YH-5151E can use linear16 and another might use linear11 instead.
262+
*
263+
* The format can be recognized by reading VOUT_MODE - if it doesn't
264+
* report a valid exponent, then vout uses linear11. Otherwise, the
265+
* device is compliant and uses linear16.
266+
*/
267+
data->vout_linear_11 = false;
268+
if (data->chip == yh5151e) {
269+
rv = i2c_smbus_read_byte_data(client, PMBUS_VOUT_MODE);
270+
if (rv < 0)
271+
return rv;
272+
273+
if (rv == 0xFF)
274+
data->vout_linear_11 = true;
275+
}
276+
259277
return pmbus_do_probe(client, &data->info);
260278
}
261279

drivers/hwmon/pmbus/isl68137.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ static int isl68137_probe(struct i2c_client *client)
244244
info->read_word_data = raa_dmpvr2_read_word_data;
245245
break;
246246
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;
249249
fallthrough;
250250
case raa_dmpvr2_2rail:
251251
info->pages = 2;

drivers/hwmon/pmbus/q54sj108a2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ static int q54sj108a2_probe(struct i2c_client *client)
299299
dev_err(&client->dev, "Failed to read Manufacturer ID\n");
300300
return ret;
301301
}
302-
if (ret != 5 || strncmp(buf, "DELTA", 5)) {
302+
if (ret != 6 || strncmp(buf, "DELTA", 5)) {
303303
buf[ret] = '\0';
304304
dev_err(dev, "Unsupported Manufacturer ID '%s'\n", buf);
305305
return -ENODEV;

0 commit comments

Comments
 (0)