diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/platform_vgpu_tegra.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/platform_vgpu_tegra.c | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/platform_vgpu_tegra.c b/drivers/gpu/nvgpu/gk20a/platform_vgpu_tegra.c index 049d394e..e33fc29f 100644 --- a/drivers/gpu/nvgpu/gk20a/platform_vgpu_tegra.c +++ b/drivers/gpu/nvgpu/gk20a/platform_vgpu_tegra.c | |||
@@ -13,38 +13,20 @@ | |||
13 | * more details. | 13 | * more details. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <linux/of_platform.h> | ||
17 | |||
18 | #include "gk20a.h" | 16 | #include "gk20a.h" |
19 | #include "hal_gk20a.h" | 17 | #include "hal_gk20a.h" |
20 | #include "platform_gk20a.h" | 18 | #include "platform_gk20a.h" |
21 | 19 | ||
20 | #include <nvgpu/nvhost.h> | ||
21 | |||
22 | static int gk20a_tegra_probe(struct device *dev) | 22 | static int gk20a_tegra_probe(struct device *dev) |
23 | { | 23 | { |
24 | #ifdef CONFIG_TEGRA_GK20A_NVHOST | ||
24 | struct gk20a_platform *platform = dev_get_drvdata(dev); | 25 | struct gk20a_platform *platform = dev_get_drvdata(dev); |
25 | struct device_node *np = dev->of_node; | 26 | return nvgpu_get_nvhost_dev(platform->g); |
26 | const __be32 *host1x_ptr; | 27 | #else |
27 | struct platform_device *host1x_pdev = NULL; | ||
28 | |||
29 | host1x_ptr = of_get_property(np, "nvidia,host1x", NULL); | ||
30 | if (host1x_ptr) { | ||
31 | struct device_node *host1x_node = | ||
32 | of_find_node_by_phandle(be32_to_cpup(host1x_ptr)); | ||
33 | |||
34 | host1x_pdev = of_find_device_by_node(host1x_node); | ||
35 | if (!host1x_pdev) { | ||
36 | dev_warn(dev, "host1x device not available"); | ||
37 | return -EPROBE_DEFER; | ||
38 | } | ||
39 | |||
40 | } else { | ||
41 | host1x_pdev = to_platform_device(dev->parent); | ||
42 | dev_warn(dev, "host1x reference not found. assuming host1x to be parent"); | ||
43 | } | ||
44 | |||
45 | platform->g->host1x_dev = host1x_pdev; | ||
46 | |||
47 | return 0; | 28 | return 0; |
29 | #endif | ||
48 | } | 30 | } |
49 | 31 | ||
50 | struct gk20a_platform vgpu_tegra_platform = { | 32 | struct gk20a_platform vgpu_tegra_platform = { |