diff options
Diffstat (limited to 'drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c')
-rw-r--r-- | drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c index 8b530fac..235473d3 100644 --- a/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c +++ b/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c | |||
@@ -14,7 +14,6 @@ | |||
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <linux/of_platform.h> | 16 | #include <linux/of_platform.h> |
17 | #include <linux/nvhost.h> | ||
18 | #include <linux/debugfs.h> | 17 | #include <linux/debugfs.h> |
19 | #include <linux/dma-buf.h> | 18 | #include <linux/dma-buf.h> |
20 | #include <linux/nvmap.h> | 19 | #include <linux/nvmap.h> |
@@ -30,6 +29,7 @@ | |||
30 | #include <nvgpu/bug.h> | 29 | #include <nvgpu/bug.h> |
31 | #include <nvgpu/enabled.h> | 30 | #include <nvgpu/enabled.h> |
32 | #include <nvgpu/hashtable.h> | 31 | #include <nvgpu/hashtable.h> |
32 | #include <nvgpu/nvhost.h> | ||
33 | 33 | ||
34 | #include "clk.h" | 34 | #include "clk.h" |
35 | 35 | ||
@@ -130,26 +130,14 @@ static void gp10b_tegra_scale_exit(struct device *dev) | |||
130 | static int gp10b_tegra_probe(struct device *dev) | 130 | static int gp10b_tegra_probe(struct device *dev) |
131 | { | 131 | { |
132 | struct gk20a_platform *platform = dev_get_drvdata(dev); | 132 | struct gk20a_platform *platform = dev_get_drvdata(dev); |
133 | struct gk20a *g = platform->g; | 133 | #ifdef CONFIG_TEGRA_GK20A_NVHOST |
134 | struct device_node *np = dev->of_node; | 134 | int ret; |
135 | struct device_node *host1x_node; | ||
136 | struct platform_device *host1x_pdev; | ||
137 | const __be32 *host1x_ptr; | ||
138 | |||
139 | host1x_ptr = of_get_property(np, "nvidia,host1x", NULL); | ||
140 | if (!host1x_ptr) { | ||
141 | nvgpu_err(g, "host1x device not available"); | ||
142 | return -ENOSYS; | ||
143 | } | ||
144 | 135 | ||
145 | host1x_node = of_find_node_by_phandle(be32_to_cpup(host1x_ptr)); | 136 | ret = nvgpu_get_nvhost_dev(platform->g); |
146 | host1x_pdev = of_find_device_by_node(host1x_node); | 137 | if (ret) |
147 | if (!host1x_pdev) { | 138 | return ret; |
148 | nvgpu_err(g, "host1x device not available"); | 139 | #endif |
149 | return -ENOSYS; | ||
150 | } | ||
151 | 140 | ||
152 | platform->g->host1x_dev = host1x_pdev; | ||
153 | platform->bypass_smmu = !device_is_iommuable(dev); | 141 | platform->bypass_smmu = !device_is_iommuable(dev); |
154 | platform->disable_bigpage = platform->bypass_smmu; | 142 | platform->disable_bigpage = platform->bypass_smmu; |
155 | 143 | ||
@@ -190,8 +178,11 @@ int gp10b_tegra_remove(struct device *dev) | |||
190 | /* deinitialise tegra specific scaling quirks */ | 178 | /* deinitialise tegra specific scaling quirks */ |
191 | gp10b_tegra_scale_exit(dev); | 179 | gp10b_tegra_scale_exit(dev); |
192 | 180 | ||
193 | return 0; | 181 | #ifdef CONFIG_TEGRA_GK20A_NVHOST |
182 | nvgpu_free_nvhost_dev(get_gk20a(dev)); | ||
183 | #endif | ||
194 | 184 | ||
185 | return 0; | ||
195 | } | 186 | } |
196 | 187 | ||
197 | static bool gp10b_tegra_is_railgated(struct device *dev) | 188 | static bool gp10b_tegra_is_railgated(struct device *dev) |