summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Tao <tehyut@nvidia.com>2018-06-13 19:40:16 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-07-06 16:25:09 -0400
commitf6cd6e17236b137038bb36f7cb5c7d0bb9c6f460 (patch)
tree725fb6e109640e87ae2c611da9b744fcfedc1414 /include
parent39d5a4f8e00742109eb62dca7ff2e2a67adfb30d (diff)
nvpps : new kernel module for time sync
Enable 1PPS time source to correlate GPS/TSC/PTP time domains fixed trailing white space Bug 2136350 Change-Id: I5fd83ca53d590dfcad0b0e67e73414c6436d5378 Signed-off-by: David Tao <tehyut@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1749126 Reviewed-by: Greg Lo <glo@nvidia.com> Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/nvpps_ioctl.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/include/linux/nvpps_ioctl.h b/include/linux/nvpps_ioctl.h
new file mode 100644
index 000000000..23c782b1d
--- /dev/null
+++ b/include/linux/nvpps_ioctl.h
@@ -0,0 +1,69 @@
1/*
2 * Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 */
14
15#ifndef __NVPPS_IOCTL_H__
16#define __NVPPS_IOCTL_H__
17
18#include <linux/types.h>
19#include <linux/ioctl.h>
20
21
22struct nvpps_version {
23 struct _version {
24 __u32 major;
25 __u32 minor;
26 } version;
27 struct _api {
28 __u32 major;
29 __u32 minor;
30 } api;
31};
32
33#define NVPPS_VERSION_MAJOR 0
34#define NVPPS_VERSION_MINOR 1
35#define NVPPS_API_MAJOR 0
36#define NVPPS_API_MINOR 1
37
38struct nvpps_params {
39 __u32 evt_mode;
40 __u32 tsc_mode;
41};
42
43
44/* evt_mode */
45#define NVPPS_MODE_GPIO 0x01
46#define NVPPS_MODE_TIMER 0x02
47
48/* tsc_mode */
49#define NVPPS_TSC_NSEC 0
50#define NVPPS_TSC_COUNTER 1
51
52
53struct nvpps_timeevent {
54 __u32 evt_nb;
55 __u64 tsc;
56 __u64 ptp;
57 __u64 tsc_res_ns;
58 __u32 evt_mode;
59 __u32 tsc_mode;
60 __u64 irq_latency;
61};
62
63
64#define NVPPS_GETVERSION _IOR('p', 0x1, struct nvpps_version *)
65#define NVPPS_GETPARAMS _IOR('p', 0x2, struct nvpps_params *)
66#define NVPPS_SETPARAMS _IOW('p', 0x3, struct nvpps_params *)
67#define NVPPS_GETEVENT _IOR('p', 0x4, struct nvpps_timeevent *)
68
69#endif /* !__NVPPS_IOCTL_H__ */