aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2014-09-27 11:31:12 -0400
committerGuenter Roeck <linux@roeck-us.net>2014-11-30 23:13:13 -0500
commit61bb53bcbdd86e0c25fbf517c48a38f66c6fc0bc (patch)
tree8749dcb7dba9ead3d10ca40cf43b684e1a97bbdd
parent77aa3585805920d871e09b9a60d9635e51b03d21 (diff)
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>
-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)
63 struct iio_hwmon_state *st; 63 struct iio_hwmon_state *st;
64 struct sensor_device_attribute *a; 64 struct sensor_device_attribute *a;
65 int ret, i; 65 int ret, i;
66 int in_i = 1, temp_i = 1, curr_i = 1; 66 int in_i = 1, temp_i = 1, curr_i = 1, humidity_i = 1;
67 enum iio_chan_type type; 67 enum iio_chan_type type;
68 struct iio_channel *channels; 68 struct iio_channel *channels;
69 const char *name = "iio_hwmon"; 69 const char *name = "iio_hwmon";
@@ -123,6 +123,11 @@ static int iio_hwmon_probe(struct platform_device *pdev)
123 "curr%d_input", 123 "curr%d_input",
124 curr_i++); 124 curr_i++);
125 break; 125 break;
126 case IIO_HUMIDITYRELATIVE:
127 a->dev_attr.attr.name = kasprintf(GFP_KERNEL,
128 "humidity%d_input",
129 humidity_i++);
130 break;
126 default: 131 default:
127 ret = -EINVAL; 132 ret = -EINVAL;
128 goto error_release_channels; 133 goto error_release_channels;