diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/module.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/module.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c index 4fe38588..5d91da8f 100644 --- a/drivers/gpu/nvgpu/common/linux/module.c +++ b/drivers/gpu/nvgpu/common/linux/module.c | |||
@@ -24,6 +24,8 @@ | |||
24 | #include <linux/pm_runtime.h> | 24 | #include <linux/pm_runtime.h> |
25 | #include <linux/reset.h> | 25 | #include <linux/reset.h> |
26 | #include <linux/platform/tegra/common.h> | 26 | #include <linux/platform/tegra/common.h> |
27 | #include <linux/pci.h> | ||
28 | |||
27 | #include <uapi/linux/nvgpu.h> | 29 | #include <uapi/linux/nvgpu.h> |
28 | #include <dt-bindings/soc/gm20b-fuse.h> | 30 | #include <dt-bindings/soc/gm20b-fuse.h> |
29 | #include <dt-bindings/soc/gp10b-fuse.h> | 31 | #include <dt-bindings/soc/gp10b-fuse.h> |
@@ -70,6 +72,23 @@ | |||
70 | #define CREATE_TRACE_POINTS | 72 | #define CREATE_TRACE_POINTS |
71 | #include <trace/events/gk20a.h> | 73 | #include <trace/events/gk20a.h> |
72 | 74 | ||
75 | |||
76 | struct device_node *nvgpu_get_node(struct gk20a *g) | ||
77 | { | ||
78 | struct device *dev = dev_from_gk20a(g); | ||
79 | |||
80 | if (dev_is_pci(dev)) { | ||
81 | struct pci_bus *bus = to_pci_dev(dev)->bus; | ||
82 | |||
83 | while (!pci_is_root_bus(bus)) | ||
84 | bus = bus->parent; | ||
85 | |||
86 | return bus->bridge->parent->of_node; | ||
87 | } | ||
88 | |||
89 | return dev->of_node; | ||
90 | } | ||
91 | |||
73 | void gk20a_busy_noresume(struct gk20a *g) | 92 | void gk20a_busy_noresume(struct gk20a *g) |
74 | { | 93 | { |
75 | pm_runtime_get_noresume(dev_from_gk20a(g)); | 94 | pm_runtime_get_noresume(dev_from_gk20a(g)); |
@@ -1042,7 +1061,7 @@ static inline void set_gk20a(struct platform_device *pdev, struct gk20a *gk20a) | |||
1042 | 1061 | ||
1043 | static int nvgpu_read_fuse_overrides(struct gk20a *g) | 1062 | static int nvgpu_read_fuse_overrides(struct gk20a *g) |
1044 | { | 1063 | { |
1045 | struct device_node *np = dev_from_gk20a(g)->of_node; | 1064 | struct device_node *np = nvgpu_get_node(g); |
1046 | u32 *fuses; | 1065 | u32 *fuses; |
1047 | int count, i; | 1066 | int count, i; |
1048 | 1067 | ||