hwmon fixes for v5.13-rc4

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.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEiHPvMQj9QTOCiqgVyx8mb86fmYEFAmCudMsACgkQyx8mb86f
 mYGILQ//bmffBsY1y+D7h/a6l0cIq04fbQ1unfJ0prlb7hJw/jibZuB+lsOGNRd1
 B9KyKDzF9oV+cLY5VuvP4RZ9jHKjVyqdrjJAcbAeYBVI/lKqG8JXHKP1GBlmMQyD
 FmWOLCqUhQjvaEtztqjvmloGxs0Zmg49+3O4WOmgDFM/dRLVlLMGxXw2gGJBgsiK
 fA1AqClCzF9UR9vRVk+BS1I6LwXr7ft9VIZh1NaKLpBGuVLV1rF/CCDfodPlCzls
 ceKyFcHUwuZlR93L2L4umMgQVDi4RbRTI7RBJ76kUA16JCd/ph9ANuCKQeeAxuWa
 hPTpLFO+aCbRI79RlT8mZvw1lZaXbXRiGowHYx2o8ii+w1Jl+C/8LCsaXSm5oHVR
 O2P5zzSwYvRHhEKz7xjzwszyPOa+34yLfKSMRxyKnww2xAA2yWtUfAXQVqTDn+Co
 Sg9uGtchkhFGOiZ1Vq7OGRcjRDtm8wwWPMWHyIohcBlCeomAUaxCJfRQFB9mJO38
 8Jmdx6E9RmW49gr3yxYBohSUC7UN/RcOvu9we5yd6vO0OMJYiauZ2o8vFrX/h50+
 sQLOGKkXSQqIaDxoLMaJ3TC5XMyMxYTNwhUP+N3YNpPnVTor4Wcs+4zjYsGzzF58
 ucXOW+2Ho40wz8uOfLhPs7H6G5TC6h9bInaBDjySGVwcKZ7ZQmI=
 =78YS
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2021-06-02 08:41:45 -10:00
commit 3bfc6ffb61
4 changed files with 30 additions and 12 deletions

View File

@ -838,10 +838,10 @@ static struct attribute *i8k_attrs[] = {
static umode_t i8k_is_visible(struct kobject *kobj, struct attribute *attr,
int index)
{
if (disallow_fan_support && index >= 8)
if (disallow_fan_support && index >= 20)
return 0;
if (disallow_fan_type_call &&
(index == 9 || index == 12 || index == 15))
(index == 21 || index == 25 || index == 28))
return 0;
if (index >= 0 && index <= 1 &&
!(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP1))

View File

@ -37,6 +37,8 @@ struct fsp3y_data {
struct pmbus_driver_info info;
int chip;
int page;
bool vout_linear_11;
};
#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)
int rv;
/*
* YH5151-E outputs vout in linear11. The conversion is done when
* reading. Here, we have to inject pmbus_core with the correct
* exponent (it is -6).
* Inject an exponent for non-compliant YH5151-E.
*/
if (data->chip == yh5151e && reg == PMBUS_VOUT_MODE)
if (data->vout_linear_11 && reg == PMBUS_VOUT_MODE)
return 0x1A;
rv = set_page(client, page);
@ -161,10 +161,9 @@ static int fsp3y_read_word_data(struct i2c_client *client, int page, int phase,
return rv;
/*
* YH-5151E is non-compliant and outputs output voltages in linear11
* instead of linear16.
* Handle YH-5151E non-compliant linear11 vout voltage.
*/
if (data->chip == yh5151e && reg == PMBUS_READ_VOUT)
if (data->vout_linear_11 && reg == PMBUS_READ_VOUT)
rv = sign_extend32(rv, 10) & 0xffff;
return rv;
@ -256,6 +255,25 @@ static int fsp3y_probe(struct i2c_client *client)
data->info = fsp3y_info[data->chip];
/*
* YH-5151E sometimes reports vout in linear11 and sometimes in
* linear16. This depends on the exact individual piece of hardware. One
* YH-5151E can use linear16 and another might use linear11 instead.
*
* The format can be recognized by reading VOUT_MODE - if it doesn't
* report a valid exponent, then vout uses linear11. Otherwise, the
* device is compliant and uses linear16.
*/
data->vout_linear_11 = false;
if (data->chip == yh5151e) {
rv = i2c_smbus_read_byte_data(client, PMBUS_VOUT_MODE);
if (rv < 0)
return rv;
if (rv == 0xFF)
data->vout_linear_11 = true;
}
return pmbus_do_probe(client, &data->info);
}

View File

@ -244,8 +244,8 @@ static int isl68137_probe(struct i2c_client *client)
info->read_word_data = raa_dmpvr2_read_word_data;
break;
case raa_dmpvr2_2rail_nontc:
info->func[0] &= ~PMBUS_HAVE_TEMP;
info->func[1] &= ~PMBUS_HAVE_TEMP;
info->func[0] &= ~PMBUS_HAVE_TEMP3;
info->func[1] &= ~PMBUS_HAVE_TEMP3;
fallthrough;
case raa_dmpvr2_2rail:
info->pages = 2;

View File

@ -299,7 +299,7 @@ static int q54sj108a2_probe(struct i2c_client *client)
dev_err(&client->dev, "Failed to read Manufacturer ID\n");
return ret;
}
if (ret != 5 || strncmp(buf, "DELTA", 5)) {
if (ret != 6 || strncmp(buf, "DELTA", 5)) {
buf[ret] = '\0';
dev_err(dev, "Unsupported Manufacturer ID '%s'\n", buf);
return -ENODEV;