Commit 61bb53bc authored by Guenter Roeck's avatar Guenter Roeck

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: default avatarJonathan Cameron <jic23@kernel.org>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 77aa3585
...@@ -63,7 +63,7 @@ static int iio_hwmon_probe(struct platform_device *pdev) ...@@ -63,7 +63,7 @@ static int iio_hwmon_probe(struct platform_device *pdev)
struct iio_hwmon_state *st; struct iio_hwmon_state *st;
struct sensor_device_attribute *a; struct sensor_device_attribute *a;
int ret, i; 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; enum iio_chan_type type;
struct iio_channel *channels; struct iio_channel *channels;
const char *name = "iio_hwmon"; const char *name = "iio_hwmon";
...@@ -123,6 +123,11 @@ static int iio_hwmon_probe(struct platform_device *pdev) ...@@ -123,6 +123,11 @@ static int iio_hwmon_probe(struct platform_device *pdev)
"curr%d_input", "curr%d_input",
curr_i++); curr_i++);
break; break;
case IIO_HUMIDITYRELATIVE:
a->dev_attr.attr.name = kasprintf(GFP_KERNEL,
"humidity%d_input",
humidity_i++);
break;
default: default:
ret = -EINVAL; ret = -EINVAL;
goto error_release_channels; goto error_release_channels;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment