Commit 3bfc6ffb authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'hwmon-for-v5.13-rc4' of...

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
parents 231bc539 f0fb26c4
...@@ -838,10 +838,10 @@ static struct attribute *i8k_attrs[] = { ...@@ -838,10 +838,10 @@ static struct attribute *i8k_attrs[] = {
static umode_t i8k_is_visible(struct kobject *kobj, struct attribute *attr, static umode_t i8k_is_visible(struct kobject *kobj, struct attribute *attr,
int index) int index)
{ {
if (disallow_fan_support && index >= 8) if (disallow_fan_support && index >= 20)
return 0; return 0;
if (disallow_fan_type_call && if (disallow_fan_type_call &&
(index == 9 || index == 12 || index == 15)) (index == 21 || index == 25 || index == 28))
return 0; return 0;
if (index >= 0 && index <= 1 && if (index >= 0 && index <= 1 &&
!(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP1)) !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP1))
......
...@@ -37,6 +37,8 @@ struct fsp3y_data { ...@@ -37,6 +37,8 @@ struct fsp3y_data {
struct pmbus_driver_info info; struct pmbus_driver_info info;
int chip; int chip;
int page; int page;
bool vout_linear_11;
}; };
#define to_fsp3y_data(x) container_of(x, struct fsp3y_data, info) #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) ...@@ -108,11 +110,9 @@ static int fsp3y_read_byte_data(struct i2c_client *client, int page, int reg)
int rv; int rv;
/* /*
* YH5151-E outputs vout in linear11. The conversion is done when * Inject an exponent for non-compliant YH5151-E.
* reading. Here, we have to inject pmbus_core with the correct
* exponent (it is -6).
*/ */
if (data->chip == yh5151e && reg == PMBUS_VOUT_MODE) if (data->vout_linear_11 && reg == PMBUS_VOUT_MODE)
return 0x1A; return 0x1A;
rv = set_page(client, page); rv = set_page(client, page);
...@@ -161,10 +161,9 @@ static int fsp3y_read_word_data(struct i2c_client *client, int page, int phase, ...@@ -161,10 +161,9 @@ static int fsp3y_read_word_data(struct i2c_client *client, int page, int phase,
return rv; return rv;
/* /*
* YH-5151E is non-compliant and outputs output voltages in linear11 * Handle YH-5151E non-compliant linear11 vout voltage.
* instead of linear16.
*/ */
if (data->chip == yh5151e && reg == PMBUS_READ_VOUT) if (data->vout_linear_11 && reg == PMBUS_READ_VOUT)
rv = sign_extend32(rv, 10) & 0xffff; rv = sign_extend32(rv, 10) & 0xffff;
return rv; return rv;
...@@ -256,6 +255,25 @@ static int fsp3y_probe(struct i2c_client *client) ...@@ -256,6 +255,25 @@ static int fsp3y_probe(struct i2c_client *client)
data->info = fsp3y_info[data->chip]; 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); return pmbus_do_probe(client, &data->info);
} }
......
...@@ -244,8 +244,8 @@ static int isl68137_probe(struct i2c_client *client) ...@@ -244,8 +244,8 @@ static int isl68137_probe(struct i2c_client *client)
info->read_word_data = raa_dmpvr2_read_word_data; info->read_word_data = raa_dmpvr2_read_word_data;
break; break;
case raa_dmpvr2_2rail_nontc: case raa_dmpvr2_2rail_nontc:
info->func[0] &= ~PMBUS_HAVE_TEMP; info->func[0] &= ~PMBUS_HAVE_TEMP3;
info->func[1] &= ~PMBUS_HAVE_TEMP; info->func[1] &= ~PMBUS_HAVE_TEMP3;
fallthrough; fallthrough;
case raa_dmpvr2_2rail: case raa_dmpvr2_2rail:
info->pages = 2; info->pages = 2;
......
...@@ -299,7 +299,7 @@ static int q54sj108a2_probe(struct i2c_client *client) ...@@ -299,7 +299,7 @@ static int q54sj108a2_probe(struct i2c_client *client)
dev_err(&client->dev, "Failed to read Manufacturer ID\n"); dev_err(&client->dev, "Failed to read Manufacturer ID\n");
return ret; return ret;
} }
if (ret != 5 || strncmp(buf, "DELTA", 5)) { if (ret != 6 || strncmp(buf, "DELTA", 5)) {
buf[ret] = '\0'; buf[ret] = '\0';
dev_err(dev, "Unsupported Manufacturer ID '%s'\n", buf); dev_err(dev, "Unsupported Manufacturer ID '%s'\n", buf);
return -ENODEV; return -ENODEV;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment