|
@@ -150,7 +150,16 @@ static ssize_t iio_show_fixed_type(struct device *dev,
|
|
type = IIO_BE;
|
|
type = IIO_BE;
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
- return sprintf(buf, "%s:%c%d/%d>>%u\n",
|
|
|
|
|
|
+ if (this_attr->c->scan_type.repeat > 1)
|
|
|
|
+ return sprintf(buf, "%s:%c%d/%dX%d>>%u\n",
|
|
|
|
+ iio_endian_prefix[type],
|
|
|
|
+ this_attr->c->scan_type.sign,
|
|
|
|
+ this_attr->c->scan_type.realbits,
|
|
|
|
+ this_attr->c->scan_type.storagebits,
|
|
|
|
+ this_attr->c->scan_type.repeat,
|
|
|
|
+ this_attr->c->scan_type.shift);
|
|
|
|
+ else
|
|
|
|
+ return sprintf(buf, "%s:%c%d/%d>>%u\n",
|
|
iio_endian_prefix[type],
|
|
iio_endian_prefix[type],
|
|
this_attr->c->scan_type.sign,
|
|
this_attr->c->scan_type.sign,
|
|
this_attr->c->scan_type.realbits,
|
|
this_attr->c->scan_type.realbits,
|
|
@@ -475,14 +484,22 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev,
|
|
for_each_set_bit(i, mask,
|
|
for_each_set_bit(i, mask,
|
|
indio_dev->masklength) {
|
|
indio_dev->masklength) {
|
|
ch = iio_find_channel_from_si(indio_dev, i);
|
|
ch = iio_find_channel_from_si(indio_dev, i);
|
|
- length = ch->scan_type.storagebits / 8;
|
|
|
|
|
|
+ if (ch->scan_type.repeat > 1)
|
|
|
|
+ length = ch->scan_type.storagebits / 8 *
|
|
|
|
+ ch->scan_type.repeat;
|
|
|
|
+ else
|
|
|
|
+ length = ch->scan_type.storagebits / 8;
|
|
bytes = ALIGN(bytes, length);
|
|
bytes = ALIGN(bytes, length);
|
|
bytes += length;
|
|
bytes += length;
|
|
}
|
|
}
|
|
if (timestamp) {
|
|
if (timestamp) {
|
|
ch = iio_find_channel_from_si(indio_dev,
|
|
ch = iio_find_channel_from_si(indio_dev,
|
|
indio_dev->scan_index_timestamp);
|
|
indio_dev->scan_index_timestamp);
|
|
- length = ch->scan_type.storagebits / 8;
|
|
|
|
|
|
+ if (ch->scan_type.repeat > 1)
|
|
|
|
+ length = ch->scan_type.storagebits / 8 *
|
|
|
|
+ ch->scan_type.repeat;
|
|
|
|
+ else
|
|
|
|
+ length = ch->scan_type.storagebits / 8;
|
|
bytes = ALIGN(bytes, length);
|
|
bytes = ALIGN(bytes, length);
|
|
bytes += length;
|
|
bytes += length;
|
|
}
|
|
}
|
|
@@ -959,7 +976,11 @@ static int iio_buffer_update_demux(struct iio_dev *indio_dev,
|
|
indio_dev->masklength,
|
|
indio_dev->masklength,
|
|
in_ind + 1);
|
|
in_ind + 1);
|
|
ch = iio_find_channel_from_si(indio_dev, in_ind);
|
|
ch = iio_find_channel_from_si(indio_dev, in_ind);
|
|
- length = ch->scan_type.storagebits/8;
|
|
|
|
|
|
+ if (ch->scan_type.repeat > 1)
|
|
|
|
+ length = ch->scan_type.storagebits / 8 *
|
|
|
|
+ ch->scan_type.repeat;
|
|
|
|
+ else
|
|
|
|
+ length = ch->scan_type.storagebits / 8;
|
|
/* Make sure we are aligned */
|
|
/* Make sure we are aligned */
|
|
in_loc += length;
|
|
in_loc += length;
|
|
if (in_loc % length)
|
|
if (in_loc % length)
|
|
@@ -971,7 +992,11 @@ static int iio_buffer_update_demux(struct iio_dev *indio_dev,
|
|
goto error_clear_mux_table;
|
|
goto error_clear_mux_table;
|
|
}
|
|
}
|
|
ch = iio_find_channel_from_si(indio_dev, in_ind);
|
|
ch = iio_find_channel_from_si(indio_dev, in_ind);
|
|
- length = ch->scan_type.storagebits/8;
|
|
|
|
|
|
+ if (ch->scan_type.repeat > 1)
|
|
|
|
+ length = ch->scan_type.storagebits / 8 *
|
|
|
|
+ ch->scan_type.repeat;
|
|
|
|
+ else
|
|
|
|
+ length = ch->scan_type.storagebits / 8;
|
|
if (out_loc % length)
|
|
if (out_loc % length)
|
|
out_loc += length - out_loc % length;
|
|
out_loc += length - out_loc % length;
|
|
if (in_loc % length)
|
|
if (in_loc % length)
|
|
@@ -992,7 +1017,11 @@ static int iio_buffer_update_demux(struct iio_dev *indio_dev,
|
|
}
|
|
}
|
|
ch = iio_find_channel_from_si(indio_dev,
|
|
ch = iio_find_channel_from_si(indio_dev,
|
|
indio_dev->scan_index_timestamp);
|
|
indio_dev->scan_index_timestamp);
|
|
- length = ch->scan_type.storagebits/8;
|
|
|
|
|
|
+ if (ch->scan_type.repeat > 1)
|
|
|
|
+ length = ch->scan_type.storagebits / 8 *
|
|
|
|
+ ch->scan_type.repeat;
|
|
|
|
+ else
|
|
|
|
+ length = ch->scan_type.storagebits / 8;
|
|
if (out_loc % length)
|
|
if (out_loc % length)
|
|
out_loc += length - out_loc % length;
|
|
out_loc += length - out_loc % length;
|
|
if (in_loc % length)
|
|
if (in_loc % length)
|