Skip to contentSkip to conversation

iio: complete the setup of buffer timestamps

PATCH Applied Alison Schofield 3 participants 9 messages Jul 11, 2016 – Jul 24, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover iio: complete the setup of buffer timestamps

These drivers are using iio_poll_func->timestamp in their triggered buffer handler as the timestamp pushed to buffer. Problem is that it was not set up at probe time via iio_triggered_buffer_setup(), so timestamp is always 0.

Buffer space has been allocated for the timestamp, so it seems to be wanted.

These patches make the fix io_triggered_buffer_setup() during probe by passing the iio_pollfunc_store_time parameter.

Alternative change would be to use iio_get_time_ns() directly in the push_to_buffers call in the handler. We can do this if you are not one of those "devices (who) need a timestamp grabbed as soon as possible after the trigger" (from iio_poll_func definition)

Either way you are using iio_get_tme_ns(), it's just a question of when. Let me know if you'd rather go the slower way.

Alison Schofield (3):
iio: accel: bma220_spi: set up buffer timestamps for non-zero values
iio: humidity: am2315: set up buffer timestamps for non-zero values
iio: proximity: as3935: set up buffer timestamps for non-zero values

 drivers/iio/accel/bma220_spi.c | 2 +-
 drivers/iio/humidity/am2315.c  | 2 +-
 drivers/iio/proximity/as3935.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/3 iio: accel: bma220_spi: set up buffer timestamps for non-zero values

Use the iio_pollfunc_store_time parameter during triggered buffer set-up to get valid timestamps.

---
 drivers/iio/accel/bma220_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/bma220_spi.c +1 -1
index 1098d10..5099f29 100644
@@ -253,7 +253,7 @@ static int bma220_probe(struct spi_device *spi)
 	if (ret < 0)
 		return ret;
 
