Skip to contentSkip to conversation

hwmon: (iio_hwmon) Add support for humidity sensors

PATCH In review Guenter Roeck 2 participants 3 messages Oct 5, 2014 – Oct 18, 2014 Hardware monitoring

lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw

PATCH v2 1/1 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 <[email protected]>

---
v2: Only add humidity sensor support for now.

 drivers/hwmon/iio_hwmon.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/hwmon/iio_hwmon.c +6 -1
index 14c82da..9801756 100644
@@ -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;
Signature · 7 lines
1.9.1


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Acked-by on v2 1/1
#1 lore raw
Quoted 5 lines · Guenter Roeck

The iio subsystem supports humidity sensors, so it makes sense to support it in the iio-hwmon bridge as well.

Cc Jonathan Cameron <[email protected]>
Quoted 22 lines

---
v2: Only add humidity sensor support for now.

 drivers/hwmon/iio_hwmon.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/hwmon/iio_hwmon.c +1 -1
index 14c82da..9801756 100644
@@ -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",

drivers/hwmon/iio_hwmon.c static int iio_hwmon_probe(struct platform_device *pdev) · line 133

Quoted 10 lines
drivers/hwmon/iio_hwmon.c +5 -0
 							  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;

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

author maintainer
#2 lore raw
In reply to Guenter Roeck
Quoted 8 lines · Jonathan Cameron
Quoted 5 lines · Guenter Roeck

The iio subsystem supports humidity sensors, so it makes sense to support it in the iio-hwmon bridge as well.

Cc Jonathan Cameron <[email protected]>

Thanks!

Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors