staging:iio:add adaptive event types and missing extract_type macro.
authorJonathan Cameron <jic23@cam.ac.uk>
Fri, 2 Sep 2011 16:14:44 +0000 (17:14 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 6 Sep 2011 23:02:03 +0000 (16:02 -0700)
I'm not entirely sure this is the right way to go. Suggestions of other
options welcome!

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/industrialio-core.c
drivers/staging/iio/sysfs.h

index 44a5be56208c87b02e02001b1493163b34c8757e..83e55b1d6400b43091becc5c7895954f3ac9175f 100644 (file)
@@ -700,7 +700,9 @@ static void iio_device_unregister_sysfs(struct iio_dev *dev_info)
 static const char * const iio_ev_type_text[] = {
        [IIO_EV_TYPE_THRESH] = "thresh",
        [IIO_EV_TYPE_MAG] = "mag",
-       [IIO_EV_TYPE_ROC] = "roc"
+       [IIO_EV_TYPE_ROC] = "roc",
+       [IIO_EV_TYPE_THRESH_ADAPTIVE] = "thresh_adaptive",
+       [IIO_EV_TYPE_MAG_ADAPTIVE] = "mag_adaptive",
 };
 
 static const char * const iio_ev_dir_text[] = {
index 9224f306fba4ec9a578eac095d3910f4570b2aef..3388b8c48a43667be84f481bfe5820a8e02284ea 100644 (file)
@@ -118,6 +118,8 @@ enum iio_event_type {
        IIO_EV_TYPE_THRESH,
        IIO_EV_TYPE_MAG,
        IIO_EV_TYPE_ROC,
+       IIO_EV_TYPE_THRESH_ADAPTIVE,
+       IIO_EV_TYPE_MAG_ADAPTIVE,
 };
 
 enum iio_event_direction {
@@ -142,6 +144,7 @@ enum iio_event_direction {
 #define IIO_UNMOD_EVENT_CODE(channelclass, number, type, direction)    \
        IIO_EVENT_CODE(channelclass, 0, direction, type, number, 0, 0)
 
+#define IIO_EVENT_CODE_EXTRACT_TYPE(mask) ((mask >> 56) & 0xFF)
 #define IIO_EVENT_CODE_EXTRACT_DIR(mask) ((mask >> 48) & 0xFF)
 
 /* Event code number extraction depends on which type of event we have.