diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2012-11-13 13:28:00 (GMT) |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2012-11-19 22:22:11 (GMT) |
commit | aacff892cbd5c6b1904a3906219548a65018d750 (patch) | |
tree | 07e8ee424e67ada771e1b5f46be75425a9cdf241 /drivers/staging/iio/accel | |
parent | a458c55c107c5e467ab5b7e471f77ec5868afcb9 (diff) | |
download | linux-aacff892cbd5c6b1904a3906219548a65018d750.tar.xz |
staging:iio:adis: Preallocate transfer message
Currently the driver reads out all sample registers of the device and throws
away those which it does not need. Furthermore the SPI message is constructed
each time the trigger handler is run, although it will be the same each time.
This patch preallocates and pre-constructs the SPI message in the
"update_scan_mode" callback. Only those register which are actually selected for
sampling are included in the message. The patch also gets rid of the conversion
of the sample data from big endian to the native endianness and instead marks
the channel as big endian in its scan type. This allows to directly push the
SPI transfer buffer to the IIO buffer without the need to post-process it.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging/iio/accel')
-rw-r--r-- | drivers/staging/iio/accel/adis16201_core.c | 1 | ||||
-rw-r--r-- | drivers/staging/iio/accel/adis16203_core.c | 1 | ||||
-rw-r--r-- | drivers/staging/iio/accel/adis16204_core.c | 1 | ||||
-rw-r--r-- | drivers/staging/iio/accel/adis16209_core.c | 1 | ||||
-rw-r--r-- | drivers/staging/iio/accel/adis16240_core.c | 1 |
5 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/iio/accel/adis16201_core.c b/drivers/staging/iio/accel/adis16201_core.c index 0121501..833dd6b 100644 --- a/drivers/staging/iio/accel/adis16201_core.c +++ b/drivers/staging/iio/accel/adis16201_core.c @@ -148,6 +148,7 @@ static const struct iio_chan_spec adis16201_channels[] = { static const struct iio_info adis16201_info = { .read_raw = &adis16201_read_raw, .write_raw = &adis16201_write_raw, + .update_scan_mode = adis_update_scan_mode, .driver_module = THIS_MODULE, }; diff --git a/drivers/staging/iio/accel/adis16203_core.c b/drivers/staging/iio/accel/adis16203_core.c index 326b106..f631e57 100644 --- a/drivers/staging/iio/accel/adis16203_core.c +++ b/drivers/staging/iio/accel/adis16203_core.c @@ -112,6 +112,7 @@ static const struct iio_chan_spec adis16203_channels[] = { static const struct iio_info adis16203_info = { .read_raw = &adis16203_read_raw, .write_raw = &adis16203_write_raw, + .update_scan_mode = adis_update_scan_mode, .driver_module = THIS_MODULE, }; diff --git a/drivers/staging/iio/accel/adis16204_core.c b/drivers/staging/iio/accel/adis16204_core.c index 4f69ead..dbec841 100644 --- a/drivers/staging/iio/accel/adis16204_core.c +++ b/drivers/staging/iio/accel/adis16204_core.c @@ -153,6 +153,7 @@ static const struct iio_chan_spec adis16204_channels[] = { static const struct iio_info adis16204_info = { .read_raw = &adis16204_read_raw, .write_raw = &adis16204_write_raw, + .update_scan_mode = adis_update_scan_mode, .driver_module = THIS_MODULE, }; diff --git a/drivers/staging/iio/accel/adis16209_core.c b/drivers/staging/iio/accel/adis16209_core.c index e203e96..f9f9d58 100644 --- a/drivers/staging/iio/accel/adis16209_core.c +++ b/drivers/staging/iio/accel/adis16209_core.c @@ -146,6 +146,7 @@ static const struct iio_chan_spec adis16209_channels[] = { static const struct iio_info adis16209_info = { .read_raw = &adis16209_read_raw, .write_raw = &adis16209_write_raw, + .update_scan_mode = adis_update_scan_mode, .driver_module = THIS_MODULE, }; diff --git a/drivers/staging/iio/accel/adis16240_core.c b/drivers/staging/iio/accel/adis16240_core.c index 019a31e..3d1a8a9 100644 --- a/drivers/staging/iio/accel/adis16240_core.c +++ b/drivers/staging/iio/accel/adis16240_core.c @@ -202,6 +202,7 @@ static const struct iio_info adis16240_info = { .attrs = &adis16240_attribute_group, .read_raw = &adis16240_read_raw, .write_raw = &adis16240_write_raw, + .update_scan_mode = adis_update_scan_mode, .driver_module = THIS_MODULE, }; |