diff options
Diffstat (limited to 'include/linux/nvpps_ioctl.h')
-rw-r--r-- | include/linux/nvpps_ioctl.h | 69 |
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 | |||
22 | struct 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 | |||
38 | struct 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 | |||
53 | struct 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__ */ | ||