aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/iio/adc/ad7298.h2
-rw-r--r--drivers/staging/iio/adc/ad7298_core.c1
-rw-r--r--drivers/staging/iio/adc/ad7298_ring.c11
3 files changed, 5 insertions, 9 deletions
diff --git a/drivers/staging/iio/adc/ad7298.h b/drivers/staging/iio/adc/ad7298.h
index 18f27872300..0ce9031bec9 100644
--- a/drivers/staging/iio/adc/ad7298.h
+++ b/drivers/staging/iio/adc/ad7298.h
@@ -48,7 +48,7 @@ struct ad7298_state {
48 * DMA (thus cache coherency maintenance) requires the 48 * DMA (thus cache coherency maintenance) requires the
49 * transfer buffers to live in their own cache lines. 49 * transfer buffers to live in their own cache lines.
50 */ 50 */
51 unsigned short rx_buf[8] ____cacheline_aligned; 51 unsigned short rx_buf[12] ____cacheline_aligned;
52 unsigned short tx_buf[2]; 52 unsigned short tx_buf[2];
53}; 53};
54 54
diff --git a/drivers/staging/iio/adc/ad7298_core.c b/drivers/staging/iio/adc/ad7298_core.c
index 4c75114e7d7..67082ade185 100644
--- a/drivers/staging/iio/adc/ad7298_core.c
+++ b/drivers/staging/iio/adc/ad7298_core.c
@@ -35,6 +35,7 @@
35 .sign = 'u', \ 35 .sign = 'u', \
36 .realbits = 12, \ 36 .realbits = 12, \
37 .storagebits = 16, \ 37 .storagebits = 16, \
38 .endianness = IIO_BE, \
38 }, \ 39 }, \
39 } 40 }
40 41
diff --git a/drivers/staging/iio/adc/ad7298_ring.c b/drivers/staging/iio/adc/ad7298_ring.c
index b3dd514b962..e3877129222 100644
--- a/drivers/staging/iio/adc/ad7298_ring.c
+++ b/drivers/staging/iio/adc/ad7298_ring.c
@@ -76,8 +76,7 @@ static irqreturn_t ad7298_trigger_handler(int irq, void *p)
76 struct iio_dev *indio_dev = pf->indio_dev; 76 struct iio_dev *indio_dev = pf->indio_dev;
77 struct ad7298_state *st = iio_priv(indio_dev); 77 struct ad7298_state *st = iio_priv(indio_dev);
78 s64 time_ns = 0; 78 s64 time_ns = 0;
79 __u16 buf[16]; 79 int b_sent;
80 int b_sent, i;
81 80
82 b_sent = spi_sync(st->spi, &st->ring_msg); 81 b_sent = spi_sync(st->spi, &st->ring_msg);
83 if (b_sent) 82 if (b_sent)
@@ -85,15 +84,11 @@ static irqreturn_t ad7298_trigger_handler(int irq, void *p)
85 84
86 if (indio_dev->scan_timestamp) { 85 if (indio_dev->scan_timestamp) {
87 time_ns = iio_get_time_ns(); 86 time_ns = iio_get_time_ns();
88 memcpy((u8 *)buf + indio_dev->scan_bytes - sizeof(s64), 87 memcpy((u8 *)st->rx_buf + indio_dev->scan_bytes - sizeof(s64),
89 &time_ns, sizeof(time_ns)); 88 &time_ns, sizeof(time_ns));
90 } 89 }
91 90
92 for (i = 0; i < bitmap_weight(indio_dev->active_scan_mask, 91 iio_push_to_buffers(indio_dev, (u8 *)st->rx_buf);
93 indio_dev->masklength); i++)
94 buf[i] = be16_to_cpu(st->rx_buf[i]);
95
96 iio_push_to_buffers(indio_dev, (u8 *)buf);
97 92
98done: 93done:
99 iio_trigger_notify_done(indio_dev->trig); 94 iio_trigger_notify_done(indio_dev->trig);