Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: iio: ring_generic: provide IIO_CONST_ATTR_SCAN_EL_TYPE_WITH_SHIFT

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Michael Hennerich and committed by
Greg Kroah-Hartman
e968d095 3ba2e493

+17
+17
drivers/staging/iio/ring_generic.h
··· 292 292 **/ 293 293 #define IIO_CONST_ATTR_SCAN_EL_TYPE(_name, _sign, _bits, _storagebits) \ 294 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 313 * These are mainly provided to allow for a change of implementation if a device 297 314 * has a large number of scan elements