summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/iio_hwmon.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2014-09-27 08:31:12 -0700
committerGuenter Roeck <linux@roeck-us.net>2014-11-30 20:13:13 -0800
commit61bb53bcbdd86e0c25fbf517c48a38f66c6fc0bc (patch)
tree8749dcb7dba9ead3d10ca40cf43b684e1a97bbdd /drivers/hwmon/iio_hwmon.c
parent77aa3585805920d871e09b9a60d9635e51b03d21 (diff)
downloadlinux-61bb53bcbdd86e0c25fbf517c48a38f66c6fc0bc.tar.gz
linux-61bb53bcbdd86e0c25fbf517c48a38f66c6fc0bc.tar.bz2
linux-61bb53bcbdd86e0c25fbf517c48a38f66c6fc0bc.zip
hwmon: (iio_hwmon) Add support for humidity sensors
The iio subsystem supports humidity sensors, so it makes sense to support it in the iio-hwmon bridge as well. Cc: Jonathan Cameron <jic23@kernel.org> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/iio_hwmon.c')
-rw-r--r--drivers/hwmon/iio_hwmon.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/hwmon/iio_hwmon.c b/drivers/hwmon/iio_hwmon.c
index 14c82daab019..980175628563 100644
--- a/drivers/hwmon/iio_hwmon.c
+++ b/drivers/hwmon/iio_hwmon.c
@@ -63,7 +63,7 @@ static int iio_hwmon_probe(struct platform_device *pdev)
struct iio_hwmon_state *st;
struct sensor_device_attribute *a;
int ret, i;
- int in_i = 1, temp_i = 1, curr_i = 1;
+ int in_i = 1, temp_i = 1, curr_i = 1, humidity_i = 1;
enum iio_chan_type type;
struct iio_channel *channels;
const char *name = "iio_hwmon";
@@ -123,6 +123,11 @@ static int iio_hwmon_probe(struct platform_device *pdev)
"curr%d_input",
curr_i++);
break;
+ case IIO_HUMIDITYRELATIVE:
+ a->dev_attr.attr.name = kasprintf(GFP_KERNEL,
+ "humidity%d_input",
+ humidity_i++);
+ break;
default:
ret = -EINVAL;
goto error_release_channels;