Commit 92fbb1c9 authored by Linus Torvalds's avatar Linus Torvalds

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

Pull hwmon fixes from Guenter Roeck:
 "Bug fixes for pmbus, ltc2978, and lineage-pem drivers

  Added specific maintainer for some hwmon drivers"

* tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (pmbus/ltc2978) Fix temperature reporting
  hwmon: (pmbus) Fix krealloc() misuse in pmbus_add_attribute()
  hwmon: (lineage-pem) Add missing terminating entry for pem_[input|fan]_attributes
  MAINTAINERS: Add maintainer for MAX6697, INA209, and INA2XX drivers
parents 1d9d8639 8c958c70
...@@ -4005,6 +4005,22 @@ M: Stanislaw Gruszka <stf_xl@wp.pl> ...@@ -4005,6 +4005,22 @@ M: Stanislaw Gruszka <stf_xl@wp.pl>
S: Maintained S: Maintained
F: drivers/usb/atm/ueagle-atm.c F: drivers/usb/atm/ueagle-atm.c
INA209 HARDWARE MONITOR DRIVER
M: Guenter Roeck <linux@roeck-us.net>
L: lm-sensors@lm-sensors.org
S: Maintained
F: Documentation/hwmon/ina209
F: Documentation/devicetree/bindings/i2c/ina209.txt
F: drivers/hwmon/ina209.c
INA2XX HARDWARE MONITOR DRIVER
M: Guenter Roeck <linux@roeck-us.net>
L: lm-sensors@lm-sensors.org
S: Maintained
F: Documentation/hwmon/ina2xx
F: drivers/hwmon/ina2xx.c
F: include/linux/platform_data/ina2xx.h
INDUSTRY PACK SUBSYSTEM (IPACK) INDUSTRY PACK SUBSYSTEM (IPACK)
M: Samuel Iglesias Gonsalvez <siglesias@igalia.com> M: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
M: Jens Taprogge <jens.taprogge@taprogge.org> M: Jens Taprogge <jens.taprogge@taprogge.org>
...@@ -5098,6 +5114,15 @@ S: Maintained ...@@ -5098,6 +5114,15 @@ S: Maintained
F: Documentation/hwmon/max6650 F: Documentation/hwmon/max6650
F: drivers/hwmon/max6650.c F: drivers/hwmon/max6650.c
MAX6697 HARDWARE MONITOR DRIVER
M: Guenter Roeck <linux@roeck-us.net>
L: lm-sensors@lm-sensors.org
S: Maintained
F: Documentation/hwmon/max6697
F: Documentation/devicetree/bindings/i2c/max6697.txt
F: drivers/hwmon/max6697.c
F: include/linux/platform_data/max6697.h
MAXIRADIO FM RADIO RECEIVER DRIVER MAXIRADIO FM RADIO RECEIVER DRIVER
M: Hans Verkuil <hverkuil@xs4all.nl> M: Hans Verkuil <hverkuil@xs4all.nl>
L: linux-media@vger.kernel.org L: linux-media@vger.kernel.org
......
...@@ -422,6 +422,7 @@ static struct attribute *pem_input_attributes[] = { ...@@ -422,6 +422,7 @@ static struct attribute *pem_input_attributes[] = {
&sensor_dev_attr_in2_input.dev_attr.attr, &sensor_dev_attr_in2_input.dev_attr.attr,
&sensor_dev_attr_curr1_input.dev_attr.attr, &sensor_dev_attr_curr1_input.dev_attr.attr,
&sensor_dev_attr_power1_input.dev_attr.attr, &sensor_dev_attr_power1_input.dev_attr.attr,
NULL
}; };
static const struct attribute_group pem_input_group = { static const struct attribute_group pem_input_group = {
...@@ -432,6 +433,7 @@ static struct attribute *pem_fan_attributes[] = { ...@@ -432,6 +433,7 @@ static struct attribute *pem_fan_attributes[] = {
&sensor_dev_attr_fan1_input.dev_attr.attr, &sensor_dev_attr_fan1_input.dev_attr.attr,
&sensor_dev_attr_fan2_input.dev_attr.attr, &sensor_dev_attr_fan2_input.dev_attr.attr,
&sensor_dev_attr_fan3_input.dev_attr.attr, &sensor_dev_attr_fan3_input.dev_attr.attr,
NULL
}; };
static const struct attribute_group pem_fan_group = { static const struct attribute_group pem_fan_group = {
......
...@@ -59,7 +59,7 @@ enum chips { ltc2978, ltc3880 }; ...@@ -59,7 +59,7 @@ enum chips { ltc2978, ltc3880 };
struct ltc2978_data { struct ltc2978_data {
enum chips id; enum chips id;
int vin_min, vin_max; int vin_min, vin_max;
int temp_min, temp_max; int temp_min, temp_max[2];
int vout_min[8], vout_max[8]; int vout_min[8], vout_max[8];
int iout_max[2]; int iout_max[2];
int temp2_max; int temp2_max;
...@@ -113,9 +113,10 @@ static int ltc2978_read_word_data_common(struct i2c_client *client, int page, ...@@ -113,9 +113,10 @@ static int ltc2978_read_word_data_common(struct i2c_client *client, int page,
ret = pmbus_read_word_data(client, page, ret = pmbus_read_word_data(client, page,
LTC2978_MFR_TEMPERATURE_PEAK); LTC2978_MFR_TEMPERATURE_PEAK);
if (ret >= 0) { if (ret >= 0) {
if (lin11_to_val(ret) > lin11_to_val(data->temp_max)) if (lin11_to_val(ret)
data->temp_max = ret; > lin11_to_val(data->temp_max[page]))
ret = data->temp_max; data->temp_max[page] = ret;
ret = data->temp_max[page];
} }
break; break;
case PMBUS_VIRT_RESET_VOUT_HISTORY: case PMBUS_VIRT_RESET_VOUT_HISTORY:
...@@ -266,7 +267,7 @@ static int ltc2978_write_word_data(struct i2c_client *client, int page, ...@@ -266,7 +267,7 @@ static int ltc2978_write_word_data(struct i2c_client *client, int page,
break; break;
case PMBUS_VIRT_RESET_TEMP_HISTORY: case PMBUS_VIRT_RESET_TEMP_HISTORY:
data->temp_min = 0x7bff; data->temp_min = 0x7bff;
data->temp_max = 0x7c00; data->temp_max[page] = 0x7c00;
ret = ltc2978_clear_peaks(client, page, data->id); ret = ltc2978_clear_peaks(client, page, data->id);
break; break;
default: default:
...@@ -323,7 +324,8 @@ static int ltc2978_probe(struct i2c_client *client, ...@@ -323,7 +324,8 @@ static int ltc2978_probe(struct i2c_client *client,
data->vin_min = 0x7bff; data->vin_min = 0x7bff;
data->vin_max = 0x7c00; data->vin_max = 0x7c00;
data->temp_min = 0x7bff; data->temp_min = 0x7bff;
data->temp_max = 0x7c00; for (i = 0; i < ARRAY_SIZE(data->temp_max); i++)
data->temp_max[i] = 0x7c00;
data->temp2_max = 0x7c00; data->temp2_max = 0x7c00;
switch (data->id) { switch (data->id) {
......
...@@ -766,12 +766,14 @@ static ssize_t pmbus_show_label(struct device *dev, ...@@ -766,12 +766,14 @@ static ssize_t pmbus_show_label(struct device *dev,
static int pmbus_add_attribute(struct pmbus_data *data, struct attribute *attr) static int pmbus_add_attribute(struct pmbus_data *data, struct attribute *attr)
{ {
if (data->num_attributes >= data->max_attributes - 1) { if (data->num_attributes >= data->max_attributes - 1) {
data->max_attributes += PMBUS_ATTR_ALLOC_SIZE; int new_max_attrs = data->max_attributes + PMBUS_ATTR_ALLOC_SIZE;
data->group.attrs = krealloc(data->group.attrs, void *new_attrs = krealloc(data->group.attrs,
sizeof(struct attribute *) * new_max_attrs * sizeof(void *),
data->max_attributes, GFP_KERNEL); GFP_KERNEL);
if (data->group.attrs == NULL) if (!new_attrs)
return -ENOMEM; return -ENOMEM;
data->group.attrs = new_attrs;
data->max_attributes = new_max_attrs;
} }
data->group.attrs[data->num_attributes++] = attr; data->group.attrs[data->num_attributes++] = attr;
......
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