summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c')
-rw-r--r--drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c44
1 files changed, 16 insertions, 28 deletions
diff --git a/drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c
index 8a83f7d0..f55ea6d2 100644
--- a/drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c
+++ b/drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c
@@ -15,9 +15,6 @@
15 15
16#include <linux/version.h> 16#include <linux/version.h>
17#include <linux/of_platform.h> 17#include <linux/of_platform.h>
18#ifdef CONFIG_TEGRA_GK20A_NVHOST
19#include <linux/nvhost.h>
20#endif
21#include <linux/debugfs.h> 18#include <linux/debugfs.h>
22#include <linux/platform_data/tegra_edp.h> 19#include <linux/platform_data/tegra_edp.h>
23#include <linux/delay.h> 20#include <linux/delay.h>
@@ -48,6 +45,7 @@
48#include <nvgpu/kmem.h> 45#include <nvgpu/kmem.h>
49#include <nvgpu/bug.h> 46#include <nvgpu/bug.h>
50#include <nvgpu/enabled.h> 47#include <nvgpu/enabled.h>
48#include <nvgpu/nvhost.h>
51 49
52#include <nvgpu/linux/dma.h> 50#include <nvgpu/linux/dma.h>
53 51
@@ -721,8 +719,8 @@ void gk20a_tegra_debug_dump(struct device *dev)
721 struct gk20a_platform *platform = gk20a_get_platform(dev); 719 struct gk20a_platform *platform = gk20a_get_platform(dev);
722 struct gk20a *g = platform->g; 720 struct gk20a *g = platform->g;
723 721
724 if (g->host1x_dev) 722 if (g->nvhost_dev)
725 nvhost_debug_dump_device(g->host1x_dev); 723 nvgpu_nvhost_debug_dump_device(g->nvhost_dev);
726#endif 724#endif
727} 725}
728 726
@@ -732,8 +730,8 @@ int gk20a_tegra_busy(struct device *dev)
732 struct gk20a_platform *platform = gk20a_get_platform(dev); 730 struct gk20a_platform *platform = gk20a_get_platform(dev);
733 struct gk20a *g = platform->g; 731 struct gk20a *g = platform->g;
734 732
735 if (g->host1x_dev) 733 if (g->nvhost_dev)
736 return nvhost_module_busy_ext(g->host1x_dev); 734 return nvgpu_nvhost_module_busy_ext(g->nvhost_dev);
737#endif 735#endif
738 return 0; 736 return 0;
739} 737}
@@ -744,8 +742,8 @@ void gk20a_tegra_idle(struct device *dev)
744 struct gk20a_platform *platform = gk20a_get_platform(dev); 742 struct gk20a_platform *platform = gk20a_get_platform(dev);
745 struct gk20a *g = platform->g; 743 struct gk20a *g = platform->g;
746 744
747 if (g->host1x_dev) 745 if (g->nvhost_dev)
748 nvhost_module_idle_ext(g->host1x_dev); 746 nvgpu_nvhost_module_idle_ext(g->nvhost_dev);
749#endif 747#endif
750} 748}
751 749
@@ -864,8 +862,6 @@ static int gk20a_tegra_probe(struct device *dev)
864{ 862{
865 struct gk20a_platform *platform = dev_get_drvdata(dev); 863 struct gk20a_platform *platform = dev_get_drvdata(dev);
866 struct device_node *np = dev->of_node; 864 struct device_node *np = dev->of_node;
867 const __be32 *host1x_ptr;
868 struct platform_device *host1x_pdev = NULL;
869 bool joint_xpu_rail = false; 865 bool joint_xpu_rail = false;
870 int ret; 866 int ret;
871 867
@@ -887,23 +883,11 @@ static int gk20a_tegra_probe(struct device *dev)
887 } 883 }
888#endif 884#endif
889 885
890 host1x_ptr = of_get_property(np, "nvidia,host1x", NULL); 886#ifdef CONFIG_TEGRA_GK20A_NVHOST
891 if (host1x_ptr) { 887 ret = nvgpu_get_nvhost_dev(platform->g);
892 struct device_node *host1x_node = 888 if (ret)
893 of_find_node_by_phandle(be32_to_cpup(host1x_ptr)); 889 return ret;
894 890#endif
895 host1x_pdev = of_find_device_by_node(host1x_node);
896 if (!host1x_pdev) {
897 dev_warn(dev, "host1x device not available");
898 return -EPROBE_DEFER;
899 }
900
901 } else {
902 host1x_pdev = to_platform_device(dev->parent);
903 dev_warn(dev, "host1x reference not found. assuming host1x to be parent");
904 }
905
906 platform->g->host1x_dev = host1x_pdev;
907 891
908#ifdef CONFIG_OF 892#ifdef CONFIG_OF
909 joint_xpu_rail = of_property_read_bool(of_chosen, 893 joint_xpu_rail = of_property_read_bool(of_chosen,
@@ -967,6 +951,10 @@ static int gk20a_tegra_remove(struct device *dev)
967 /* deinitialise tegra specific scaling quirks */ 951 /* deinitialise tegra specific scaling quirks */
968 gk20a_tegra_scale_exit(dev); 952 gk20a_tegra_scale_exit(dev);
969 953
954#ifdef CONFIG_TEGRA_GK20A_NVHOST
955 nvgpu_free_nvhost_dev(get_gk20a(dev));
956#endif
957
970 return 0; 958 return 0;
971} 959}
972 960