diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-05-31 14:24:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-05-31 14:24:49 -0400 |
commit | 30a5f11896a26a345e934e18e9a62c714bc1ceed (patch) | |
tree | fbc7dcfbbe31f1a6e793771f329f687dbba2812a | |
parent | aaa20fc23341be3df7b17810e330f12244abcf29 (diff) | |
parent | c7bd6dc320b85445b6b36a0aff41f929210027c7 (diff) |
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
-rw-r--r-- | Documentation/hwmon/tmp401 | 2 | ||||
-rw-r--r-- | drivers/hwmon/nct6683.c | 2 | ||||
-rw-r--r-- | drivers/hwmon/nct6775.c | 2 | ||||
-rw-r--r-- | drivers/hwmon/ntc_thermistor.c | 9 | ||||
-rw-r--r-- | drivers/hwmon/tmp401.c | 2 |
5 files changed, 15 insertions, 2 deletions
diff --git a/Documentation/hwmon/tmp401 b/Documentation/hwmon/tmp401 index 8eb88e974055..711f75e189eb 100644 --- a/Documentation/hwmon/tmp401 +++ b/Documentation/hwmon/tmp401 | |||
@@ -20,7 +20,7 @@ Supported chips: | |||
20 | Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp432.html | 20 | Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp432.html |
21 | * Texas Instruments TMP435 | 21 | * Texas Instruments TMP435 |
22 | Prefix: 'tmp435' | 22 | Prefix: 'tmp435' |
23 | Addresses scanned: I2C 0x37, 0x48 - 0x4f | 23 | Addresses scanned: I2C 0x48 - 0x4f |
24 | Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp435.html | 24 | Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp435.html |
25 | 25 | ||
26 | Authors: | 26 | Authors: |
diff --git a/drivers/hwmon/nct6683.c b/drivers/hwmon/nct6683.c index f3830db02d46..37f01702d081 100644 --- a/drivers/hwmon/nct6683.c +++ b/drivers/hwmon/nct6683.c | |||
@@ -439,6 +439,7 @@ nct6683_create_attr_group(struct device *dev, struct sensor_template_group *tg, | |||
439 | (*t)->dev_attr.attr.name, tg->base + i); | 439 | (*t)->dev_attr.attr.name, tg->base + i); |
440 | if ((*t)->s2) { | 440 | if ((*t)->s2) { |
441 | a2 = &su->u.a2; | 441 | a2 = &su->u.a2; |
442 | sysfs_attr_init(&a2->dev_attr.attr); | ||
442 | a2->dev_attr.attr.name = su->name; | 443 | a2->dev_attr.attr.name = su->name; |
443 | a2->nr = (*t)->u.s.nr + i; | 444 | a2->nr = (*t)->u.s.nr + i; |
444 | a2->index = (*t)->u.s.index; | 445 | a2->index = (*t)->u.s.index; |
@@ -449,6 +450,7 @@ nct6683_create_attr_group(struct device *dev, struct sensor_template_group *tg, | |||
449 | *attrs = &a2->dev_attr.attr; | 450 | *attrs = &a2->dev_attr.attr; |
450 | } else { | 451 | } else { |
451 | a = &su->u.a1; | 452 | a = &su->u.a1; |
453 | sysfs_attr_init(&a->dev_attr.attr); | ||
452 | a->dev_attr.attr.name = su->name; | 454 | a->dev_attr.attr.name = su->name; |
453 | a->index = (*t)->u.index + i; | 455 | a->index = (*t)->u.index + i; |
454 | a->dev_attr.attr.mode = | 456 | a->dev_attr.attr.mode = |
diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c index 4fcb48103299..bd1c99deac71 100644 --- a/drivers/hwmon/nct6775.c +++ b/drivers/hwmon/nct6775.c | |||
@@ -995,6 +995,7 @@ nct6775_create_attr_group(struct device *dev, struct sensor_template_group *tg, | |||
995 | (*t)->dev_attr.attr.name, tg->base + i); | 995 | (*t)->dev_attr.attr.name, tg->base + i); |
996 | if ((*t)->s2) { | 996 | if ((*t)->s2) { |
997 | a2 = &su->u.a2; | 997 | a2 = &su->u.a2; |
998 | sysfs_attr_init(&a2->dev_attr.attr); | ||
998 | a2->dev_attr.attr.name = su->name; | 999 | a2->dev_attr.attr.name = su->name; |
999 | a2->nr = (*t)->u.s.nr + i; | 1000 | a2->nr = (*t)->u.s.nr + i; |
1000 | a2->index = (*t)->u.s.index; | 1001 | a2->index = (*t)->u.s.index; |
@@ -1005,6 +1006,7 @@ nct6775_create_attr_group(struct device *dev, struct sensor_template_group *tg, | |||
1005 | *attrs = &a2->dev_attr.attr; | 1006 | *attrs = &a2->dev_attr.attr; |
1006 | } else { | 1007 | } else { |
1007 | a = &su->u.a1; | 1008 | a = &su->u.a1; |
1009 | sysfs_attr_init(&a->dev_attr.attr); | ||
1008 | a->dev_attr.attr.name = su->name; | 1010 | a->dev_attr.attr.name = su->name; |
1009 | a->index = (*t)->u.index + i; | 1011 | a->index = (*t)->u.index + i; |
1010 | a->dev_attr.attr.mode = | 1012 | a->dev_attr.attr.mode = |
diff --git a/drivers/hwmon/ntc_thermistor.c b/drivers/hwmon/ntc_thermistor.c index 112e4d45e4a0..68800115876b 100644 --- a/drivers/hwmon/ntc_thermistor.c +++ b/drivers/hwmon/ntc_thermistor.c | |||
@@ -239,8 +239,10 @@ static struct ntc_thermistor_platform_data * | |||
239 | ntc_thermistor_parse_dt(struct platform_device *pdev) | 239 | ntc_thermistor_parse_dt(struct platform_device *pdev) |
240 | { | 240 | { |
241 | struct iio_channel *chan; | 241 | struct iio_channel *chan; |
242 | enum iio_chan_type type; | ||
242 | struct device_node *np = pdev->dev.of_node; | 243 | struct device_node *np = pdev->dev.of_node; |
243 | struct ntc_thermistor_platform_data *pdata; | 244 | struct ntc_thermistor_platform_data *pdata; |
245 | int ret; | ||
244 | 246 | ||
245 | if (!np) | 247 | if (!np) |
246 | return NULL; | 248 | return NULL; |
@@ -253,6 +255,13 @@ ntc_thermistor_parse_dt(struct platform_device *pdev) | |||
253 | if (IS_ERR(chan)) | 255 | if (IS_ERR(chan)) |
254 | return ERR_CAST(chan); | 256 | return ERR_CAST(chan); |
255 | 257 | ||
258 | ret = iio_get_channel_type(chan, &type); | ||
259 | if (ret < 0) | ||
260 | return ERR_PTR(ret); | ||
261 | |||
262 | if (type != IIO_VOLTAGE) | ||
263 | return ERR_PTR(-EINVAL); | ||
264 | |||
256 | if (of_property_read_u32(np, "pullup-uv", &pdata->pullup_uv)) | 265 | if (of_property_read_u32(np, "pullup-uv", &pdata->pullup_uv)) |
257 | return ERR_PTR(-ENODEV); | 266 | return ERR_PTR(-ENODEV); |
258 | if (of_property_read_u32(np, "pullup-ohm", &pdata->pullup_ohm)) | 267 | if (of_property_read_u32(np, "pullup-ohm", &pdata->pullup_ohm)) |
diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c index 99664ebc738d..ccf4cffe0ee1 100644 --- a/drivers/hwmon/tmp401.c +++ b/drivers/hwmon/tmp401.c | |||
@@ -44,7 +44,7 @@ | |||
44 | #include <linux/sysfs.h> | 44 | #include <linux/sysfs.h> |
45 | 45 | ||
46 | /* Addresses to scan */ | 46 | /* Addresses to scan */ |
47 | static const unsigned short normal_i2c[] = { 0x37, 0x48, 0x49, 0x4a, 0x4c, 0x4d, | 47 | static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4c, 0x4d, |
48 | 0x4e, 0x4f, I2C_CLIENT_END }; | 48 | 0x4e, 0x4f, I2C_CLIENT_END }; |
49 | 49 | ||
50 | enum chips { tmp401, tmp411, tmp431, tmp432, tmp435 }; | 50 | enum chips { tmp401, tmp411, tmp431, tmp432, tmp435 }; |