Commit 30a5f118 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'hwmon-for-linus-v4.1-rc6' of...

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

Pull hwmon fixes from Guenter Roeck:
 "Some late hwmon patches, all headed for -stable

   - fix sysfs attribute initialization in nct6775 and nct6683 drivers

   - do not attempt to auto-detect tmp435 on I2C address 0x37

   - ensure iio channel is of type IIO_VOLTAGE in ntc_thermistor driver"

* tag 'hwmon-for-linus-v4.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (nct6683) Add missing sysfs attribute initialization
  hwmon: (nct6775) Add missing sysfs attribute initialization
  hwmon: (tmp401) Do not auto-detect chip on I2C address 0x37
  hwmon: (ntc_thermistor) Ensure iio channel is of type IIO_VOLTAGE
parents aaa20fc2 c7bd6dc3
...@@ -20,7 +20,7 @@ Supported chips: ...@@ -20,7 +20,7 @@ Supported chips:
Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp432.html Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp432.html
* Texas Instruments TMP435 * Texas Instruments TMP435
Prefix: 'tmp435' Prefix: 'tmp435'
Addresses scanned: I2C 0x37, 0x48 - 0x4f Addresses scanned: I2C 0x48 - 0x4f
Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp435.html Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp435.html
Authors: Authors:
......
...@@ -439,6 +439,7 @@ nct6683_create_attr_group(struct device *dev, struct sensor_template_group *tg, ...@@ -439,6 +439,7 @@ nct6683_create_attr_group(struct device *dev, struct sensor_template_group *tg,
(*t)->dev_attr.attr.name, tg->base + i); (*t)->dev_attr.attr.name, tg->base + i);
if ((*t)->s2) { if ((*t)->s2) {
a2 = &su->u.a2; a2 = &su->u.a2;
sysfs_attr_init(&a2->dev_attr.attr);
a2->dev_attr.attr.name = su->name; a2->dev_attr.attr.name = su->name;
a2->nr = (*t)->u.s.nr + i; a2->nr = (*t)->u.s.nr + i;
a2->index = (*t)->u.s.index; a2->index = (*t)->u.s.index;
...@@ -449,6 +450,7 @@ nct6683_create_attr_group(struct device *dev, struct sensor_template_group *tg, ...@@ -449,6 +450,7 @@ nct6683_create_attr_group(struct device *dev, struct sensor_template_group *tg,
*attrs = &a2->dev_attr.attr; *attrs = &a2->dev_attr.attr;
} else { } else {
a = &su->u.a1; a = &su->u.a1;
sysfs_attr_init(&a->dev_attr.attr);
a->dev_attr.attr.name = su->name; a->dev_attr.attr.name = su->name;
a->index = (*t)->u.index + i; a->index = (*t)->u.index + i;
a->dev_attr.attr.mode = a->dev_attr.attr.mode =
......
...@@ -995,6 +995,7 @@ nct6775_create_attr_group(struct device *dev, struct sensor_template_group *tg, ...@@ -995,6 +995,7 @@ nct6775_create_attr_group(struct device *dev, struct sensor_template_group *tg,
(*t)->dev_attr.attr.name, tg->base + i); (*t)->dev_attr.attr.name, tg->base + i);
if ((*t)->s2) { if ((*t)->s2) {
a2 = &su->u.a2; a2 = &su->u.a2;
sysfs_attr_init(&a2->dev_attr.attr);
a2->dev_attr.attr.name = su->name; a2->dev_attr.attr.name = su->name;
a2->nr = (*t)->u.s.nr + i; a2->nr = (*t)->u.s.nr + i;
a2->index = (*t)->u.s.index; a2->index = (*t)->u.s.index;
...@@ -1005,6 +1006,7 @@ nct6775_create_attr_group(struct device *dev, struct sensor_template_group *tg, ...@@ -1005,6 +1006,7 @@ nct6775_create_attr_group(struct device *dev, struct sensor_template_group *tg,
*attrs = &a2->dev_attr.attr; *attrs = &a2->dev_attr.attr;
} else { } else {
a = &su->u.a1; a = &su->u.a1;
sysfs_attr_init(&a->dev_attr.attr);
a->dev_attr.attr.name = su->name; a->dev_attr.attr.name = su->name;
a->index = (*t)->u.index + i; a->index = (*t)->u.index + i;
a->dev_attr.attr.mode = a->dev_attr.attr.mode =
......
...@@ -239,8 +239,10 @@ static struct ntc_thermistor_platform_data * ...@@ -239,8 +239,10 @@ static struct ntc_thermistor_platform_data *
ntc_thermistor_parse_dt(struct platform_device *pdev) ntc_thermistor_parse_dt(struct platform_device *pdev)
{ {
struct iio_channel *chan; struct iio_channel *chan;
enum iio_chan_type type;
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
struct ntc_thermistor_platform_data *pdata; struct ntc_thermistor_platform_data *pdata;
int ret;
if (!np) if (!np)
return NULL; return NULL;
...@@ -253,6 +255,13 @@ ntc_thermistor_parse_dt(struct platform_device *pdev) ...@@ -253,6 +255,13 @@ ntc_thermistor_parse_dt(struct platform_device *pdev)
if (IS_ERR(chan)) if (IS_ERR(chan))
return ERR_CAST(chan); return ERR_CAST(chan);
ret = iio_get_channel_type(chan, &type);
if (ret < 0)
return ERR_PTR(ret);
if (type != IIO_VOLTAGE)
return ERR_PTR(-EINVAL);
if (of_property_read_u32(np, "pullup-uv", &pdata->pullup_uv)) if (of_property_read_u32(np, "pullup-uv", &pdata->pullup_uv))
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
if (of_property_read_u32(np, "pullup-ohm", &pdata->pullup_ohm)) if (of_property_read_u32(np, "pullup-ohm", &pdata->pullup_ohm))
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#include <linux/sysfs.h> #include <linux/sysfs.h>
/* Addresses to scan */ /* Addresses to scan */
static const unsigned short normal_i2c[] = { 0x37, 0x48, 0x49, 0x4a, 0x4c, 0x4d, static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4c, 0x4d,
0x4e, 0x4f, I2C_CLIENT_END }; 0x4e, 0x4f, I2C_CLIENT_END };
enum chips { tmp401, tmp411, tmp431, tmp432, tmp435 }; enum chips { tmp401, tmp411, tmp431, tmp432, tmp435 };
......
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