diff options
author | José Pekkarinen <jose.pekkarinen@nokia.com> | 2016-04-11 10:41:07 +0300 |
---|---|---|
committer | José Pekkarinen <jose.pekkarinen@nokia.com> | 2016-04-13 08:17:18 +0300 |
commit | e09b41010ba33a20a87472ee821fa407a5b8da36 (patch) | |
tree | d10dc367189862e7ca5c592f033dc3726e1df4e3 /kernel/drivers/staging/iio/accel/sca3000_ring.c | |
parent | f93b97fd65072de626c074dbe099a1fff05ce060 (diff) |
These changes are the raw update to linux-4.4.6-rt14. Kernel sources
are taken from kernel.org, and rt patch from the rt wiki download page.
During the rebasing, the following patch collided:
Force tick interrupt and get rid of softirq magic(I70131fb85).
Collisions have been removed because its logic was found on the
source already.
Change-Id: I7f57a4081d9deaa0d9ccfc41a6c8daccdee3b769
Signed-off-by: José Pekkarinen <jose.pekkarinen@nokia.com>
Diffstat (limited to 'kernel/drivers/staging/iio/accel/sca3000_ring.c')
-rw-r--r-- | kernel/drivers/staging/iio/accel/sca3000_ring.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/kernel/drivers/staging/iio/accel/sca3000_ring.c b/kernel/drivers/staging/iio/accel/sca3000_ring.c index 8589eade1..20b878d35 100644 --- a/kernel/drivers/staging/iio/accel/sca3000_ring.c +++ b/kernel/drivers/staging/iio/accel/sca3000_ring.c @@ -34,9 +34,9 @@ */ static int sca3000_read_data(struct sca3000_state *st, - uint8_t reg_address_high, - u8 **rx_p, - int len) + u8 reg_address_high, + u8 **rx_p, + int len) { int ret; struct spi_transfer xfer[2] = { @@ -106,7 +106,7 @@ static int sca3000_read_first_n_hw_rb(struct iio_buffer *r, * i.e. number of time points * number of channels. */ if (count > num_available * bytes_per_sample) - num_read = num_available*bytes_per_sample; + num_read = num_available * bytes_per_sample; else num_read = count; @@ -116,7 +116,7 @@ static int sca3000_read_first_n_hw_rb(struct iio_buffer *r, if (ret) goto error_ret; - for (i = 0; i < num_read; i++) + for (i = 0; i < num_read / sizeof(u16); i++) *(((u16 *)rx) + i) = be16_to_cpup((__be16 *)rx + i); if (copy_to_user(buf, rx, num_read)) @@ -160,9 +160,9 @@ static ssize_t sca3000_query_ring_int(struct device *dev, * sca3000_set_ring_int() set state of ring status interrupt **/ static ssize_t sca3000_set_ring_int(struct device *dev, - struct device_attribute *attr, - const char *buf, - size_t len) + struct device_attribute *attr, + const char *buf, + size_t len) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct sca3000_state *st = iio_priv(indio_dev); @@ -208,7 +208,7 @@ static ssize_t sca3000_show_buffer_scale(struct device *dev, struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct sca3000_state *st = iio_priv(indio_dev); - return sprintf(buf, "0.%06d\n", 4*st->info->scale); + return sprintf(buf, "0.%06d\n", 4 * st->info->scale); } static IIO_DEVICE_ATTR(in_accel_scale, @@ -258,6 +258,8 @@ static const struct iio_buffer_access_funcs sca3000_ring_access_funcs = { .read_first_n = &sca3000_read_first_n_hw_rb, .data_available = sca3000_ring_buf_data_available, .release = sca3000_ring_release, + + .modes = INDIO_BUFFER_HARDWARE, }; int sca3000_configure_ring(struct iio_dev *indio_dev) @@ -265,7 +267,7 @@ int sca3000_configure_ring(struct iio_dev *indio_dev) struct iio_buffer *buffer; buffer = sca3000_rb_allocate(indio_dev); - if (buffer == NULL) + if (!buffer) return -ENOMEM; indio_dev->modes |= INDIO_BUFFER_HARDWARE; @@ -305,6 +307,7 @@ error_ret: return ret; } + /** * sca3000_hw_ring_preenable() hw ring buffer preenable function * |