Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304429
b: refs/heads/master
c: 2150489
h: refs/heads/master
i:
  304427: c7ab64d
v: v3
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Apr 24, 2012
1 parent 6a78bb8 commit f2abde1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 420fe2e9471518f57a551d2114a54a0aa0c12ea3
refs/heads/master: 2150489ffbd1cd6f5d1091c1738b1adfbdf34a43
22 changes: 5 additions & 17 deletions trunk/drivers/staging/iio/adc/ad7192.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,31 +456,19 @@ static int ad7192_setup(struct ad7192_state *st)
static int ad7192_ring_preenable(struct iio_dev *indio_dev)
{
struct ad7192_state *st = iio_priv(indio_dev);
struct iio_buffer *ring = indio_dev->buffer;
size_t d_size;
unsigned channel;
int ret;

if (bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength))
return -EINVAL;

ret = iio_sw_buffer_preenable(indio_dev);
if (ret < 0)
return ret;

channel = find_first_bit(indio_dev->active_scan_mask,
indio_dev->masklength);

d_size = bitmap_weight(indio_dev->active_scan_mask,
indio_dev->masklength) *
indio_dev->channels[0].scan_type.storagebits / 8;

if (ring->scan_timestamp) {
d_size += sizeof(s64);

if (d_size % sizeof(s64))
d_size += sizeof(s64) - (d_size % sizeof(s64));
}

if (indio_dev->buffer->access->set_bytes_per_datum)
indio_dev->buffer->access->
set_bytes_per_datum(indio_dev->buffer, d_size);

st->mode = (st->mode & ~AD7192_MODE_SEL(-1)) |
AD7192_MODE_SEL(AD7192_MODE_CONT);
st->conf = (st->conf & ~AD7192_CONF_CHAN(-1)) |
Expand Down

0 comments on commit f2abde1

Please sign in to comment.