summaryrefslogtreecommitdiff
path: root/drivers/staging/media/imx/imx-media-csi.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2017-11-27 08:20:00 -0500
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-12-08 11:22:04 -0500
commit1d88f4bccfd87b6359f11032f2018893d531d18d (patch)
tree9ac4f9718781879ab98710738ee3deb6bab3ea90 /drivers/staging/media/imx/imx-media-csi.c
parent6c542426b610c14acff0e815e5fe513abdbb9a16 (diff)
media: staging: imx: use ktime_t for timestamps
The imx media driver passes around monotonic timestamps in the deprecated 'timespec' format. This is not a problem for the driver, as they won't overflow, but moving to either timespec64 or ktime_t is preferred. I'm picking ktime_t for simplicity here. frame_interval_monitor() is the main function that changes, as it tries to compare a time interval in microseconds. The algorithm slightly changes here, to avoid 64-bit division. The code previously assumed that the error was at most 32-bit worth of microseconds here, so I'm making the same assumption but add an explicit test for it. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/staging/media/imx/imx-media-csi.c')
-rw-r--r--drivers/staging/media/imx/imx-media-csi.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c
index ebb4ca530de2..f4a3bf5ca2bb 100644
--- a/drivers/staging/media/imx/imx-media-csi.c
+++ b/drivers/staging/media/imx/imx-media-csi.c
@@ -207,13 +207,9 @@ static irqreturn_t csi_idmac_eof_interrupt(int irq, void *dev_id)
goto unlock;
}
- if (priv->fim) {
- struct timespec cur_ts;
-
- ktime_get_ts(&cur_ts);
+ if (priv->fim)
/* call frame interval monitor */
- imx_media_fim_eof_monitor(priv->fim, &cur_ts);
- }
+ imx_media_fim_eof_monitor(priv->fim, ktime_get());
csi_vb2_buf_done(priv);