From 0ad7f1d9aa18d959abf3cba6ca4e532fc9246a31 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Thu, 25 May 2017 17:41:38 +0530 Subject: gpu: nvgpu: use nvgpu specific nvhost APIs Remove use of linux specifix header files and and use nvgpu specific header file 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 Reviewed-on: http://git-master/r/1489726 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani --- drivers/gpu/nvgpu/gk20a/platform_vgpu_tegra.c | 30 ++++++--------------------- 1 file changed, 6 insertions(+), 24 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/platform_vgpu_tegra.c') 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 @@ * more details. */ -#include - #include "gk20a.h" #include "hal_gk20a.h" #include "platform_gk20a.h" +#include + static int gk20a_tegra_probe(struct device *dev) { +#ifdef CONFIG_TEGRA_GK20A_NVHOST struct gk20a_platform *platform = dev_get_drvdata(dev); - struct device_node *np = dev->of_node; - const __be32 *host1x_ptr; - struct platform_device *host1x_pdev = NULL; - - host1x_ptr = of_get_property(np, "nvidia,host1x", NULL); - if (host1x_ptr) { - struct device_node *host1x_node = - of_find_node_by_phandle(be32_to_cpup(host1x_ptr)); - - host1x_pdev = of_find_device_by_node(host1x_node); - if (!host1x_pdev) { - dev_warn(dev, "host1x device not available"); - return -EPROBE_DEFER; - } - - } else { - host1x_pdev = to_platform_device(dev->parent); - dev_warn(dev, "host1x reference not found. assuming host1x to be parent"); - } - - platform->g->host1x_dev = host1x_pdev; - + return nvgpu_get_nvhost_dev(platform->g); +#else return 0; +#endif } struct gk20a_platform vgpu_tegra_platform = { -- cgit v1.2.2