Skip to content

Commit

Permalink
hwmon: (iio_hwmon) Add support for humidity sensors
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Guenter Roeck committed Dec 1, 2014
1 parent 77aa358 commit 61bb53b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/hwmon/iio_hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 61bb53b

Please sign in to comment.