mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
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 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJVaQlBAAoJEMsfJm/On5mBLw8P/RWUBhL04n4dy7bw8Ap78XOo vJBBK/viNonECxShAdyG2dP+/qgNI/1Zbd3ApaDuJKiqV36WdL7wb2/D+wDWxkZG MRnxpQ4E67EifbdXZ0+xbIWv/VoHv7JafFS7E7t7GeXih7KophDj3xuMBcR85/Dt 89TA0+RyX4Cyk7WagXXa+7ybpYEa8DbsHRdPGxdddNh3+BC87/LUoOVgIshN/pv2 3bYYBo7de7jxR/Avf8G7VETxS/MrG6RTeZ6lM0QSAj4uRDPYR/dtkrVOpE6ZcGmh +XjWJE0YWDFh4OEPheF2aXBhsZuakI055vLXrFJDomzJGdzIUnttZo2+IB9I/lI+ fzZslRtTdecF8ee9XJSOocNnLhV5WtNEg7zYbk7titSnp5zoNxM6fvHC5HkK+uTb BgEtjgs+l8+BLXKAp7y92YUSvLt/esGbBr+AnscvRbcG//41FV1bY3zG3Xxh4tCV cjg9WokSkIvvbxYqA6x4qr7WHTtruTxHtHkc9BKRzIjzrISm/HFKbBS80gQ6RGPm YLK5eAMYuDCaRtsaPJAPx3Sqmzl+fCy2MAmcPz36OTqGhps/YtVmeQpCAqIuP2eu 8v/5rJU7rjs+OjJxPYeH630C7WeQK7Q09xWEYNoXMl2cqAjGJVka/tJFDF1Ru4+M JdiRx1tia5AXu1aThx1h =cHeh -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
30a5f11896
5 changed files with 15 additions and 2 deletions
|
@ -20,7 +20,7 @@ Supported chips:
|
|||
Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp432.html
|
||||
* Texas Instruments 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
|
||||
|
||||
Authors:
|
||||
|
|
|
@ -439,6 +439,7 @@ nct6683_create_attr_group(struct device *dev, struct sensor_template_group *tg,
|
|||
(*t)->dev_attr.attr.name, tg->base + i);
|
||||
if ((*t)->s2) {
|
||||
a2 = &su->u.a2;
|
||||
sysfs_attr_init(&a2->dev_attr.attr);
|
||||
a2->dev_attr.attr.name = su->name;
|
||||
a2->nr = (*t)->u.s.nr + i;
|
||||
a2->index = (*t)->u.s.index;
|
||||
|
@ -449,6 +450,7 @@ nct6683_create_attr_group(struct device *dev, struct sensor_template_group *tg,
|
|||
*attrs = &a2->dev_attr.attr;
|
||||
} else {
|
||||
a = &su->u.a1;
|
||||
sysfs_attr_init(&a->dev_attr.attr);
|
||||
a->dev_attr.attr.name = su->name;
|
||||
a->index = (*t)->u.index + i;
|
||||
a->dev_attr.attr.mode =
|
||||
|
|
|
@ -995,6 +995,7 @@ nct6775_create_attr_group(struct device *dev, struct sensor_template_group *tg,
|
|||
(*t)->dev_attr.attr.name, tg->base + i);
|
||||
if ((*t)->s2) {
|
||||
a2 = &su->u.a2;
|
||||
sysfs_attr_init(&a2->dev_attr.attr);
|
||||
a2->dev_attr.attr.name = su->name;
|
||||
a2->nr = (*t)->u.s.nr + i;
|
||||
a2->index = (*t)->u.s.index;
|
||||
|
@ -1005,6 +1006,7 @@ nct6775_create_attr_group(struct device *dev, struct sensor_template_group *tg,
|
|||
*attrs = &a2->dev_attr.attr;
|
||||
} else {
|
||||
a = &su->u.a1;
|
||||
sysfs_attr_init(&a->dev_attr.attr);
|
||||
a->dev_attr.attr.name = su->name;
|
||||
a->index = (*t)->u.index + i;
|
||||
a->dev_attr.attr.mode =
|
||||
|
|
|
@ -239,8 +239,10 @@ static struct ntc_thermistor_platform_data *
|
|||
ntc_thermistor_parse_dt(struct platform_device *pdev)
|
||||
{
|
||||
struct iio_channel *chan;
|
||||
enum iio_chan_type type;
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
struct ntc_thermistor_platform_data *pdata;
|
||||
int ret;
|
||||
|
||||
if (!np)
|
||||
return NULL;
|
||||
|
@ -253,6 +255,13 @@ ntc_thermistor_parse_dt(struct platform_device *pdev)
|
|||
if (IS_ERR(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))
|
||||
return ERR_PTR(-ENODEV);
|
||||
if (of_property_read_u32(np, "pullup-ohm", &pdata->pullup_ohm))
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include <linux/sysfs.h>
|
||||
|
||||
/* 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 };
|
||||
|
||||
enum chips { tmp401, tmp411, tmp431, tmp432, tmp435 };
|
||||
|
|
Loading…
Reference in a new issue