diff options
-rw-r--r-- | drivers/media/v4l2-core/v4l2-common.c | 10 | ||||
-rw-r--r-- | include/media/v4l2-common.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c index 380ddd89fa4c..614316f9b7a4 100644 --- a/drivers/media/v4l2-core/v4l2-common.c +++ b/drivers/media/v4l2-core/v4l2-common.c | |||
@@ -978,3 +978,13 @@ const struct v4l2_frmsize_discrete *v4l2_find_nearest_format( | |||
978 | return best; | 978 | return best; |
979 | } | 979 | } |
980 | EXPORT_SYMBOL_GPL(v4l2_find_nearest_format); | 980 | EXPORT_SYMBOL_GPL(v4l2_find_nearest_format); |
981 | |||
982 | void v4l2_get_timestamp(struct timeval *tv) | ||
983 | { | ||
984 | struct timespec ts; | ||
985 | |||
986 | ktime_get_ts(&ts); | ||
987 | tv->tv_sec = ts.tv_sec; | ||
988 | tv->tv_usec = ts.tv_nsec / NSEC_PER_USEC; | ||
989 | } | ||
990 | EXPORT_SYMBOL_GPL(v4l2_get_timestamp); | ||
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 1a0b2db4c5d3..ec7c9c00b256 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
@@ -225,4 +225,6 @@ bool v4l2_detect_gtf(unsigned frame_height, unsigned hfreq, unsigned vsync, | |||
225 | 225 | ||
226 | struct v4l2_fract v4l2_calc_aspect_ratio(u8 hor_landscape, u8 vert_portrait); | 226 | struct v4l2_fract v4l2_calc_aspect_ratio(u8 hor_landscape, u8 vert_portrait); |
227 | 227 | ||
228 | void v4l2_get_timestamp(struct timeval *tv); | ||
229 | |||
228 | #endif /* V4L2_COMMON_H_ */ | 230 | #endif /* V4L2_COMMON_H_ */ |