diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2017-05-25 08:11:38 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-06-08 09:37:15 -0400 |
commit | 0ad7f1d9aa18d959abf3cba6ca4e532fc9246a31 (patch) | |
tree | 781bd0ef8ffa6d11d45b9f595bfcbc966e5733e7 /drivers/gpu/nvgpu/gk20a/platform_vgpu_tegra.c | |
parent | 2c9713e21c9ab93e7af45a4b9e76c1f378aab024 (diff) |
gpu: nvgpu: use nvgpu specific nvhost APIs
Remove use of linux specifix header files
<linux/nvhost.h> and <linux/nvhost_ioctl.h>
and use nvgpu specific header file <nvgpu/nvhost.h>
instead
This is needed to remove all Linux dependencies
from nvgpu driver
Replace all nvhost_*() calls by
nvgpu_nvhost_*() calls from new nvgpu library
Remove platform device pointer host1x_dev
from struct gk20a and add struct
nvgpu_nvhost_dev instead
Jira NVGPU-29
Change-Id: Ia7af70602cfc16f9ccc380752538c05a9cbb8a67
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1489726
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
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 = { |