@@ -172,6 +172,27 @@ struct iio_event_spec {
172
172
unsigned long mask_shared_by_all ;
173
173
};
174
174
175
+ /**
176
+ * struct iio_scan_type - specification for channel data format in buffer
177
+ * @sign: 's' or 'u' to specify signed or unsigned
178
+ * @realbits: Number of valid bits of data
179
+ * @storagebits: Realbits + padding
180
+ * @shift: Shift right by this before masking out realbits.
181
+ * @repeat: Number of times real/storage bits repeats. When the
182
+ * repeat element is more than 1, then the type element in
183
+ * sysfs will show a repeat value. Otherwise, the number
184
+ * of repetitions is omitted.
185
+ * @endianness: little or big endian
186
+ */
187
+ struct iio_scan_type {
188
+ char sign ;
189
+ u8 realbits ;
190
+ u8 storagebits ;
191
+ u8 shift ;
192
+ u8 repeat ;
193
+ enum iio_endian endianness ;
194
+ };
195
+
175
196
/**
176
197
* struct iio_chan_spec - specification of a single channel
177
198
* @type: What type of measurement is the channel making.
@@ -183,17 +204,6 @@ struct iio_event_spec {
183
204
* @scan_index: Monotonic index to give ordering in scans when read
184
205
* from a buffer.
185
206
* @scan_type: struct describing the scan type
186
- * @scan_type.sign: 's' or 'u' to specify signed or unsigned
187
- * @scan_type.realbits: Number of valid bits of data
188
- * @scan_type.storagebits: Realbits + padding
189
- * @scan_type.shift: Shift right by this before masking out
190
- * realbits.
191
- * @scan_type.repeat: Number of times real/storage bits repeats.
192
- * When the repeat element is more than 1, then
193
- * the type element in sysfs will show a repeat
194
- * value. Otherwise, the number of repetitions
195
- * is omitted.
196
- * @scan_type.endianness: little or big endian
197
207
* @info_mask_separate: What information is to be exported that is specific to
198
208
* this channel.
199
209
* @info_mask_separate_available: What availability information is to be
@@ -241,14 +251,7 @@ struct iio_chan_spec {
241
251
int channel2 ;
242
252
unsigned long address ;
243
253
int scan_index ;
244
- struct {
245
- char sign ;
246
- u8 realbits ;
247
- u8 storagebits ;
248
- u8 shift ;
249
- u8 repeat ;
250
- enum iio_endian endianness ;
251
- } scan_type ;
254
+ struct iio_scan_type scan_type ;
252
255
long info_mask_separate ;
253
256
long info_mask_separate_available ;
254
257
long info_mask_shared_by_type ;
0 commit comments