mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
iio: introduce struct iio_scan_type
This gives the channel scan_type a named type so that it can be used to simplify code in later commits. Signed-off-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20240530-iio-add-support-for-multiple-scan-types-v3-1-cbc4acea2cfa@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
committed by
Jonathan Cameron
parent
737413da87
commit
fd7179ece0
@@ -173,6 +173,27 @@ struct iio_event_spec {
|
||||
unsigned long mask_shared_by_all;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct iio_scan_type - specification for channel data format in buffer
|
||||
* @sign: 's' or 'u' to specify signed or unsigned
|
||||
* @realbits: Number of valid bits of data
|
||||
* @storagebits: Realbits + padding
|
||||
* @shift: Shift right by this before masking out realbits.
|
||||
* @repeat: Number of times real/storage bits repeats. When the
|
||||
* repeat element is more than 1, then the type element in
|
||||
* sysfs will show a repeat value. Otherwise, the number
|
||||
* of repetitions is omitted.
|
||||
* @endianness: little or big endian
|
||||
*/
|
||||
struct iio_scan_type {
|
||||
char sign;
|
||||
u8 realbits;
|
||||
u8 storagebits;
|
||||
u8 shift;
|
||||
u8 repeat;
|
||||
enum iio_endian endianness;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct iio_chan_spec - specification of a single channel
|
||||
* @type: What type of measurement is the channel making.
|
||||
@@ -184,17 +205,6 @@ struct iio_event_spec {
|
||||
* @scan_index: Monotonic index to give ordering in scans when read
|
||||
* from a buffer.
|
||||
* @scan_type: struct describing the scan type
|
||||
* @scan_type.sign: 's' or 'u' to specify signed or unsigned
|
||||
* @scan_type.realbits: Number of valid bits of data
|
||||
* @scan_type.storagebits: Realbits + padding
|
||||
* @scan_type.shift: Shift right by this before masking out
|
||||
* realbits.
|
||||
* @scan_type.repeat: Number of times real/storage bits repeats.
|
||||
* When the repeat element is more than 1, then
|
||||
* the type element in sysfs will show a repeat
|
||||
* value. Otherwise, the number of repetitions
|
||||
* is omitted.
|
||||
* @scan_type.endianness: little or big endian
|
||||
* @info_mask_separate: What information is to be exported that is specific to
|
||||
* this channel.
|
||||
* @info_mask_separate_available: What availability information is to be
|
||||
@@ -245,14 +255,7 @@ struct iio_chan_spec {
|
||||
int channel2;
|
||||
unsigned long address;
|
||||
int scan_index;
|
||||
struct {
|
||||
char sign;
|
||||
u8 realbits;
|
||||
u8 storagebits;
|
||||
u8 shift;
|
||||
u8 repeat;
|
||||
enum iio_endian endianness;
|
||||
} scan_type;
|
||||
struct iio_scan_type scan_type;
|
||||
long info_mask_separate;
|
||||
long info_mask_separate_available;
|
||||
long info_mask_shared_by_type;
|
||||
|
||||
Reference in New Issue
Block a user