All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <guenter.roeck@ericsson.com>
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [PATCH] libsensors: Add support for humidity sensors
Date: Thu, 10 Feb 2011 05:42:56 +0000	[thread overview]
Message-ID: <20110210054256.GA23546@ericsson.com> (raw)

This patch adds support for humidity sensors to libsensors.

--
Index: doc/libsensors-API.txt
=================================--- doc/libsensors-API.txt	(revision 5917)
+++ doc/libsensors-API.txt	(working copy)
@@ -33,6 +33,9 @@
   enum sensors_subfeature_type SENSORS_SUBFEATURE_CURR_CRIT
   enum sensors_subfeature_type SENSORS_SUBFEATURE_CURR_LCRIT_ALARM
   enum sensors_subfeature_type SENSORS_SUBFEATURE_CURR_CRIT_ALARM
+* Added support for humidity sensors
+  enum sensors_feature_type SENSORS_FEATURE_HUMIDITY
+  enum sensors_subfeature_type SENSORS_SUBFEATURE_HUMIDITY_INPUT
 
 0x430	lm-sensors 3.2.0
 * License changed from GPL to LGPL
Index: lib/sensors.h
=================================--- lib/sensors.h	(revision 5917)
+++ lib/sensors.h	(working copy)
@@ -140,6 +140,7 @@
 	SENSORS_FEATURE_POWER		= 0x03,
 	SENSORS_FEATURE_ENERGY		= 0x04,
 	SENSORS_FEATURE_CURR		= 0x05,
+	SENSORS_FEATURE_HUMIDITY	= 0x06,
 	SENSORS_FEATURE_MAX_MAIN,
 	SENSORS_FEATURE_VID		= 0x10,
 	SENSORS_FEATURE_INTRUSION	= 0x11,
@@ -220,6 +221,8 @@
 	SENSORS_SUBFEATURE_CURR_LCRIT_ALARM,
 	SENSORS_SUBFEATURE_CURR_CRIT_ALARM,
 
+	SENSORS_SUBFEATURE_HUMIDITY_INPUT = SENSORS_FEATURE_HUMIDITY << 8,
+
 	SENSORS_SUBFEATURE_VID = SENSORS_FEATURE_VID << 8,
 
 	SENSORS_SUBFEATURE_INTRUSION_ALARM = SENSORS_FEATURE_INTRUSION << 8,
Index: lib/sysfs.c
=================================--- lib/sysfs.c	(revision 5917)
+++ lib/sysfs.c	(working copy)
@@ -158,6 +158,7 @@
 	case SENSORS_SUBFEATURE_IN_INPUT:
 	case SENSORS_SUBFEATURE_TEMP_INPUT:
 	case SENSORS_SUBFEATURE_CURR_INPUT:
+	case SENSORS_SUBFEATURE_HUMIDITY_INPUT:
 		return 1000;
 	case SENSORS_SUBFEATURE_FAN_INPUT:
 		return 1;
@@ -190,6 +191,7 @@
 	case SENSORS_FEATURE_POWER:
 	case SENSORS_FEATURE_ENERGY:
 	case SENSORS_FEATURE_CURR:
+	case SENSORS_FEATURE_HUMIDITY:
 	case SENSORS_FEATURE_INTRUSION:
 		underscore = strchr(sfname, '_');
 		name = strndup(sfname, underscore - sfname);
@@ -306,6 +308,11 @@
 	{ NULL, 0 }
 };
 
+static const struct subfeature_type_match humidity_matches[] = {
+	{ "input", SENSORS_SUBFEATURE_HUMIDITY_INPUT },
+	{ NULL, 0 }
+};
+
 static const struct subfeature_type_match cpu_matches[] = {
 	{ "vid", SENSORS_SUBFEATURE_VID },
 	{ NULL, 0 }
@@ -325,6 +332,7 @@
 	{ "curr%d%c", curr_matches },
 	{ "energy%d%c", energy_matches },
 	{ "intrusion%d%c", intrusion_matches },
+	{ "humidity%d%c", humidity_matches },
 };
 
 /* Return the subfeature type and channel number based on the subfeature
@@ -451,6 +459,7 @@
 		case SENSORS_FEATURE_POWER:
 		case SENSORS_FEATURE_ENERGY:
 		case SENSORS_FEATURE_CURR:
+		case SENSORS_FEATURE_HUMIDITY:
 			nr--;
 			break;
 		default:

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

             reply	other threads:[~2011-02-10  5:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-10  5:42 Guenter Roeck [this message]
2011-02-10  8:20 ` [lm-sensors] [PATCH] libsensors: Add support for humidity Jean Delvare
2011-02-10 12:08 ` Guenter Roeck
2011-02-11 18:04 ` Guenter Roeck
2011-02-12  8:44 ` Jean Delvare

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110210054256.GA23546@ericsson.com \
    --to=guenter.roeck@ericsson.com \
    --cc=lm-sensors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.