-	ret = iio_triggered_buffer_setup(indio_dev, NULL,
+	ret = iio_triggered_buffer_setup(indio_dev, iio_pollfunc_store_time,
 					 bma220_trigger_handler, NULL);
 	if (ret < 0) {
 		dev_err(&spi->dev, "iio triggered buffer setup failed\n");
Signature · 1 line
2.1.4
Reviewed-by on v1 1/3
#2 lore raw

RE: [PATCH 1/3] iio: accel: bma220_spi: set up buffer timestamps for non-zero values

Quoted 8 lines

-----Original Message-----
From: Alison Schofield [mailto:[email protected]]
Sent: Monday, July 11, 2016 6:25 PM
To: [email protected]
Cc: Breana, Tiberiu A <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: [PATCH 1/3] iio: accel: bma220_spi: set up buffer timestamps for=

non-

Quoted 3 lines

zero values
=20
Use the iio_pollfunc_store_time parameter during triggered buffer set-up =

to get

Quoted 4 lines

valid timestamps.=09
=20

+1

drivers/iio/accel/bma220_sp=

Quoted 5 lines
---
 drivers/iio/accel/bma220_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

=20

drivers/iio/accel/bma220_sp= renamed from drivers/iio/accel/bma220_spi.c +0 -0

i.c

Quoted 14 lines

index 1098d10..5099f29 100644

drivers/iio/accel/bma220_spi.c +0 -0
@@ -253,7 +253,7 @@ static int bma220_probe(struct spi_device *spi)
 	if (ret < 0)
 		return ret;

=20

drivers/iio/accel/bma220_spi.c +1 -2
-	ret =3D iio_triggered_buffer_setup(indio_dev, NULL,
+	ret =3D iio_triggered_buffer_setup(indio_dev, iio_pollfunc_store_time,
 					 bma220_trigger_handler, NULL);
 	if (ret < 0) {
 		dev_err(&spi->dev, "iio triggered buffer setup failed\n");
--

2.1.4

maintainer Applied
#3 lore raw

Re: [PATCH 1/3] iio: accel: bma220_spi: set up buffer timestamps for non-zero values

Quoted 10 lines · Tiberiu A
Quoted 10 lines

-----Original Message-----
From: Alison Schofield [mailto:[email protected]]
Sent: Monday, July 11, 2016 6:25 PM
To: [email protected]
Cc: Breana, Tiberiu A <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: [PATCH 1/3] iio: accel: bma220_spi: set up buffer timestamps for non- zero values

Quoted 9 lines
Quoted 5 lines

Use the iio_pollfunc_store_time parameter during triggered buffer set-up to get valid timestamps.

+1

Applied to the fixes-togreg-post-rc1 branch of iio.git (for my convenience) and marked for stable.

Jonathan

Quoted 20 lines
Quoted 19 lines
---
 drivers/iio/accel/bma220_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/bma220_spi.c +1 -2
index 1098d10..5099f29 100644
@@ -253,7 +253,7 @@ static int bma220_probe(struct spi_device *spi)
 	if (ret < 0)
 		return ret;
 
-	ret = iio_triggered_buffer_setup(indio_dev, NULL,
+	ret = iio_triggered_buffer_setup(indio_dev, iio_pollfunc_store_time,
 					 bma220_trigger_handler, NULL);
 	if (ret < 0) {
 		dev_err(&spi->dev, "iio triggered buffer setup failed\n");
--

2.1.4

#4 lore raw

PATCH 2/3 iio: humidity: am2315: set up buffer timestamps for non-zero values

In reply to Alison Schofield

Use the iio_pollfunc_store_time parameter during triggered buffer set-up to get valid timestamps.

---
 drivers/iio/humidity/am2315.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/humidity/am2315.c +1 -1
index 3e200f6..ff96b6d 100644
@@ -244,7 +244,7 @@ static int am2315_probe(struct i2c_client *client,
 	indio_dev->channels = am2315_channels;
 	indio_dev->num_channels = ARRAY_SIZE(am2315_channels);
 
-	ret = iio_triggered_buffer_setup(indio_dev, NULL,
+	ret = iio_triggered_buffer_setup(indio_dev, iio_pollfunc_store_time,
 					 am2315_trigger_handler, NULL);
 	if (ret < 0) {
 		dev_err(&client->dev, "iio triggered buffer setup failed\n");
Signature · 1 line
2.1.4
Reviewed-by on v1 2/3
#5 lore raw

RE: [PATCH 2/3] iio: humidity: am2315: set up buffer timestamps for non-zero values

Quoted 10 lines

-----Original Message-----
From: Alison Schofield [mailto:[email protected]]
Sent: Monday, July 11, 2016 6:26 PM
To: [email protected]
Cc: Breana, Tiberiu A <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: [PATCH 2/3] iio: humidity: am2315: set up buffer timestamps for non- zero values

Quoted 6 lines

Use the iio_pollfunc_store_time parameter during triggered buffer set-up to get valid timestamps.

---

+1

Quoted 18 lines
 drivers/iio/humidity/am2315.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/humidity/am2315.c +1 -2
index 3e200f6..ff96b6d 100644
@@ -244,7 +244,7 @@ static int am2315_probe(struct i2c_client *client,
 	indio_dev->channels = am2315_channels;
 	indio_dev->num_channels = ARRAY_SIZE(am2315_channels);
 
-	ret = iio_triggered_buffer_setup(indio_dev, NULL,
+	ret = iio_triggered_buffer_setup(indio_dev, iio_pollfunc_store_time,
 					 am2315_trigger_handler, NULL);
 	if (ret < 0) {
 		dev_err(&client->dev, "iio triggered buffer setup failed\n");
--

2.1.4

maintainer Applied
#6 lore raw

Re: [PATCH 2/3] iio: humidity: am2315: set up buffer timestamps for non-zero values

Quoted 13 lines · Tiberiu A
Quoted 13 lines

-----Original Message-----
From: Alison Schofield [mailto:[email protected]]
Sent: Monday, July 11, 2016 6:26 PM
To: [email protected]
Cc: Breana, Tiberiu A <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: [PATCH 2/3] iio: humidity: am2315: set up buffer timestamps for non- zero values

Use the iio_pollfunc_store_time parameter during triggered buffer set-up to get valid timestamps.

Quoted 6 lines
Quoted 3 lines

---

+1

Applied to the fixes-togreg-post-rc1 branch of iio.git and marked for stable.

Thanks,
Jonathan

Quoted 25 lines
Quoted 18 lines
 drivers/iio/humidity/am2315.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/humidity/am2315.c +1 -2
index 3e200f6..ff96b6d 100644
@@ -244,7 +244,7 @@ static int am2315_probe(struct i2c_client *client,
 	indio_dev->channels = am2315_channels;
 	indio_dev->num_channels = ARRAY_SIZE(am2315_channels);
 
-	ret = iio_triggered_buffer_setup(indio_dev, NULL,
+	ret = iio_triggered_buffer_setup(indio_dev, iio_pollfunc_store_time,
 					 am2315_trigger_handler, NULL);
 	if (ret < 0) {
 		dev_err(&client->dev, "iio triggered buffer setup failed\n");
--
Quoted 1 line

2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw

PATCH 3/3 iio: proximity: as3935: set up buffer timestamps for non-zero values

In reply to Alison Schofield

Use the iio_pollfunc_store_time parameter during triggered buffer set-up to get valid timestamps.

---
 drivers/iio/proximity/as3935.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/proximity/as3935.c +1 -1
index 2e3a70e..5656deb 100644
@@ -397,7 +397,7 @@ static int as3935_probe(struct spi_device *spi)
 		return ret;
 	}
 
-	ret = iio_triggered_buffer_setup(indio_dev, NULL,
+	ret = iio_triggered_buffer_setup(indio_dev, iio_pollfunc_store_time,
 		&as3935_trigger_handler, NULL);
 
 	if (ret) {
Signature · 1 line
2.1.4
maintainer Applied
#8 lore raw

Re: [PATCH 3/3] iio: proximity: as3935: set up buffer timestamps for non-zero values

Quoted 5 lines · Alison Schofield

Use the iio_pollfunc_store_time parameter during triggered buffer set-up to get valid timestamps.

Applied to the fixes-togreg-post-rc1 branch of iio.git and marked for stable.

Oops to all of these ;)

Jonathan

Quoted 18 lines
---
 drivers/iio/proximity/as3935.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/proximity/as3935.c +1 -1
index 2e3a70e..5656deb 100644
@@ -397,7 +397,7 @@ static int as3935_probe(struct spi_device *spi)
 		return ret;
 	}
 
-	ret = iio_triggered_buffer_setup(indio_dev, NULL,
+	ret = iio_triggered_buffer_setup(indio_dev, iio_pollfunc_store_time,
 		&as3935_trigger_handler, NULL);
 
 	if (ret) {