summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/sysfs.h
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@cam.ac.uk>2011-09-02 17:14:45 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-09-06 16:02:03 -0700
commitade7ef7ba3bf888b90269f8ca864841b2cd9803f (patch)
tree1713b66c05abbbb1ee023a72e4e1f5e591bb9762 /drivers/staging/iio/sysfs.h
parent8ce7375be7036d6e536b6341ec83e5db849cda6e (diff)
staging:iio: Differential channel handling - use explicit flag rather than types.
Straight forward change in the core, but required some drivers to not use the IIO_CHAN macro as that doesn't allow setting this bit (and is going away anyway). Hence the churn. Tested on max1363 with a couple of supported parts. V2: differential bit in code got 7 bits and direction 1. Reversed that. Issue spotted by Michael - thanks! Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <Michael.Hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio/sysfs.h')
-rw-r--r--drivers/staging/iio/sysfs.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/staging/iio/sysfs.h b/drivers/staging/iio/sysfs.h
index 3388b8c48a43..12152461ca53 100644
--- a/drivers/staging/iio/sysfs.h
+++ b/drivers/staging/iio/sysfs.h
@@ -128,9 +128,10 @@ enum iio_event_direction {
IIO_EV_DIR_FALLING,
};
-#define IIO_EVENT_CODE(chan_type, modifier, direction, \
+#define IIO_EVENT_CODE(chan_type, diff, modifier, direction, \
type, chan, chan1, chan2) \
- (((u64)type << 56) | ((u64)direction << 48) | ((u64)modifier << 40) | \
+ (((u64)type << 56) | ((u64)diff << 55) | \
+ ((u64)direction << 48) | ((u64)modifier << 40) | \
((u64)chan_type << 32) | (chan2 << 16) | chan1 | chan)
#define IIO_EV_DIR_MAX 4
@@ -139,13 +140,13 @@ enum iio_event_direction {
#define IIO_MOD_EVENT_CODE(channelclass, number, modifier, \
type, direction) \
- IIO_EVENT_CODE(channelclass, modifier, direction, type, number, 0, 0)
+ IIO_EVENT_CODE(channelclass, 0, modifier, direction, type, number, 0, 0)
#define IIO_UNMOD_EVENT_CODE(channelclass, number, type, direction) \
- IIO_EVENT_CODE(channelclass, 0, direction, type, number, 0, 0)
+ IIO_EVENT_CODE(channelclass, 0, 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)
+#define IIO_EVENT_CODE_EXTRACT_DIR(mask) ((mask >> 48) & 0xCF)
/* Event code number extraction depends on which type of event we have.
* Perhaps review this function in the future*/