summaryrefslogtreecommitdiffstats
path: root/drivers/misc/nvs/nvs_timestamp.c
blob: 0bccedf659e0c03bc450b0098866064e4ad29a06 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* Copyright (c) 2015-2017, NVIDIA CORPORATION.  All rights reserved.
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */


#include <linux/module.h>
#include <linux/time.h>
#include <linux/ktime.h>
#include <linux/timekeeping.h>


s64 nvs_timestamp(void)
{
	struct timespec64 ts;

	ktime_get_ts64(&ts);
	return timespec_to_ns(&ts);
}
EXPORT_SYMBOL_GPL(nvs_timestamp);

MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("NVidia Sensor timestamp module");
MODULE_AUTHOR("NVIDIA Corporation");