Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelv...
[pandora-kernel.git] / drivers / staging / iio / sysfs.h
index 491c904..ee91a95 100644 (file)
@@ -85,6 +85,10 @@ struct iio_const_attr {
        = { .string = _string,                                          \
            .dev_attr = __ATTR(_name, S_IRUGO, iio_read_const_attr, NULL)}
 
+#define IIO_CONST_ATTR_NAMED(_vname, _name, _string)                   \
+       struct iio_const_attr iio_const_attr_##_vname                   \
+       = { .string = _string,                                          \
+           .dev_attr = __ATTR(_name, S_IRUGO, iio_read_const_attr, NULL)}
 /* Generic attributes of onetype or another */
 
 /**
@@ -260,6 +264,14 @@ struct iio_const_attr {
 #define IIO_EV_MOD_X                   0
 #define IIO_EV_MOD_Y                   1
 #define IIO_EV_MOD_Z                   2
+#define IIO_EV_MOD_X_AND_Y             3
+#define IIO_EV_MOD_X_ANX_Z             4
+#define IIO_EV_MOD_Y_AND_Z             5
+#define IIO_EV_MOD_X_AND_Y_AND_Z       6
+#define IIO_EV_MOD_X_OR_Y              7
+#define IIO_EV_MOD_X_OR_Z              8
+#define IIO_EV_MOD_Y_OR_Z              9
+#define IIO_EV_MOD_X_OR_Y_OR_Z         10
 
 #define IIO_EV_TYPE_THRESH             0
 #define IIO_EV_TYPE_MAG                        1
@@ -281,14 +293,9 @@ struct iio_const_attr {
 #define IIO_UNMOD_EVENT_CODE(channelclass, number, type, direction)    \
        IIO_EVENT_CODE(channelclass, 0, number, 0, type, direction)
 
-#define IIO_EVENT_CODE_DATA_RDY                100
-#define IIO_EVENT_CODE_RING_BASE       200
-#define IIO_EVENT_CODE_ACCEL_BASE      300
-#define IIO_EVENT_CODE_GYRO_BASE       400
-#define IIO_EVENT_CODE_MISC_BASE       600
-#define IIO_EVENT_CODE_LIGHT_BASE      700
 
-#define IIO_EVENT_CODE_DEVICE_SPECIFIC 1000
+#define IIO_BUFFER_EVENT_CODE(code)            \
+       (IIO_EV_CLASS_BUFFER | (code << 8))
 
 /**
  * IIO_EVENT_ATTR_RING_50_FULL - ring buffer event to indicate 50% full
@@ -320,8 +327,8 @@ struct iio_const_attr {
 #define IIO_EVENT_ATTR_RING_75_FULL_SH(_evlist, _show, _store, _mask)  \
        IIO_EVENT_ATTR_SH(ring_75_full, _evlist, _show, _store, _mask)
 
-#define IIO_EVENT_CODE_RING_50_FULL    IIO_EVENT_CODE_RING_BASE
-#define IIO_EVENT_CODE_RING_75_FULL    (IIO_EVENT_CODE_RING_BASE + 1)
-#define IIO_EVENT_CODE_RING_100_FULL   (IIO_EVENT_CODE_RING_BASE + 2)
+#define IIO_EVENT_CODE_RING_50_FULL    IIO_BUFFER_EVENT_CODE(0)
+#define IIO_EVENT_CODE_RING_75_FULL    IIO_BUFFER_EVENT_CODE(1)
+#define IIO_EVENT_CODE_RING_100_FULL   IIO_BUFFER_EVENT_CODE(2)
 
 #endif /* _INDUSTRIAL_IO_SYSFS_H_ */