diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-04-15 17:45:35 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-04-27 11:10:54 -0400 |
commit | 6d888006aa7ed87b1589198369180e7e69f9f1d2 (patch) | |
tree | e4d324fd0022d99e3956dcfe166ca65981cac5d9 /drivers/gpu/nvgpu/gk20a | |
parent | ec62c649b5338e7608ea82546135e88f443b90a8 (diff) |
gpu: nvgpu: Add PCIe device support
Add support for probing PCIe graphics cards.
JIRA DNVGPU-7
Change-Id: Iad3d31a1dc0ca6575d8a9916857022cac9181948
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1127684
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 12 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 4 |
2 files changed, 13 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index a865b078..7b0db89e 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -62,6 +62,7 @@ | |||
62 | #include "gk20a_allocator.h" | 62 | #include "gk20a_allocator.h" |
63 | #include "hal.h" | 63 | #include "hal.h" |
64 | #include "vgpu/vgpu.h" | 64 | #include "vgpu/vgpu.h" |
65 | #include "pci.h" | ||
65 | 66 | ||
66 | #define CREATE_TRACE_POINTS | 67 | #define CREATE_TRACE_POINTS |
67 | #include <trace/events/gk20a.h> | 68 | #include <trace/events/gk20a.h> |
@@ -601,7 +602,7 @@ static irqreturn_t gk20a_intr_thread_nonstall(int irq, void *dev_id) | |||
601 | return g->ops.mc.isr_thread_nonstall(g); | 602 | return g->ops.mc.isr_thread_nonstall(g); |
602 | } | 603 | } |
603 | 604 | ||
604 | static void gk20a_remove_support(struct device *dev) | 605 | void gk20a_remove_support(struct device *dev) |
605 | { | 606 | { |
606 | struct gk20a *g = get_gk20a(dev); | 607 | struct gk20a *g = get_gk20a(dev); |
607 | 608 | ||
@@ -765,7 +766,7 @@ static int gk20a_detect_chip(struct gk20a *g) | |||
765 | return gpu_init_hal(g); | 766 | return gpu_init_hal(g); |
766 | } | 767 | } |
767 | 768 | ||
768 | static int gk20a_pm_finalize_poweron(struct device *dev) | 769 | int gk20a_pm_finalize_poweron(struct device *dev) |
769 | { | 770 | { |
770 | struct gk20a *g = get_gk20a(dev); | 771 | struct gk20a *g = get_gk20a(dev); |
771 | struct gk20a_platform *platform = gk20a_get_platform(dev); | 772 | struct gk20a_platform *platform = gk20a_get_platform(dev); |
@@ -1326,7 +1327,7 @@ static int gk20a_pm_initialise_domain(struct device *dev) | |||
1326 | } | 1327 | } |
1327 | #endif | 1328 | #endif |
1328 | 1329 | ||
1329 | static int gk20a_pm_init(struct device *dev) | 1330 | int gk20a_pm_init(struct device *dev) |
1330 | { | 1331 | { |
1331 | struct gk20a_platform *platform = dev_get_drvdata(dev); | 1332 | struct gk20a_platform *platform = dev_get_drvdata(dev); |
1332 | int err = 0; | 1333 | int err = 0; |
@@ -1764,11 +1765,16 @@ static int __init gk20a_init(void) | |||
1764 | if (ret) | 1765 | if (ret) |
1765 | return ret; | 1766 | return ret; |
1766 | 1767 | ||
1768 | ret = nvgpu_pci_init(); | ||
1769 | if (ret) | ||
1770 | return ret; | ||
1771 | |||
1767 | return platform_driver_register(&gk20a_driver); | 1772 | return platform_driver_register(&gk20a_driver); |
1768 | } | 1773 | } |
1769 | 1774 | ||
1770 | static void __exit gk20a_exit(void) | 1775 | static void __exit gk20a_exit(void) |
1771 | { | 1776 | { |
1777 | nvgpu_pci_exit(); | ||
1772 | platform_driver_unregister(&gk20a_driver); | 1778 | platform_driver_unregister(&gk20a_driver); |
1773 | class_unregister(&nvgpu_class); | 1779 | class_unregister(&nvgpu_class); |
1774 | } | 1780 | } |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 47adcc14..15f838d9 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -1070,4 +1070,8 @@ extern struct class nvgpu_class; | |||
1070 | 1070 | ||
1071 | #define INTERFACE_NAME "nvhost%s-gpu" | 1071 | #define INTERFACE_NAME "nvhost%s-gpu" |
1072 | 1072 | ||
1073 | int gk20a_pm_init(struct device *dev); | ||
1074 | int gk20a_pm_finalize_poweron(struct device *dev); | ||
1075 | void gk20a_remove_support(struct device *dev); | ||
1076 | |||
1073 | #endif /* GK20A_H */ | 1077 | #endif /* GK20A_H */ |