diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2011-05-18 14:41:19 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-05-19 16:14:48 -0700 |
commit | 52615d4783df043605080f7ee65607eb60e3f076 (patch) | |
tree | 80391a0374dce44b4562e41bfeebb989fa02e6c3 /drivers/staging/iio/Documentation/iio_utils.h | |
parent | d96d1337e339521a2bd56dc9d51fef140c1a49ee (diff) | |
download | kernel_samsung_crespo-52615d4783df043605080f7ee65607eb60e3f076.zip kernel_samsung_crespo-52615d4783df043605080f7ee65607eb60e3f076.tar.gz kernel_samsung_crespo-52615d4783df043605080f7ee65607eb60e3f076.tar.bz2 |
staging:iio:Documentation generic_buffer.c update to new abi for buffers + misc fixes
Trivial space before newline fix incorporated.
Additional fixes related to handling of sign extension and shifted
data.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
squash into buffer handling update.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio/Documentation/iio_utils.h')
-rw-r--r-- | drivers/staging/iio/Documentation/iio_utils.h | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/staging/iio/Documentation/iio_utils.h b/drivers/staging/iio/Documentation/iio_utils.h index fd78e4f..150f440 100644 --- a/drivers/staging/iio/Documentation/iio_utils.h +++ b/drivers/staging/iio/Documentation/iio_utils.h @@ -16,25 +16,11 @@ #define IIO_MAX_NAME_LENGTH 30 -#define IIO_EV_CLASS_BUFFER 0 -#define IIO_BUFFER_EVENT_CODE(code) \ - (IIO_EV_CLASS_BUFFER | (code << 8)) - -#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) - - #define FORMAT_SCAN_ELEMENTS_DIR "%s:buffer0/scan_elements" #define FORMAT_TYPE_FILE "%s_type" const char *iio_dir = "/sys/bus/iio/devices/"; -struct iio_event_data { - int id; - __s64 timestamp; -}; - /** * iioutils_break_up_name() - extract generic name from full channel name * @full_name: the full channel name @@ -85,6 +71,7 @@ struct iio_channel_info { unsigned index; unsigned bytes; unsigned bits_used; + unsigned shift; uint64_t mask; unsigned is_signed; unsigned enabled; @@ -103,6 +90,7 @@ struct iio_channel_info { inline int iioutils_get_type(unsigned *is_signed, unsigned *bytes, unsigned *bits_used, + unsigned *shift, uint64_t *mask, const char *device_dir, const char *name, @@ -157,7 +145,8 @@ inline int iioutils_get_type(unsigned *is_signed, goto error_free_filename; } fscanf(sysfsfp, - "%c%u/%u", &signchar, bits_used, &padint); + "%c%u/%u>>%u", &signchar, bits_used, + &padint, shift); *bytes = padint / 8; if (*bits_used == 64) *mask = ~0; @@ -395,6 +384,7 @@ inline int build_channel_array(const char *device_dir, ret = iioutils_get_type(¤t->is_signed, ¤t->bytes, ¤t->bits_used, + ¤t->shift, ¤t->mask, device_dir, current->name, |