Skip to contentSkip to conversation

staging:iio:adc:max1363 actually make timestamp controllable

PATCH In review Jonathan Cameron 1 participant 2 messages Nov 27, 2011 – Dec 4, 2011

Subsystems (3)
lore
Share & tools
lore

Jonathan Cameron

author maintainer
#0 lore raw

PATCH 1/1 staging:iio:adc:max1363 actually make timestamp controllable

From: Jonathan Cameron <[email protected]>

Previously timestamps were always on in this driver.

---
A random minor fixlet that has been in my tree far too long.

 drivers/staging/iio/adc/max1363_ring.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/staging/iio/adc/max1363_ring.c +2 -3
index a87fbe8..3c5e199 100644
@@ -138,9 +138,8 @@ static irqreturn_t max1363_trigger_handler(int irq, void *p)
 		goto done;
 
 	time_ns = iio_get_time_ns();
-
-	memcpy(rxbuf + d_size - sizeof(s64), &time_ns, sizeof(time_ns));
-
+	if (indio_dev->buffer->scan_timestamp)
+		memcpy(rxbuf + d_size - sizeof(s64), &time_ns, sizeof(time_ns));
 	indio_dev->buffer->access->store_to(indio_dev->buffer, rxbuf, time_ns);
 done:
 	iio_trigger_notify_done(indio_dev->trig);
Signature · 1 line
1.7.7.3
author maintainer
#1 lore raw

gone to Greg

Quoted 27 lines

From: Jonathan Cameron <[email protected]>

Previously timestamps were always on in this driver.

---
A random minor fixlet that has been in my tree far too long.

 drivers/staging/iio/adc/max1363_ring.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/staging/iio/adc/max1363_ring.c +2 -3
index a87fbe8..3c5e199 100644
@@ -138,9 +138,8 @@ static irqreturn_t max1363_trigger_handler(int irq, void *p)
 		goto done;
 
 	time_ns = iio_get_time_ns();
-
-	memcpy(rxbuf + d_size - sizeof(s64), &time_ns, sizeof(time_ns));
-
+	if (indio_dev->buffer->scan_timestamp)
+		memcpy(rxbuf + d_size - sizeof(s64), &time_ns, sizeof(time_ns));
 	indio_dev->buffer->access->store_to(indio_dev->buffer, rxbuf, time_ns);
 done:
 	iio_trigger_notify_done(indio_dev->trig);