aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/iio/ring_generic.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/staging/iio/ring_generic.h b/drivers/staging/iio/ring_generic.h
index 6975722616f..8ecb1895cec 100644
--- a/drivers/staging/iio/ring_generic.h
+++ b/drivers/staging/iio/ring_generic.h
@@ -292,6 +292,23 @@ ssize_t iio_scan_el_ts_show(struct device *dev, struct device_attribute *attr,
292 **/ 292 **/
293#define IIO_CONST_ATTR_SCAN_EL_TYPE(_name, _sign, _bits, _storagebits) \ 293#define IIO_CONST_ATTR_SCAN_EL_TYPE(_name, _sign, _bits, _storagebits) \
294 IIO_CONST_ATTR(_name##_type, #_sign#_bits"/"#_storagebits); 294 IIO_CONST_ATTR(_name##_type, #_sign#_bits"/"#_storagebits);
295
296/**
297 * IIO_CONST_ATTR_SCAN_EL_TYPE_WITH_SHIFT - attr to specify the data format of a scan el
298 * @name: the scan el name (may be more general and cover a set of scan elements
299 * @_sign: either s or u for signed or unsigned
300 * @_bits: number of actual bits occuplied by the value
301 * @_storagebits: number of bits _bits is padded to when read out of buffer
302 * @_shiftbits: number of bits _shiftbits the result must be shifted
303 **/
304#define IIO_CONST_ATTR_SCAN_EL_TYPE_WITH_SHIFT(_name, _sign, _bits, \
305 _storagebits, _shiftbits) \
306 IIO_CONST_ATTR(_name##_type, #_sign#_bits"/"#_storagebits \
307 ">>"#_shiftbits);
308
309#define IIO_SCAN_EL_TYPE_SIGNED 's'
310#define IIO_SCAN_EL_TYPE_UNSIGNED 'u'
311
295/* 312/*
296 * These are mainly provided to allow for a change of implementation if a device 313 * These are mainly provided to allow for a change of implementation if a device
297 * has a large number of scan elements 314 * has a large number of scan elements