1
0
Fork 0

Bug fixes for pmbus, ltc2978, and lineage-pem drivers

Added specific maintainer for some hwmon drivers
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJRQpk6AAoJEMsfJm/On5mBdO0P/00erMl+2duXU1vaHstNN8h0
 Og8aYIESDBvvsdQJQor+tCu3jn0oYqJeK/Au5HKv1vDFnARwlCttxLMW+Qgxudte
 anpfqh+SXDn7Uchh4vV3fyFGqO93PeCe2+ScdmuWYLv2G40dVSVtqrUDXByJadRV
 vJQmuk7sP2bJd3WSFs0wavlIPJ50nzop8tZJaxd/woS/Ccx3cX9BXvy0kF0FjInW
 rFohQ8EI62R0+Et5t9xNXwyYjpo8ZFATjXE0VJHRonFZhrVnLPgZqPzshaskqjiv
 4ZAjb03lYnHn+yo8nES4Bvh5leqlSqYavc0V9lhxWw8alHg5MpS6sWoFQFvTChcs
 iMsXXeFDfoeN59E1J1xvulTUuH/qgOfM/XQD8ujPzkONVseYzCec0m/4rFmIfozd
 P9mrpKDnRLiFPqbAD/YpHrtGrzadWWGdqwaolsr89kr4AehIwFSTo4UVVn3MHFq6
 shJ45uo2eDcO+JIZBP7lVAgFN9sXnoroVPHc1THcPWnw5hFQKaC0AO9+xRTPXmip
 Os2xBaOb/Ogs4TGWZhjQPPwTz8n7NpDtp6upVF+CvWU3dKlWd9CZGDyUPHV4pTqQ
 47fxQMJsjdUVBYFsNGJKfNrj+lZ/MdSxu+oYcJArNjNbEdCbfctHonjWAD27/fU8
 Y26N2vx2YcVx6zGwpYIF
 =EVnW
 -----END PGP SIGNATURE-----

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
hifive-unleashed-5.1
Linus Torvalds 2013-03-15 17:33:13 -07:00
commit 92fbb1c917
4 changed files with 42 additions and 11 deletions

View File

@ -4005,6 +4005,22 @@ M: Stanislaw Gruszka <stf_xl@wp.pl>
S: Maintained
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)
M: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
M: Jens Taprogge <jens.taprogge@taprogge.org>
@ -5098,6 +5114,15 @@ S: Maintained
F: Documentation/hwmon/max6650
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
M: Hans Verkuil <hverkuil@xs4all.nl>
L: linux-media@vger.kernel.org

View File

@ -422,6 +422,7 @@ static struct attribute *pem_input_attributes[] = {
&sensor_dev_attr_in2_input.dev_attr.attr,
&sensor_dev_attr_curr1_input.dev_attr.attr,
&sensor_dev_attr_power1_input.dev_attr.attr,
NULL
};
static const struct attribute_group pem_input_group = {
@ -432,6 +433,7 @@ static struct attribute *pem_fan_attributes[] = {
&sensor_dev_attr_fan1_input.dev_attr.attr,
&sensor_dev_attr_fan2_input.dev_attr.attr,
&sensor_dev_attr_fan3_input.dev_attr.attr,
NULL
};
static const struct attribute_group pem_fan_group = {

View File

@ -59,7 +59,7 @@ enum chips { ltc2978, ltc3880 };
struct ltc2978_data {
enum chips id;
int vin_min, vin_max;
int temp_min, temp_max;
int temp_min, temp_max[2];
int vout_min[8], vout_max[8];
int iout_max[2];
int temp2_max;
@ -113,9 +113,10 @@ static int ltc2978_read_word_data_common(struct i2c_client *client, int page,
ret = pmbus_read_word_data(client, page,
LTC2978_MFR_TEMPERATURE_PEAK);
if (ret >= 0) {
if (lin11_to_val(ret) > lin11_to_val(data->temp_max))
data->temp_max = ret;
ret = data->temp_max;
if (lin11_to_val(ret)
> lin11_to_val(data->temp_max[page]))
data->temp_max[page] = ret;
ret = data->temp_max[page];
}
break;
case PMBUS_VIRT_RESET_VOUT_HISTORY:
@ -266,7 +267,7 @@ static int ltc2978_write_word_data(struct i2c_client *client, int page,
break;
case PMBUS_VIRT_RESET_TEMP_HISTORY:
data->temp_min = 0x7bff;
data->temp_max = 0x7c00;
data->temp_max[page] = 0x7c00;
ret = ltc2978_clear_peaks(client, page, data->id);
break;
default:
@ -323,7 +324,8 @@ static int ltc2978_probe(struct i2c_client *client,
data->vin_min = 0x7bff;
data->vin_max = 0x7c00;
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;
switch (data->id) {

View File

@ -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)
{
if (data->num_attributes >= data->max_attributes - 1) {
data->max_attributes += PMBUS_ATTR_ALLOC_SIZE;
data->group.attrs = krealloc(data->group.attrs,
sizeof(struct attribute *) *
data->max_attributes, GFP_KERNEL);
if (data->group.attrs == NULL)
int new_max_attrs = data->max_attributes + PMBUS_ATTR_ALLOC_SIZE;
void *new_attrs = krealloc(data->group.attrs,
new_max_attrs * sizeof(void *),
GFP_KERNEL);
if (!new_attrs)
return -ENOMEM;
data->group.attrs = new_attrs;
data->max_attributes = new_max_attrs;
}
data->group.attrs[data->num_attributes++] = attr;