Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304430
b: refs/heads/master
c: 8f03aab
h: refs/heads/master
v: v3
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Apr 24, 2012
1 parent f2abde1 commit 3fff373
Show file tree
Hide file tree
Showing 3 changed files with 9 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: 2150489ffbd1cd6f5d1091c1738b1adfbdf34a43
refs/heads/master: 8f03aabc0fbaa795ed6253010b27065fa4159825
1 change: 0 additions & 1 deletion trunk/drivers/staging/iio/adc/ad7298.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ struct ad7298_platform_data {
struct ad7298_state {
struct spi_device *spi;
struct regulator *reg;
size_t d_size;
u16 int_vref_mv;
unsigned ext_ref;
struct spi_transfer ring_xfer[10];
Expand Down
24 changes: 8 additions & 16 deletions trunk/drivers/staging/iio/adc/ad7298_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,17 @@
static int ad7298_ring_preenable(struct iio_dev *indio_dev)
{
struct ad7298_state *st = iio_priv(indio_dev);
struct iio_buffer *ring = indio_dev->buffer;
size_t d_size;
int i, m;
unsigned short command;
int scan_count = bitmap_weight(indio_dev->active_scan_mask,
indio_dev->masklength);
d_size = scan_count * (AD7298_STORAGE_BITS / 8);

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

if (d_size % sizeof(s64))
d_size += sizeof(s64) - (d_size % sizeof(s64));
}
int scan_count, ret;

if (ring->access->set_bytes_per_datum)
ring->access->set_bytes_per_datum(ring, d_size);
ret = iio_sw_buffer_preenable(indio_dev);
if (ret < 0)
return ret;

st->d_size = d_size;
/* Now compute overall size */
scan_count = bitmap_weight(indio_dev->active_scan_mask,
indio_dev->masklength);

command = AD7298_WRITE | st->ext_ref;

Expand Down Expand Up @@ -102,7 +94,7 @@ static irqreturn_t ad7298_trigger_handler(int irq, void *p)

if (ring->scan_timestamp) {
time_ns = iio_get_time_ns();
memcpy((u8 *)buf + st->d_size - sizeof(s64),
memcpy((u8 *)buf + indio_dev->scan_bytes - sizeof(s64),
&time_ns, sizeof(time_ns));
}

Expand Down

0 comments on commit 3fff373

Please sign in to comment.