Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304435
b: refs/heads/master
c: c562ccb
h: refs/heads/master
i:
  304433: bf1e5b8
  304431: 0d84127
v: v3
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Apr 24, 2012
1 parent 2c48795 commit 981d9d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 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: c1633187829aa11a475ab6e453f05d3f6a172aff
refs/heads/master: c562ccbf584f8017a153bbd5c1039a189e1f8be8
20 changes: 5 additions & 15 deletions trunk/drivers/staging/iio/meter/ade7758_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,29 +92,19 @@ static irqreturn_t ade7758_trigger_handler(int irq, void *p)
static int ade7758_ring_preenable(struct iio_dev *indio_dev)
{
struct ade7758_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 = st->ade7758_ring_channels[channel].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);

ade7758_write_waveform_type(&indio_dev->dev,
st->ade7758_ring_channels[channel].address);

Expand Down

0 comments on commit 981d9d0

Please sign in to comment.