2 * Copyright 2014 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
23 #include <linux/module.h>
24 #include <linux/sched.h>
25 #include <linux/notifier.h>
26 #include <linux/moduleparam.h>
27 #include <linux/device.h>
30 #define KFD_DRIVER_AUTHOR "AMD Inc. and others"
32 #define KFD_DRIVER_DESC "Standalone HSA driver for AMD's GPUs"
33 #define KFD_DRIVER_DATE "20141113"
34 #define KFD_DRIVER_MAJOR 0
35 #define KFD_DRIVER_MINOR 7
36 #define KFD_DRIVER_PATCHLEVEL 0
38 const struct kfd2kgd_calls *kfd2kgd;
39 static const struct kgd2kfd_calls kgd2kfd = {
41 .probe = kgd2kfd_probe,
42 .device_init = kgd2kfd_device_init,
43 .device_exit = kgd2kfd_device_exit,
44 .interrupt = kgd2kfd_interrupt,
45 .suspend = kgd2kfd_suspend,
46 .resume = kgd2kfd_resume,
49 bool kgd2kfd_init(unsigned interface_version,
50 const struct kfd2kgd_calls *f2g,
51 const struct kgd2kfd_calls **g2f)
54 * Only one interface version is supported,
55 * no kfd/kgd version skew allowed.
57 if (interface_version != KFD_INTERFACE_VERSION)
65 EXPORT_SYMBOL(kgd2kfd_init);
67 void kgd2kfd_exit(void)
71 static int __init kfd_module_init(void)
75 err = kfd_chardev_init();
79 dev_info(kfd_device, "Initialized module\n");
87 static void __exit kfd_module_exit(void)
90 dev_info(kfd_device, "Removed module\n");
93 module_init(kfd_module_init);
94 module_exit(kfd_module_exit);
96 MODULE_AUTHOR(KFD_DRIVER_AUTHOR);
97 MODULE_DESCRIPTION(KFD_DRIVER_DESC);
98 MODULE_LICENSE("GPL and additional rights");
99 MODULE_VERSION(__stringify(KFD_DRIVER_MAJOR) "."
100 __stringify(KFD_DRIVER_MINOR) "."
101 __stringify(KFD_DRIVER_PATCHLEVEL));